|
|
@@ -33,11 +33,10 @@
|
|
|
>
|
|
|
新增
|
|
|
</el-button>
|
|
|
-
|
|
|
</div>
|
|
|
<div class="pricebox">
|
|
|
<span class="amount">总计:{{ allPrice }}元</span>
|
|
|
-
|
|
|
+
|
|
|
<el-form-item
|
|
|
style="width: 300px"
|
|
|
v-if="isDiscountTotalPrice"
|
|
|
@@ -93,10 +92,7 @@
|
|
|
<span class="is-required">{{ column.label }}</span>
|
|
|
</template>
|
|
|
<template v-slot:customerMark="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="'datasource.' + $index + '.customerMark'"
|
|
|
-
|
|
|
- >
|
|
|
+ <el-form-item :prop="'datasource.' + $index + '.customerMark'">
|
|
|
<el-input v-model="row.customerMark" placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
@@ -125,11 +121,10 @@
|
|
|
style="margin-bottom: 20px"
|
|
|
:prop="'datasource.' + scope.$index + '.totalCount'"
|
|
|
:rules="{
|
|
|
- required: isTotalCount?true:false,
|
|
|
+ required: isTotalCount ? true : false,
|
|
|
message: '请输入单价',
|
|
|
trigger: 'change'
|
|
|
}"
|
|
|
-
|
|
|
>
|
|
|
<el-input
|
|
|
:disabled="isContractId"
|
|
|
@@ -140,11 +135,8 @@
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
- <template
|
|
|
- v-slot:headerTotalCount="{ column }"
|
|
|
-
|
|
|
- >
|
|
|
- <span :class="{'is-required':isTotalCount}">{{ column.label }}</span>
|
|
|
+ <template v-slot:headerTotalCount="{ column }">
|
|
|
+ <span :class="{ 'is-required': isTotalCount }">{{ column.label }}</span>
|
|
|
</template>
|
|
|
<template v-slot:totalPrice="scope">
|
|
|
<el-form-item
|
|
|
@@ -257,7 +249,7 @@
|
|
|
style="margin-bottom: 20px"
|
|
|
:prop="'datasource.' + scope.$index + '.singlePrice'"
|
|
|
:rules="{
|
|
|
- required: isSinglePrice?true:false,
|
|
|
+ required: isSinglePrice ? true : false,
|
|
|
message: '请输入单价',
|
|
|
trigger: 'change'
|
|
|
}"
|
|
|
@@ -283,18 +275,16 @@
|
|
|
v-model="scope.row.taxRate"
|
|
|
placeholder="请输入"
|
|
|
type="number"
|
|
|
-
|
|
|
>
|
|
|
<template slot="append">%</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
-
|
|
|
- <template
|
|
|
- v-slot:headerSinglePrice="{ column }"
|
|
|
-
|
|
|
- >
|
|
|
- <span :class="isSinglePrice?'is-required':''">{{ column.label }}</span>
|
|
|
+
|
|
|
+ <template v-slot:headerSinglePrice="{ column }">
|
|
|
+ <span :class="isSinglePrice ? 'is-required' : ''">{{
|
|
|
+ column.label
|
|
|
+ }}</span>
|
|
|
</template>
|
|
|
<template v-slot:headerCustomerExpectDeliveryDeadline="{ column }">
|
|
|
<span :class="contractBookType == 1 ? 'is-required' : ''">{{
|
|
|
@@ -402,7 +392,7 @@
|
|
|
</template>
|
|
|
<template v-slot:customerExpectDeliveryDeadline="scope">
|
|
|
<el-form-item
|
|
|
- :rules="{
|
|
|
+ :rules="{
|
|
|
required: true,
|
|
|
message:
|
|
|
contractBookType == 1 ? '请选择客户期望交期' : '请选择交付日期',
|
|
|
@@ -440,7 +430,6 @@
|
|
|
<template v-slot:singleWeight="scope">
|
|
|
<el-form-item
|
|
|
style="margin-bottom: 20px"
|
|
|
-
|
|
|
:prop="'datasource.' + scope.$index + '.singleWeight'"
|
|
|
>
|
|
|
<el-input
|
|
|
@@ -470,7 +459,15 @@
|
|
|
</template>
|
|
|
<template v-slot:pricingWay="scope">
|
|
|
<el-form-item :prop="'datasource.' + scope.$index + '.pricingWay'">
|
|
|
- <el-select v-model="scope.row.pricingWay" placeholder="请选择">
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row.pricingWay"
|
|
|
+ placeholder="请选择"
|
|
|
+ :rules="{
|
|
|
+ required: true,
|
|
|
+ message: '请选择计价方式',
|
|
|
+ trigger: 'change'
|
|
|
+ }"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="item in pricingWayList"
|
|
|
:key="item.id"
|
|
|
@@ -482,7 +479,9 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
-
|
|
|
+ <template v-slot:headerPricingWay="{ column }">
|
|
|
+ <span class="is-required">{{ column.label }}</span>
|
|
|
+ </template>
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="scope">
|
|
|
<el-popconfirm
|
|
|
@@ -543,7 +542,7 @@
|
|
|
default: false,
|
|
|
type: Boolean
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
isGuaranteePeriod: {
|
|
|
default: true,
|
|
|
type: Boolean
|
|
|
@@ -563,16 +562,18 @@
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
},
|
|
|
-
|
|
|
- isSinglePrice: { //单价必填
|
|
|
+
|
|
|
+ isSinglePrice: {
|
|
|
+ //单价必填
|
|
|
type: Boolean,
|
|
|
default: true
|
|
|
},
|
|
|
- isTotalCount: { //数量必填
|
|
|
+ isTotalCount: {
|
|
|
+ //数量必填
|
|
|
type: Boolean,
|
|
|
default: true
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
isDrawer: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
@@ -596,12 +597,12 @@
|
|
|
//临时
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
- }
|
|
|
- , isDiscount: {
|
|
|
+ },
|
|
|
+ isDiscount: {
|
|
|
//折让
|
|
|
type: Boolean,
|
|
|
default: true
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
const defaultForm = {
|
|
|
@@ -619,7 +620,7 @@
|
|
|
numberReg,
|
|
|
defaultForm,
|
|
|
form: {
|
|
|
- discountTotalPrice: 0,
|
|
|
+ discountTotalPrice: 0,
|
|
|
|
|
|
datasource: []
|
|
|
},
|
|
|
@@ -768,6 +769,7 @@
|
|
|
width: 160,
|
|
|
prop: 'pricingWay',
|
|
|
label: '计价方式',
|
|
|
+ headerSlot: 'headerPricingWay',
|
|
|
slot: 'pricingWay',
|
|
|
align: 'center'
|
|
|
},
|
|
|
@@ -1031,21 +1033,20 @@
|
|
|
//改变数量
|
|
|
changeCount(row, index) {
|
|
|
const { allPrice, arr } = changeCount(row, index, this.form.datasource);
|
|
|
- this.form.datasource=arr
|
|
|
- this.allPrice=allPrice||0
|
|
|
+ this.form.datasource = arr;
|
|
|
+ this.allPrice = allPrice || 0;
|
|
|
if (this.isDiscountTotalPrice) {
|
|
|
this.form.discountTotalPrice = allPrice;
|
|
|
}
|
|
|
this.$emit('setCountAmount', this.allPrice);
|
|
|
-
|
|
|
},
|
|
|
setCustomerMark(customerMark) {
|
|
|
this.form.datasource.forEach((item) => {
|
|
|
- item['customerMark'] = customerMark;
|
|
|
+ item['customerMark'] = customerMark;
|
|
|
this.$forceUpdate();
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
//修改回显
|
|
|
async putTableValue(data) {
|
|
|
let productList =
|
|
|
@@ -1077,7 +1078,8 @@
|
|
|
}
|
|
|
|
|
|
if (this.isDiscountTotalPrice) {
|
|
|
- this.form.discountTotalPrice = data.payAmount||data?.contractVO?.discountTotalPrice;
|
|
|
+ this.form.discountTotalPrice =
|
|
|
+ data.payAmount || data?.contractVO?.discountTotalPrice;
|
|
|
}
|
|
|
|
|
|
let codeList = this.form.datasource.map((item) => item.productCode);
|
|
|
@@ -1134,7 +1136,7 @@
|
|
|
this.$set(parasm, 'specification', item.specification);
|
|
|
this.$set(parasm, 'weightUnit', item.weightUnit);
|
|
|
this.$set(parasm, 'singleWeight', item.roughWeight);
|
|
|
- this.$set(parasm, 'pricingWay',item.pricingWay||1);
|
|
|
+ this.$set(parasm, 'pricingWay', item.pricingWay || 1);
|
|
|
|
|
|
this.$set(parasm, 'imgCode', item.imgCode);
|
|
|
this.$set(parasm, 'produceType', item.produceType);
|
|
|
@@ -1173,16 +1175,16 @@
|
|
|
},
|
|
|
|
|
|
validateForm(callback) {
|
|
|
- let singleWeightData={}
|
|
|
- this.form.datasource.forEach(item=>{
|
|
|
-
|
|
|
- if(item.pricingWay==2&&!item.singleWeight){
|
|
|
- singleWeightData['name']=item.productName
|
|
|
+ let singleWeightData = {};
|
|
|
+ this.form.datasource.forEach((item) => {
|
|
|
+ if (item.pricingWay == 2 && !item.singleWeight) {
|
|
|
+ singleWeightData['name'] = item.productName;
|
|
|
}
|
|
|
-
|
|
|
- })
|
|
|
- if(singleWeightData.name){
|
|
|
- this.$message.warning(singleWeightData.name+'计价方式为重量,单重不能为空');
|
|
|
+ });
|
|
|
+ if (singleWeightData.name) {
|
|
|
+ this.$message.warning(
|
|
|
+ singleWeightData.name + '计价方式为重量,单重不能为空'
|
|
|
+ );
|
|
|
callback(false);
|
|
|
}
|
|
|
//开始表单校验
|