|
@@ -346,7 +346,7 @@ export default {
|
|
|
|
|
|
// 子表下拉框改变
|
|
// 子表下拉框改变
|
|
handleTabSelectChange(type,row){
|
|
handleTabSelectChange(type,row){
|
|
-
|
|
|
|
|
|
+
|
|
// && row.qty
|
|
// && row.qty
|
|
if(type == 'priceType' && row.material && row.qty != ""){
|
|
if(type == 'priceType' && row.material && row.qty != ""){
|
|
|
|
|
|
@@ -358,16 +358,36 @@ export default {
|
|
},
|
|
},
|
|
// 子表inputNumber
|
|
// 子表inputNumber
|
|
handleInputChange(row, type) {
|
|
handleInputChange(row, type) {
|
|
|
|
+
|
|
|
|
+
|
|
// 物料数量变化----询价
|
|
// 物料数量变化----询价
|
|
- if (type == 'qty' && row.material) {
|
|
|
|
|
|
+ if (type == 'qty' && row.material ) {
|
|
|
|
|
|
- row['whetherCompleteInquiry'] = false;
|
|
|
|
|
|
+ if(this.params.status === '2'){
|
|
|
|
|
|
- // row.qty && this.handleGetPrice();
|
|
|
|
- this.handleGetPrice();
|
|
|
|
|
|
+ // 修订
|
|
|
|
+ this.handleCalculateOrderAmount();
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+
|
|
|
|
+ row['whetherCompleteInquiry'] = false;
|
|
|
|
+
|
|
|
|
+ row.qty && this.handleGetPrice();
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // // 物料数量变化----询价
|
|
|
|
+ // if (type == 'qty' && row.material) {
|
|
|
|
+
|
|
|
|
+ // row['whetherCompleteInquiry'] = false;
|
|
|
|
+
|
|
|
|
+ // // row.qty && this.handleGetPrice();
|
|
|
|
+ // this.handleGetPrice();
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+
|
|
},
|
|
},
|
|
// 子表多选框改变
|
|
// 子表多选框改变
|
|
handleTabCheckbox(type,source){
|
|
handleTabCheckbox(type,source){
|
|
@@ -398,17 +418,33 @@ export default {
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 修订——计算金额
|
|
|
|
+ async handleCalculateOrderAmount(){
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ let { code, data } = await orderApi.calculateOrderAmount({
|
|
|
|
+ ...this.params,
|
|
|
|
+ action: this.handleIsRevise() ? 'revise':'update',
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ code == 200 && (this.params = data);
|
|
|
|
+
|
|
|
|
+ } catch (error) {}
|
|
|
|
+ finally {}
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+
|
|
// 判断修订还是编辑
|
|
// 判断修订还是编辑
|
|
handleIsRevise() {
|
|
handleIsRevise() {
|
|
return this.params.status == '2';
|
|
return this.params.status == '2';
|
|
},
|
|
},
|
|
|
|
|
|
// /handleIsRevise() ? scope.row[cColumn.key] : Infinity
|
|
// /handleIsRevise() ? scope.row[cColumn.key] : Infinity
|
|
- getInputNumberMax(key,num){
|
|
|
|
|
|
+ getInputNumberMax(key,row){
|
|
|
|
|
|
if(key === 'qty'){
|
|
if(key === 'qty'){
|
|
|
|
|
|
- return this.handleIsRevise() ? num : Infinity
|
|
|
|
|
|
+ return this.handleIsRevise() ? row['originalQty'] : Infinity
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -495,7 +531,7 @@ export default {
|
|
<el-input-number v-if="column.inputType === 'InputNumber'"
|
|
<el-input-number v-if="column.inputType === 'InputNumber'"
|
|
v-model="params[column.key]"
|
|
v-model="params[column.key]"
|
|
:precision="column.precision"
|
|
:precision="column.precision"
|
|
- :max="getInputNumberMax(column.key, params[column.key])"
|
|
|
|
|
|
+ :max="handleIsRevise() ? params[column.key] : Infinity"
|
|
:controls-position="column.controlsPosition"
|
|
:controls-position="column.controlsPosition"
|
|
:placeholder="column.placeholder"
|
|
:placeholder="column.placeholder"
|
|
:clearable="column.clearable"
|
|
:clearable="column.clearable"
|
|
@@ -654,7 +690,7 @@ export default {
|
|
v-model="scope.row[cColumn.key]"
|
|
v-model="scope.row[cColumn.key]"
|
|
:precision="cColumn.precision"
|
|
:precision="cColumn.precision"
|
|
:controls-position="cColumn.controlsPosition"
|
|
:controls-position="cColumn.controlsPosition"
|
|
- :max="getInputNumberMax(cColumn.key, scope.row[cColumn.key])"
|
|
|
|
|
|
+ :max="getInputNumberMax(cColumn.key, scope.row)"
|
|
@change="handleInputChange(scope.row, cColumn.key)"
|
|
@change="handleInputChange(scope.row, cColumn.key)"
|
|
:placeholder="cColumn.placeholder"
|
|
:placeholder="cColumn.placeholder"
|
|
:clearable="cColumn.clearable"
|
|
:clearable="cColumn.clearable"
|