|
@@ -197,9 +197,13 @@
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading" v-if="modalType == 'add'">
|
|
|
+ <el-button type="primary" @click="submitForm(10)" size="large" :loading="submitLoading" v-if="modalType == 'add'">
|
|
|
+
|
|
|
+ 暂 存 </el-button>
|
|
|
+ <el-button type="primary" @click="submitForm(20)" size="large" :loading="submitLoading" v-if="modalType == 'add'">
|
|
|
确 定
|
|
|
</el-button>
|
|
|
+
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -260,6 +264,9 @@ const rules = ref({
|
|
|
customerId: [
|
|
|
{ required: true, message: "请选择客户名称", trigger: "change" },
|
|
|
],
|
|
|
+ devUserId: [
|
|
|
+ { required: true, message: "请选择研发负责人", trigger: "change" },
|
|
|
+ ],
|
|
|
shroffAccountId: [
|
|
|
{ required: true, message: "请选择收款账户", trigger: "change" },
|
|
|
],
|
|
@@ -382,9 +389,8 @@ const config = computed(() => {
|
|
|
},
|
|
|
renderHTML(row) {
|
|
|
return [
|
|
|
- row.isSettled == "1"
|
|
|
- ? {}
|
|
|
- : {
|
|
|
+ row.isSettled == "0" && row.flowStatus != 0
|
|
|
+ ? {
|
|
|
attrs: {
|
|
|
label: "结清",
|
|
|
type: "primary",
|
|
@@ -410,18 +416,21 @@ const config = computed(() => {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- },
|
|
|
- // {
|
|
|
- // attrs: {
|
|
|
- // label: "查看",
|
|
|
- // type: "primary",
|
|
|
- // text: true,
|
|
|
- // },
|
|
|
- // el: "button",
|
|
|
- // click() {
|
|
|
- // getDtl(row);
|
|
|
- // },
|
|
|
- // },
|
|
|
+ }
|
|
|
+ : {},
|
|
|
+ row.flowStatus == 0
|
|
|
+ ? {
|
|
|
+ attrs: {
|
|
|
+ label: "修改",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ getDtlOne(row);
|
|
|
+ },
|
|
|
+ }
|
|
|
+ : {},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "打印",
|
|
@@ -541,6 +550,17 @@ const formConfig = computed(() => {
|
|
|
slotName: "products",
|
|
|
label: "合同明细",
|
|
|
},
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
+ prop: "devUserId",
|
|
|
+ label: "研发负责人",
|
|
|
+ required: true,
|
|
|
+ filterable: true,
|
|
|
+ data: devUserList.value,
|
|
|
+ style: {
|
|
|
+ width: "100%",
|
|
|
+ },
|
|
|
+ },
|
|
|
];
|
|
|
});
|
|
|
const getList = async (req) => {
|
|
@@ -565,7 +585,7 @@ const openModal = () => {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
-const submitForm = () => {
|
|
|
+const submitForm = (type) => {
|
|
|
byform.value.handleSubmit(() => {
|
|
|
if (!formData.data.salesContractDetailsList.length > 0) {
|
|
|
return ElMessage({
|
|
@@ -573,16 +593,12 @@ const submitForm = () => {
|
|
|
type: "info",
|
|
|
});
|
|
|
}
|
|
|
- submitLoading.value = true;
|
|
|
- proxy
|
|
|
- .post("/flowProcess/initiate", {
|
|
|
- flowKey: "jxst_sales_contract_flow",
|
|
|
- data: formData.data,
|
|
|
- })
|
|
|
- .then(
|
|
|
+ if (type == 10) {
|
|
|
+ submitLoading.value = true;
|
|
|
+ proxy.post("/salesContract/add", formData.data).then(
|
|
|
() => {
|
|
|
ElMessage({
|
|
|
- message: "添加成功",
|
|
|
+ message: "暂存成功",
|
|
|
type: "success",
|
|
|
});
|
|
|
dialogVisible.value = false;
|
|
@@ -591,9 +607,31 @@ const submitForm = () => {
|
|
|
},
|
|
|
(err) => {
|
|
|
console.log(err);
|
|
|
- submitLoading.value = false;
|
|
|
}
|
|
|
);
|
|
|
+ } else {
|
|
|
+ submitLoading.value = true;
|
|
|
+ proxy
|
|
|
+ .post("/flowProcess/initiate", {
|
|
|
+ flowKey: "jxst_sales_contract_flow",
|
|
|
+ data: formData.data,
|
|
|
+ })
|
|
|
+ .then(
|
|
|
+ () => {
|
|
|
+ ElMessage({
|
|
|
+ message: "添加成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ dialogVisible.value = false;
|
|
|
+ submitLoading.value = false;
|
|
|
+ getList();
|
|
|
+ },
|
|
|
+ (err) => {
|
|
|
+ console.log(err);
|
|
|
+ submitLoading.value = false;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
});
|
|
|
};
|
|
|
const getDtl = (row) => {
|
|
@@ -610,8 +648,23 @@ const getDtl = (row) => {
|
|
|
dialogVisible.value = true;
|
|
|
});
|
|
|
};
|
|
|
+const getDtlOne = (row) => {
|
|
|
+ modalType.value = "add";
|
|
|
+ formOption.disabled = false;
|
|
|
+ proxy.post("/salesContract/detail", { id: row.id }).then((res) => {
|
|
|
+ if (res && res.contractDetailsList.length > 0) {
|
|
|
+ res.salesContractDetailsList = res.contractDetailsList;
|
|
|
+ } else {
|
|
|
+ res.salesContractDetailsList = [];
|
|
|
+ }
|
|
|
+ formData.data = res;
|
|
|
+ changeAmount();
|
|
|
+ dialogVisible.value = true;
|
|
|
+ });
|
|
|
+};
|
|
|
|
|
|
const customerData = ref([]);
|
|
|
+const devUserList = ref([]);
|
|
|
const accountList = ref([]);
|
|
|
const corporationList = ref([]);
|
|
|
const payMethodData = ref([]);
|
|
@@ -632,6 +685,23 @@ const getDict = () => {
|
|
|
value: x.id,
|
|
|
}));
|
|
|
});
|
|
|
+
|
|
|
+ proxy
|
|
|
+ .post("/system/user/getUserList", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9999,
|
|
|
+ roleKey: "dev",
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ devUserList.value = res.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ label: item.nickName,
|
|
|
+ value: item.userId,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
proxy
|
|
|
.post("/accountManagement/page", { pageNum: 1, pageSize: 999 })
|
|
|
.then((res) => {
|
|
@@ -653,6 +723,7 @@ const getDict = () => {
|
|
|
};
|
|
|
});
|
|
|
});
|
|
|
+
|
|
|
proxy.getDict(["funds_payment_method"]).then((res) => {
|
|
|
payMethodData.value = res["funds_payment_method"].map((x) => ({
|
|
|
label: x.dictValue,
|