|
@@ -29,7 +29,7 @@
|
|
|
</el-table>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog :title="modalType == 'add' ? '添加科目' : '编辑科目'" v-if="dialogVisible" v-model="dialogVisible" width="500" v-loading="loadingDialog">
|
|
|
+ <el-dialog :title="modalType == 'add' ? '添加科目' : '编辑科目'" v-if="dialogVisible" v-model="dialogVisible" width="50%" v-loading="loadingDialog">
|
|
|
<byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
|
|
|
<!-- <template #parentId>
|
|
|
<div style="width: 100%">
|
|
@@ -68,7 +68,9 @@ import byForm from "@/components/byForm/index";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
-
|
|
|
+const accountingSubjects = computed(
|
|
|
+ () => proxy.useUserStore().allDict["accounting_subjects"]
|
|
|
+);
|
|
|
const defaultProps = {
|
|
|
children: "children",
|
|
|
label: "subjectsName",
|
|
@@ -194,10 +196,19 @@ const formConfig = computed(() => {
|
|
|
// fn: (val) => {},
|
|
|
// },
|
|
|
{
|
|
|
- type: "input",
|
|
|
- prop: "calculateItemName",
|
|
|
+ type: "select",
|
|
|
label: "核算项目名称",
|
|
|
+ prop: "calculateItemName",
|
|
|
+ itemWidth: 100,
|
|
|
+ data: accountingSubjects.value,
|
|
|
+ multiple: true,
|
|
|
},
|
|
|
+
|
|
|
+ // {
|
|
|
+ // type: "input",
|
|
|
+ // prop: "calculateItemName",
|
|
|
+ // label: "核算项目名称",
|
|
|
+ // },
|
|
|
// {
|
|
|
// type: "slot",
|
|
|
// prop: "orderNum",
|
|
@@ -229,6 +240,9 @@ const rules = ref({
|
|
|
paymentTypeId: [
|
|
|
{ required: true, message: "请选择收费款类型", trigger: "change" },
|
|
|
],
|
|
|
+ calculateItemName: [
|
|
|
+ { required: true, message: "请选择核算项目名称", trigger: "change" },
|
|
|
+ ],
|
|
|
});
|
|
|
const disabledType = ref(false);
|
|
|
const openModal = (row) => {
|
|
@@ -236,6 +250,7 @@ const openModal = (row) => {
|
|
|
modalType.value = "add";
|
|
|
formData.data = {
|
|
|
parentId: "",
|
|
|
+ calculateItemName: [],
|
|
|
};
|
|
|
if (row && row.id) {
|
|
|
formData.data.parentId = row.id;
|
|
@@ -247,13 +262,20 @@ const openModal = (row) => {
|
|
|
const submitForm = () => {
|
|
|
submit.value.handleSubmit(() => {
|
|
|
loadingDialog.value = true;
|
|
|
- proxy
|
|
|
- .post("/accountSubjects/" + modalType.value, formData.data)
|
|
|
- .then(() => {
|
|
|
+ formData.data.calculateItemName = formData.data.calculateItemName.join(",");
|
|
|
+ proxy.post("/accountSubjects/" + modalType.value, formData.data).then(
|
|
|
+ () => {
|
|
|
proxy.msgTip("操作成功", 1);
|
|
|
dialogVisible.value = false;
|
|
|
+ loadingDialog.value = false;
|
|
|
getList();
|
|
|
- });
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ formData.data.calculateItemName =
|
|
|
+ formData.data.calculateItemName.split(",");
|
|
|
+ loadingDialog.value = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -279,6 +301,7 @@ const checkIsTopData = (parentId) => {
|
|
|
|
|
|
const getDtl = (row) => {
|
|
|
formData.data = proxy.deepClone(row);
|
|
|
+ formData.data.calculateItemName = formData.data.calculateItemName.split(",");
|
|
|
modalType.value = "edit";
|
|
|
dialogVisible.value = true;
|
|
|
};
|