|
@@ -3,7 +3,7 @@
|
|
|
<BaseDialog
|
|
|
width="1400px"
|
|
|
:isShow.sync="isShow"
|
|
|
- :title="['新增', '修改', '复制'][type]"
|
|
|
+ :title="title"
|
|
|
@close="close"
|
|
|
@submit="submitForm"
|
|
|
>
|
|
@@ -67,8 +67,8 @@
|
|
|
:rules="rules['itemCategory']"
|
|
|
>
|
|
|
<el-select v-model="item.itemCategory" placeholder="请选择成本类型">
|
|
|
- <el-option label="业务类型" value="1"></el-option>
|
|
|
- <el-option label="非分成" value="2"></el-option>
|
|
|
+ <el-option label="业务类型" :value="1"></el-option>
|
|
|
+ <el-option label="非分成" :value="2"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<template v-if="item.itemCategory == 1">
|
|
@@ -118,8 +118,8 @@
|
|
|
:rules="rules['itemType']"
|
|
|
>
|
|
|
<el-select v-model="item.itemType" placeholder="请选择成本类型">
|
|
|
- <el-option label="百分比成本" value="1"></el-option>
|
|
|
- <el-option label="固定成本" value="2"></el-option>
|
|
|
+ <el-option label="百分比成本" :value="1"></el-option>
|
|
|
+ <el-option label="固定成本" :value="2"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
@@ -179,7 +179,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { eduList, addCost, costDetal } from "@/api/financed/index";
|
|
|
+import { eduList, addCost, costDetail, editCost } from "@/api/financed/index";
|
|
|
export default {
|
|
|
name: "DislogSet",
|
|
|
props: {
|
|
@@ -187,7 +187,7 @@ export default {
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
|
},
|
|
|
- // 1 新增 2修改 3复制
|
|
|
+ // 0 新增 1修改 2复制
|
|
|
type: {
|
|
|
type: [String, Number],
|
|
|
default: 0,
|
|
@@ -229,31 +229,23 @@ export default {
|
|
|
{ required: true, message: "请输入百分比成本", trigger: "blur" },
|
|
|
],
|
|
|
},
|
|
|
- eduTypeOptions: [],
|
|
|
- newCourTypeOptions: [],
|
|
|
companyList: [],
|
|
|
eduList: [],
|
|
|
- courType: 0,
|
|
|
};
|
|
|
},
|
|
|
-
|
|
|
- mounted() {
|
|
|
- console.log(8798465465);
|
|
|
- },
|
|
|
-
|
|
|
methods: {
|
|
|
init() {
|
|
|
this.resetForm();
|
|
|
- if (this.tpId) {
|
|
|
- this.getCostDetal();
|
|
|
- console.log(this.tpId, 666);
|
|
|
- }
|
|
|
+ this.tpId && this.getCostDetail();
|
|
|
this.getCompanyList();
|
|
|
this.getEduList();
|
|
|
},
|
|
|
- getCostDetal() {
|
|
|
- costDetal({ tpId: this.tpId }).then((res) => {
|
|
|
- console.log(res.rows, 89);
|
|
|
+ getCostDetail() {
|
|
|
+ costDetail(this.tpId).then((res) => {
|
|
|
+ if (this.type == 2) delete res.data["tpId"];
|
|
|
+ Object.keys(this.form).map((key) => {
|
|
|
+ this.form[key] = res.data[key];
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
getEduList() {
|
|
@@ -313,21 +305,25 @@ export default {
|
|
|
maxValue: undefined,
|
|
|
},
|
|
|
],
|
|
|
+ tpId: undefined,
|
|
|
tpName: 123,
|
|
|
defaultStatus: 0,
|
|
|
tenantId: "1",
|
|
|
};
|
|
|
},
|
|
|
+ cb() {
|
|
|
+ this.$message.success(this.title + "成功");
|
|
|
+ this.isShow = false;
|
|
|
+ this.$emit("search");
|
|
|
+ },
|
|
|
submitForm() {
|
|
|
- console.log(1232132);
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- console.log(13213);
|
|
|
- addCost(this.form).then((res) => {
|
|
|
- console.log(res, 666);
|
|
|
- this.isShow = false;
|
|
|
- this.$emit("search");
|
|
|
- });
|
|
|
+ if (this.type !== 1) {
|
|
|
+ addCost(this.form).then(this.cb);
|
|
|
+ } else {
|
|
|
+ editCost(this.form).then(this.cb);
|
|
|
+ }
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
@@ -346,6 +342,9 @@ export default {
|
|
|
this.$emit("update:dialogVisible", false);
|
|
|
},
|
|
|
},
|
|
|
+ title() {
|
|
|
+ return ["新增", "修改", "复制"][this.type];
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|