|
|
@@ -8,7 +8,8 @@
|
|
|
<u--input :disabled="!!contractId" slot="singleWeight" @input="singleWeightChange(item,index)"
|
|
|
type="number" placeholder="请输入" border="surround" v-model="item.singleWeight"></u--input>
|
|
|
<u--input :disabled="!!contractId" slot="singlePrice" style="flex:none;width: 50%;"
|
|
|
- @input="getTotalPrice()" type="number" placeholder="请输入" border="surround" v-model="item.singlePrice">
|
|
|
+ @input="getTotalPrice()" type="number" placeholder="请输入" border="surround"
|
|
|
+ v-model="item.singlePrice">
|
|
|
<template slot="suffix">元</template>
|
|
|
</u--input>
|
|
|
<uni-datetime-picker :disabled="!!contractId" type="date" slot="customerExpectDeliveryDeadline"
|
|
|
@@ -19,8 +20,26 @@
|
|
|
<uni-data-picker :readonly="!!contractId" slot="guaranteePeriodUnitCode"
|
|
|
v-model="item.guaranteePeriodUnitCode" placeholder="请选择" :localdata="date_unit">
|
|
|
</uni-data-picker>
|
|
|
- <u--input slot="customerMark" placeholder="请输入" border="surround"
|
|
|
- v-model="item.customerMark"></u--input>
|
|
|
+ <u--input slot="customerMark" placeholder="请输入" border="surround" v-model="item.customerMark">
|
|
|
+
|
|
|
+ </u--input>
|
|
|
+ <u--input slot="productBrand" placeholder="请输入" border="surround" :disabled="item.productCode"
|
|
|
+ v-model="item.productBrand">
|
|
|
+ </u--input>
|
|
|
+ <u--input slot="specification" placeholder="请输入" border="surround" :disabled="item.productCode"
|
|
|
+ v-model="item.specification">
|
|
|
+
|
|
|
+ </u--input>
|
|
|
+ <u--input slot="measuringUnit" placeholder="请输入" border="surround" :disabled="item.productCode"
|
|
|
+ v-model="item.measuringUnit">
|
|
|
+ </u--input>
|
|
|
+ <u--input slot="modelType" placeholder="请输入" border="surround" :disabled="item.productCode"
|
|
|
+ v-model="item.modelType">
|
|
|
+ </u--input>
|
|
|
+
|
|
|
+ <u--input slot="productName" placeholder="请输入" border="surround" :disabled="item.productCode"
|
|
|
+ v-model="item.productName">
|
|
|
+ </u--input>
|
|
|
</myCard>
|
|
|
|
|
|
|
|
|
@@ -33,7 +52,8 @@
|
|
|
<view class="add" @click="add" v-if="!contractId">
|
|
|
<u-icon name="plus" color="#fff"></u-icon>
|
|
|
</view>
|
|
|
-
|
|
|
+ <u-action-sheet :actions="addList" :show="show" :closeOnClickOverlay="true" :closeOnClickAction="true"
|
|
|
+ @close="show=false" @select='select'> </u-action-sheet>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -47,7 +67,15 @@
|
|
|
data() {
|
|
|
return {
|
|
|
tableList: [],
|
|
|
+ addList: [{
|
|
|
+ name: '选择物品清单',
|
|
|
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '新增临时产品',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ show: false,
|
|
|
current: {},
|
|
|
date_unit: [],
|
|
|
allPrice: '',
|
|
|
@@ -59,6 +87,17 @@
|
|
|
pageUrl: '',
|
|
|
|
|
|
}],
|
|
|
+ defaultForm: {
|
|
|
+ key: null,
|
|
|
+ endTime: '',
|
|
|
+ isFirst: 0,
|
|
|
+ name: '',
|
|
|
+ startTime: '',
|
|
|
+ workHour: '',
|
|
|
+ guaranteePeriodUnitCode: '',
|
|
|
+ technicalDrawings: [],
|
|
|
+ arrivalWay: 1
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
},
|
|
|
@@ -69,6 +108,11 @@
|
|
|
pricingWay: {
|
|
|
default: 1
|
|
|
},
|
|
|
+ isTemporary: {
|
|
|
+ //临时
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
contractId: '',
|
|
|
columns: {
|
|
|
type: Array,
|
|
|
@@ -76,6 +120,7 @@
|
|
|
[{
|
|
|
label: '产品名称:',
|
|
|
prop: 'productName',
|
|
|
+ slot: 'productName',
|
|
|
type: 'title',
|
|
|
className: 'perce100',
|
|
|
}],
|
|
|
@@ -84,14 +129,17 @@
|
|
|
prop: 'productCode'
|
|
|
}, {
|
|
|
label: '牌号:',
|
|
|
- prop: 'productBrand'
|
|
|
+ prop: 'productBrand',
|
|
|
+ slot: 'productBrand',
|
|
|
}],
|
|
|
[{
|
|
|
label: '规格:',
|
|
|
- prop: 'specification'
|
|
|
+ prop: 'specification',
|
|
|
+ slot: 'specification',
|
|
|
}, {
|
|
|
label: '型号:',
|
|
|
- prop: 'modelType'
|
|
|
+ prop: 'modelType',
|
|
|
+ slot: 'modelType',
|
|
|
}],
|
|
|
[{
|
|
|
label: '数量:',
|
|
|
@@ -100,6 +148,7 @@
|
|
|
}, {
|
|
|
label: '计量单位:',
|
|
|
prop: 'measuringUnit',
|
|
|
+ slot: 'measuringUnit',
|
|
|
}],
|
|
|
|
|
|
[{
|
|
|
@@ -162,29 +211,65 @@
|
|
|
item['productName'] = item.name
|
|
|
item['approvalNumber'] = item.extField.approvalNumber
|
|
|
item['packingSpecification'] = item.extField.packingSpecification
|
|
|
+ item['packageDispositionList'] = item.packageDispositionList
|
|
|
+
|
|
|
+ if (item.packageDispositionList?.length) {
|
|
|
+ item['saleUnitId'] = item.packageDispositionList[0].id
|
|
|
+ item['saleUnit'] = item.packageDispositionList[0].conversionUnit
|
|
|
+
|
|
|
+ }
|
|
|
})
|
|
|
this.tableList.push(...data)
|
|
|
})
|
|
|
|
|
|
this.getByCode()
|
|
|
},
|
|
|
- mounted() {
|
|
|
-
|
|
|
- },
|
|
|
- watch:{
|
|
|
- contractId(val){
|
|
|
+
|
|
|
+ watch: {
|
|
|
+ contractId(val) {
|
|
|
if (val) {
|
|
|
this.btnList = []
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ add() {
|
|
|
+ if (this.isTemporary) {
|
|
|
+ this.show = true
|
|
|
+ } else {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/saleManage/components/selectProduce?isAll=' + 1
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ select({
|
|
|
+ name
|
|
|
+ }) {
|
|
|
+ if (name == '选择物品清单') {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/saleManage/components/selectProduce?isAll=' + 1
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.handlAdd()
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ // 添加
|
|
|
+ handlAdd() {
|
|
|
+ let item = JSON.parse(JSON.stringify(this.defaultForm));
|
|
|
+ item.key = this.tableList.length + 1;
|
|
|
+ this.tableList.push(item);
|
|
|
+ },
|
|
|
init(list) {
|
|
|
if (list) {
|
|
|
this.tableList = JSON.parse(JSON.stringify(list))
|
|
|
this.getTotalPrice(list)
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
getValue() {
|
|
|
@@ -192,7 +277,7 @@
|
|
|
},
|
|
|
|
|
|
del(index) {
|
|
|
-
|
|
|
+
|
|
|
this.tableList.splice(index, 1);
|
|
|
|
|
|
},
|
|
|
@@ -225,13 +310,13 @@
|
|
|
sum = this.getNumTotalPrice();
|
|
|
let allsum = sum.toFixed(2);
|
|
|
this.allPrice = allsum;
|
|
|
- if(!row){
|
|
|
+ if (!row) {
|
|
|
uni.$emit('allsum', allsum)
|
|
|
}
|
|
|
return allsum;
|
|
|
} else {
|
|
|
this.allPrice = 0.0;
|
|
|
- if(!row){
|
|
|
+ if (!row) {
|
|
|
uni.$emit('allsum', allsum)
|
|
|
}
|
|
|
return 0.0;
|
|
|
@@ -265,26 +350,23 @@
|
|
|
},
|
|
|
//计算单重
|
|
|
singleWeightChange(row, index) {
|
|
|
- if (row && row.singleWeight && row.totalCount) {
|
|
|
- row.totalWeight = (row.singleWeight * row.totalCount).toFixed(2) || 0;
|
|
|
- this.$set(this.tableList[index], 'totalWeight', row.totalWeight);
|
|
|
+
|
|
|
+
|
|
|
+ if (row.weightUnit == row.measuringUnit) {
|
|
|
+ this.$set(this.tableList[index], 'totalWeight', row.totalCount);
|
|
|
+ } else if (row.totalCount && row.singleWeight) {
|
|
|
+ this.$set(this.tableList[index], 'totalWeight', (row.singleWeight * row.totalCount).toFixed(2) || 0);
|
|
|
} else {
|
|
|
- this.$set(this.tableList[index], 'totalWeight', '');
|
|
|
- }
|
|
|
- if (this.pricingWay == 2) {
|
|
|
- this.getTotalPrice();
|
|
|
+ this.$set(this.tableList[index], 'totalWeight', 0);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
//获取合计
|
|
|
getAllPrice(row) {
|
|
|
- let num = 0;
|
|
|
+ let num = Number(row.singlePrice) * Number(row.totalCount);
|
|
|
|
|
|
- if (this.pricingWay == 1) { //按数量计价计算总金额
|
|
|
- num = Number(row.singlePrice) * Number(row.totalCount);
|
|
|
|
|
|
- } else if (this.pricingWay == 2) { //按重量计价计算总金额
|
|
|
- num = Number(row.singlePrice) * Number(row.totalCount) * Number(row.singleWeight);
|
|
|
- }
|
|
|
|
|
|
return isNaN(num) ? '' : num.toFixed(2);
|
|
|
|
|
|
@@ -320,18 +402,8 @@
|
|
|
},
|
|
|
//获取折让合计
|
|
|
getDiscountTotalPrice(row, val) {
|
|
|
- let num = 0;
|
|
|
-
|
|
|
- if (this.pricingWay == 1) {
|
|
|
- num = Number(row.discountSinglePrice) * Number(row.totalCount);
|
|
|
+ let num = Number(row.discountSinglePrice) * Number(row.totalCount);
|
|
|
|
|
|
- } else if (this.pricingWay == 2) {
|
|
|
- num =
|
|
|
- Number(row.discountSinglePrice) *
|
|
|
- Number(row.totalCount) *
|
|
|
- Number(row.singleWeight);
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
return isNaN(num) ? '' : num.toFixed(2);
|
|
|
},
|
|
|
@@ -341,11 +413,7 @@
|
|
|
this.$set(this.tableList[index], 'customerMark', val)
|
|
|
})
|
|
|
},
|
|
|
- add() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/saleManage/components/selectProduce?isAll=' + 1
|
|
|
- })
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
}
|