|
@@ -20,6 +20,7 @@ export default {
|
|
|
FileUploadCenter: () => import("../components/FileUploadCenter/index.vue"),
|
|
|
BatchImport: () => import("@/components/BatchImport/index.vue"),
|
|
|
ButtonHide: () => import("../components/hide/index.vue"),
|
|
|
+ CgxjButton: () => import("../cai-gou-xun-jia/index.vue"),
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -82,6 +83,21 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
+ // 手动询价
|
|
|
+ isManualInquiry: {
|
|
|
+ get() {
|
|
|
+ let { handleIsRevise, role, params } = this;
|
|
|
+ if (
|
|
|
+ !handleIsRevise() &&
|
|
|
+ role === "procurementManager" &&
|
|
|
+ params.source != "3"
|
|
|
+ ) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ set() {},
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
"params.contractType": function (newProp) {
|
|
@@ -434,6 +450,19 @@ export default {
|
|
|
});
|
|
|
|
|
|
Promise.all(promiseArr).then(async () => {
|
|
|
+ // 需要手动询价
|
|
|
+ if (this.isManualInquiry) {
|
|
|
+ // 清空含税单价
|
|
|
+ this.params["puOrderItemList"] = this.params[
|
|
|
+ "puOrderItemList"
|
|
|
+ ].map((item) => ({
|
|
|
+ ...item,
|
|
|
+ taxPrice: 0,
|
|
|
+ money: 0,
|
|
|
+ }));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
// 明细不为空的情况下进行询价
|
|
|
let detailList = this.params["puOrderItemList"].filter(
|
|
|
(item) => item.material && item.material != ""
|
|
@@ -489,35 +518,6 @@ export default {
|
|
|
},
|
|
|
// 子表参照改变之后
|
|
|
async handleTabReferChange(val, type, source) {
|
|
|
- // 触发物料参照
|
|
|
- if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
|
|
|
- source["qty"] = 0;
|
|
|
-
|
|
|
- // source['whetherCompleteInquiry'] = false;
|
|
|
-
|
|
|
- source["taxPrice"] = 0;
|
|
|
-
|
|
|
- source["money"] = 0;
|
|
|
-
|
|
|
- source["taxDeductMoneya"] = 0;
|
|
|
-
|
|
|
- source["price"] = 0;
|
|
|
-
|
|
|
- source["notaxMoney"] = 0;
|
|
|
-
|
|
|
- source["tax"] = 0;
|
|
|
-
|
|
|
- this.params["qty"] = 0;
|
|
|
- this.params["originalQty"] = 0;
|
|
|
- this.params["money"] = 0;
|
|
|
- this.params["originalMoney"] = 0;
|
|
|
- this.params["notaxMoney"] = 0;
|
|
|
-
|
|
|
- source.isDrug = val.materialMedcine.isDrug == "0" ? "Y" : "N";
|
|
|
-
|
|
|
- // await this.handleGetPrice();
|
|
|
- }
|
|
|
-
|
|
|
// 物料触发税率
|
|
|
if (type == "MATERIAL_PARAM") {
|
|
|
let { rateCode } = source;
|
|
@@ -533,6 +533,34 @@ export default {
|
|
|
// finally
|
|
|
this.loading = false;
|
|
|
}
|
|
|
+
|
|
|
+ if (source.qty && source.qty != "") {
|
|
|
+ source["qty"] = 0;
|
|
|
+
|
|
|
+ // source['whetherCompleteInquiry'] = false;
|
|
|
+
|
|
|
+ source["taxPrice"] = 0;
|
|
|
+
|
|
|
+ source["money"] = 0;
|
|
|
+
|
|
|
+ source["taxDeductMoneya"] = 0;
|
|
|
+
|
|
|
+ source["price"] = 0;
|
|
|
+
|
|
|
+ source["notaxMoney"] = 0;
|
|
|
+
|
|
|
+ source["tax"] = 0;
|
|
|
+
|
|
|
+ this.params["qty"] = 0;
|
|
|
+ this.params["originalQty"] = 0;
|
|
|
+ this.params["money"] = 0;
|
|
|
+ this.params["originalMoney"] = 0;
|
|
|
+ this.params["notaxMoney"] = 0;
|
|
|
+
|
|
|
+ source.isDrug = val.materialMedcine.isDrug == "0" ? "Y" : "N";
|
|
|
+
|
|
|
+ // await this.handleGetPrice();
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -559,15 +587,51 @@ export default {
|
|
|
|
|
|
// 子表下拉框改变
|
|
|
handleTabSelectChange(type, row) {
|
|
|
- // && row.qty
|
|
|
- if (type == "priceType" && row.material && row.qty != "") {
|
|
|
- // row['whetherCompleteInquiry'] = false;
|
|
|
+ if (type == "priceType") {
|
|
|
+ // 需要手动询价
|
|
|
+ if (this.isManualInquiry) {
|
|
|
+ // 清空含税单价
|
|
|
+ row["taxPrice"] = 0;
|
|
|
+ row["money"] = 0;
|
|
|
+ this.params.money = this.params["puOrderItemList"].reduce(
|
|
|
+ (total, item) => {
|
|
|
+ return (total += item.money);
|
|
|
+ },
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
- this.handleGetPrice();
|
|
|
+ if (row.material && row.qty != "") {
|
|
|
+ // row['whetherCompleteInquiry'] = false;
|
|
|
+ this.handleGetPrice();
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 子表inputNumber
|
|
|
handleInputChange(row, type) {
|
|
|
+ if (this.isManualInquiry) {
|
|
|
+ if (type == "qty" || type === "taxPrice") {
|
|
|
+ // 不进行询价
|
|
|
+ row.money = Number(row.taxPrice) * Number(row.qty);
|
|
|
+
|
|
|
+ // 主表价税合计
|
|
|
+ this.params.money = this.params["puOrderItemList"].reduce(
|
|
|
+ (total, item) => {
|
|
|
+ return (total += item.money);
|
|
|
+ },
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ this.params.qty = this.params["puOrderItemList"].reduce(
|
|
|
+ (total, item) => {
|
|
|
+ return (total += item.qty);
|
|
|
+ },
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 物料数量变化----询价
|
|
|
if (
|
|
|
(type == "qty" || type == "taxPrice" || type == "taxDeductMoneya") &&
|
|
@@ -585,27 +649,30 @@ export default {
|
|
|
this.$refs.puOrderItemList[0].updateFooter();
|
|
|
// this.$refs.puOrderExecuteList[0].updateFooter();
|
|
|
}
|
|
|
-
|
|
|
- // // 物料数量变化----询价
|
|
|
- // if (type == 'qty' && row.material) {
|
|
|
-
|
|
|
- // row['whetherCompleteInquiry'] = false;
|
|
|
-
|
|
|
- // // row.qty && this.handleGetPrice();
|
|
|
- // this.handleGetPrice();
|
|
|
-
|
|
|
- // }
|
|
|
},
|
|
|
// 子表多选框改变
|
|
|
- handleTabCheckbox(type, source) {
|
|
|
+ handleTabCheckbox(type, row) {
|
|
|
+ if (type == "isGift" && this.isManualInquiry) {
|
|
|
+ if (row.isGift === "Y") {
|
|
|
+ row.money = 0;
|
|
|
+ } else {
|
|
|
+ row.money = Number(row.taxPrice) * Number(row.qty);
|
|
|
+ }
|
|
|
+ // 不进行询价
|
|
|
+
|
|
|
+ // 主表价税合计
|
|
|
+ this.params.money = this.params["puOrderItemList"].reduce(
|
|
|
+ (total, item) => {
|
|
|
+ return (total += item.money);
|
|
|
+ },
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
// 勾选赠品,价税合计更新为0,含税单价、无税单价更新为0
|
|
|
- if (
|
|
|
- type === "isGift" &&
|
|
|
- source.material &&
|
|
|
- source.qty &&
|
|
|
- source.qty != ""
|
|
|
- ) {
|
|
|
- // source['whetherCompleteInquiry'] = false;
|
|
|
+ if (type === "isGift" && row.material && row.qty && row.qty != "") {
|
|
|
+ // row['whetherCompleteInquiry'] = false;
|
|
|
|
|
|
this.handleGetPrice();
|
|
|
}
|
|
@@ -840,9 +907,32 @@ export default {
|
|
|
return {
|
|
|
...item,
|
|
|
qty: munList[index] || item.qty,
|
|
|
+ money: this.isManualInquiry
|
|
|
+ ? Number(item.taxPrice) * Number(item.qty)
|
|
|
+ : item.money,
|
|
|
};
|
|
|
});
|
|
|
this.params.puOrderItemList = [...invariant, ...change];
|
|
|
+
|
|
|
+ if (this.isManualInquiry) {
|
|
|
+ // 不进行询价
|
|
|
+
|
|
|
+ // 主表价税合计
|
|
|
+ this.params.money = this.params["puOrderItemList"].reduce(
|
|
|
+ (total, item) => {
|
|
|
+ return (total += Number(item.money));
|
|
|
+ },
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ // 原始总数量
|
|
|
+ this.params.qty = this.params["puOrderItemList"].reduce(
|
|
|
+ (total, item) => {
|
|
|
+ return (total += Number(item.qty));
|
|
|
+ },
|
|
|
+ 0
|
|
|
+ );
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (this.params.status === "2") {
|
|
|
// 修订
|
|
|
this.handleCalculateOrderAmount();
|
|
@@ -906,6 +996,17 @@ export default {
|
|
|
>
|
|
|
<h3>{{ handleIsRevise() ? "修订" : "编辑" }}</h3>
|
|
|
<div style="text-align: right">
|
|
|
+ <!-- 编辑 非自制 采购角色 -->
|
|
|
+ <cgxj-button
|
|
|
+ v-if="
|
|
|
+ !handleIsRevise() &&
|
|
|
+ role === 'procurementManager' &&
|
|
|
+ params.source != '3'
|
|
|
+ "
|
|
|
+ v-model="params"
|
|
|
+ :size="size"
|
|
|
+ :source.sync="params"
|
|
|
+ ></cgxj-button>
|
|
|
<el-button :size="size" type="primary" @click="handleSava"
|
|
|
>更 新</el-button
|
|
|
>
|