Commit a47426777458c886503450bd2a9d5928d74d8706

Authored by 史婷婷
1 parent 5d5a3373

feat: 补货单-新增

@@ -232,7 +232,7 @@ export default { @@ -232,7 +232,7 @@ export default {
232 getDicName: getDicName, 232 getDicName: getDicName,
233 validateRequired() { 233 validateRequired() {
234 const checks = [ 234 const checks = [
235 - { key: 'orderNo', label: '订单编号' } 235 + { key: 'purchaseOrderName', label: '订单编号' }
236 ] 236 ]
237 for (const it of checks) { 237 for (const it of checks) {
238 const val = this.form[it.key] 238 const val = this.form[it.key]
@@ -250,11 +250,9 @@ export default { @@ -250,11 +250,9 @@ export default {
250 return false 250 return false
251 } 251 }
252 const fields = [ 252 const fields = [
253 - { key: 'industry', label: '行业' },  
254 - { key: 'quality', label: '品质' },  
255 { key: 'brand', label: '牌号' }, 253 { key: 'brand', label: '牌号' },
256 - { key: 'quantity', label: '数量' },  
257 - { key: 'deliveryDate', label: '发货日期' }, 254 + { key: 'quantity', label: '需发' },
  255 + { key: 'supplementaryQuantity', label: '需求补货' },
258 ] 256 ]
259 for (let i = 0; i < list.length; i++) { 257 for (let i = 0; i < list.length; i++) {
260 const it = list[i] || {} 258 const it = list[i] || {}
@@ -297,14 +295,13 @@ export default { @@ -297,14 +295,13 @@ export default {
297 if (!this.validateRequired()) return 295 if (!this.validateRequired()) return
298 if (!this.validateLineListRequired()) return 296 if (!this.validateLineListRequired()) return
299 const payload = { ...this.form } 297 const payload = { ...this.form }
300 - payload.orderSpecList = payload.purchaseOrderLineList || []; 298 + payload.replenishmentOrderLineList = payload.purchaseOrderLineList || [];
301 delete payload.purchaseOrderLineList; 299 delete payload.purchaseOrderLineList;
302 console.log('onSubmit__payload', payload) 300 console.log('onSubmit__payload', payload)
303 - return  
304 try { 301 try {
305 await createApi(payload) 302 await createApi(payload)
306 uni.showToast({ title: '保存成功', icon: 'success' }) 303 uni.showToast({ title: '保存成功', icon: 'success' })
307 - setTimeout(() => { uni.redirectTo({ url: '/pages/change_list/index' }) }, 300) 304 + setTimeout(() => { uni.redirectTo({ url: '/pages/replenishment_order/index' }) }, 300)
308 } catch (e) { 305 } catch (e) {
309 uni.showToast({ title: (e && e.msg) || '保存失败', icon: 'none' }) 306 uni.showToast({ title: (e && e.msg) || '保存失败', icon: 'none' })
310 } 307 }
@@ -324,9 +321,9 @@ export default { @@ -324,9 +321,9 @@ export default {
324 this.form.totalSupplementaryQuantity = summary.totalSupplementaryQuantity 321 this.form.totalSupplementaryQuantity = summary.totalSupplementaryQuantity
325 }, 322 },
326 purchaseOrderLineListChange(data) { 323 purchaseOrderLineListChange(data) {
327 - // const list = Array.isArray(data) ? data : []  
328 - // this.form.purchaseOrderLineList = list  
329 - // this.calculateSummary(list) 324 + const list = Array.isArray(data) ? data : []
  325 + this.form.purchaseOrderLineList = list
  326 + this.calculateSummary(list)
330 }, 327 },
331 } 328 }
332 } 329 }
@@ -18,46 +18,33 @@ @@ -18,46 +18,33 @@
18 <view v-if="mode === 'add'" class="section"> 18 <view v-if="mode === 'add'" class="section">
19 <view v-for="(item, idx) in items" :key="'a-' + idx" class="block"> 19 <view v-for="(item, idx) in items" :key="'a-' + idx" class="block">
20 <uni-list class="edit-list"> 20 <uni-list class="edit-list">
21 - <uni-list-item title="行业"> 21 + <uni-list-item title="牌号">
22 <template v-slot:footer> 22 <template v-slot:footer>
23 - <uni-easyinput v-model="item.industry" placeholder="请输入行业" :inputBorder="false" /> 23 + <uni-easyinput v-model="item.brand" placeholder="请输入牌号" :inputBorder="false" />
24 </template> 24 </template>
25 </uni-list-item> 25 </uni-list-item>
26 - <uni-list-item title="品质"> 26 + <uni-list-item title="厚度(mm)">
27 <template v-slot:footer> 27 <template v-slot:footer>
28 - <uni-easyinput v-model="item.quality" placeholder="请输入品质" :inputBorder="false" /> 28 + <uni-easyinput type="digit" v-model="item.thickness" placeholder="请输入厚度"
  29 + :inputBorder="false" @input="onNonNegativeNumberInput($event, item, idx, 'thickness')"
  30 + @blur="onNonNegativeNumberBlur(item, idx, 'thickness')" />
29 </template> 31 </template>
30 </uni-list-item> 32 </uni-list-item>
31 - <uni-list-item title="牌号"> 33 + <uni-list-item title="厚度公差上限(mm)">
32 <template v-slot:footer> 34 <template v-slot:footer>
33 - <uni-easyinput v-model="item.brand" placeholder="请输入牌号" :inputBorder="false" /> 35 + <uni-easyinput type="number" v-model="item.thicknessTolPos" placeholder="请输入厚度公差上限"
  36 + :inputBorder="false" @input="onRealNumberInput($event, item, idx, 'thicknessTolPos')"
  37 + @blur="onRealNumberBlur(item, idx, 'thicknessTolPos')" />
  38 + </template>
  39 + </uni-list-item>
  40 + <uni-list-item title="厚度公差下限(mm)">
  41 + <template v-slot:footer>
  42 + <uni-easyinput type="number" v-model="item.thicknessTolNeg" placeholder="请输入厚度公差下限"
  43 + :inputBorder="false" @input="onRealNumberInput($event, item, idx, 'thicknessTolNeg')"
  44 + @blur="onRealNumberBlur(item, idx, 'thicknessTolNeg')" />
34 </template> 45 </template>
35 </uni-list-item> 46 </uni-list-item>
36 <view v-show="!item.collapsed"> 47 <view v-show="!item.collapsed">
37 - <uni-list-item title="厚度(mm)">  
38 - <template v-slot:footer>  
39 - <uni-easyinput type="digit" v-model="item.thickness" placeholder="请输入厚度"  
40 - :inputBorder="false"  
41 - @input="onNonNegativeNumberInput($event, item, idx, 'thickness')"  
42 - @blur="onNonNegativeNumberBlur(item, idx, 'thickness')" />  
43 - </template>  
44 - </uni-list-item>  
45 - <uni-list-item title="厚度公差上限(mm)">  
46 - <template v-slot:footer>  
47 - <uni-easyinput type="number" v-model="item.thicknessTolPos" placeholder="请输入厚度公差上限"  
48 - :inputBorder="false"  
49 - @input="onRealNumberInput($event, item, idx, 'thicknessTolPos')"  
50 - @blur="onRealNumberBlur(item, idx, 'thicknessTolPos')" />  
51 - </template>  
52 - </uni-list-item>  
53 - <uni-list-item title="厚度公差下限(mm)">  
54 - <template v-slot:footer>  
55 - <uni-easyinput type="number" v-model="item.thicknessTolNeg" placeholder="请输入厚度公差下限"  
56 - :inputBorder="false"  
57 - @input="onRealNumberInput($event, item, idx, 'thicknessTolNeg')"  
58 - @blur="onRealNumberBlur(item, idx, 'thicknessTolNeg')" />  
59 - </template>  
60 - </uni-list-item>  
61 <uni-list-item title="宽度(mm)"> 48 <uni-list-item title="宽度(mm)">
62 <template v-slot:footer> 49 <template v-slot:footer>
63 <uni-easyinput type="digit" v-model="item.width" placeholder="请输入宽度" 50 <uni-easyinput type="digit" v-model="item.width" placeholder="请输入宽度"
@@ -68,16 +55,14 @@ @@ -68,16 +55,14 @@
68 <uni-list-item title="宽度公差上限(mm)"> 55 <uni-list-item title="宽度公差上限(mm)">
69 <template v-slot:footer> 56 <template v-slot:footer>
70 <uni-easyinput type="number" v-model="item.widthTolPos" placeholder="请输入宽度公差上限" 57 <uni-easyinput type="number" v-model="item.widthTolPos" placeholder="请输入宽度公差上限"
71 - :inputBorder="false"  
72 - @input="onRealNumberInput($event, item, idx, 'widthTolPos')" 58 + :inputBorder="false" @input="onRealNumberInput($event, item, idx, 'widthTolPos')"
73 @blur="onRealNumberBlur(item, idx, 'widthTolPos')" /> 59 @blur="onRealNumberBlur(item, idx, 'widthTolPos')" />
74 </template> 60 </template>
75 </uni-list-item> 61 </uni-list-item>
76 <uni-list-item title="宽度公差下限(mm)"> 62 <uni-list-item title="宽度公差下限(mm)">
77 <template v-slot:footer> 63 <template v-slot:footer>
78 <uni-easyinput type="number" v-model="item.widthTolNeg" placeholder="请输入宽度公差下限" 64 <uni-easyinput type="number" v-model="item.widthTolNeg" placeholder="请输入宽度公差下限"
79 - :inputBorder="false"  
80 - @input="onRealNumberInput($event, item, idx, 'widthTolNeg')" 65 + :inputBorder="false" @input="onRealNumberInput($event, item, idx, 'widthTolNeg')"
81 @blur="onRealNumberBlur(item, idx, 'widthTolNeg')" /> 66 @blur="onRealNumberBlur(item, idx, 'widthTolNeg')" />
82 </template> 67 </template>
83 </uni-list-item> 68 </uni-list-item>
@@ -91,16 +76,14 @@ @@ -91,16 +76,14 @@
91 <uni-list-item title="长度公差上限(mm)"> 76 <uni-list-item title="长度公差上限(mm)">
92 <template v-slot:footer> 77 <template v-slot:footer>
93 <uni-easyinput type="number" v-model="item.lengthTolPos" placeholder="请输入长度公差上限" 78 <uni-easyinput type="number" v-model="item.lengthTolPos" placeholder="请输入长度公差上限"
94 - :inputBorder="false"  
95 - @input="onRealNumberInput($event, item, idx, 'lengthTolPos')" 79 + :inputBorder="false" @input="onRealNumberInput($event, item, idx, 'lengthTolPos')"
96 @blur="onRealNumberBlur(item, idx, 'lengthTolPos')" /> 80 @blur="onRealNumberBlur(item, idx, 'lengthTolPos')" />
97 </template> 81 </template>
98 </uni-list-item> 82 </uni-list-item>
99 <uni-list-item title="长度公差下限(mm)"> 83 <uni-list-item title="长度公差下限(mm)">
100 <template v-slot:footer> 84 <template v-slot:footer>
101 <uni-easyinput type="number" v-model="item.lengthTolNeg" placeholder="请输入长度公差下限" 85 <uni-easyinput type="number" v-model="item.lengthTolNeg" placeholder="请输入长度公差下限"
102 - :inputBorder="false"  
103 - @input="onRealNumberInput($event, item, idx, 'lengthTolNeg')" 86 + :inputBorder="false" @input="onRealNumberInput($event, item, idx, 'lengthTolNeg')"
104 @blur="onRealNumberBlur(item, idx, 'lengthTolNeg')" /> 87 @blur="onRealNumberBlur(item, idx, 'lengthTolNeg')" />
105 </template> 88 </template>
106 </uni-list-item> 89 </uni-list-item>
@@ -109,7 +92,7 @@ @@ -109,7 +92,7 @@
109 <uni-easyinput v-model="item.status" placeholder="请输入状态" :inputBorder="false" /> 92 <uni-easyinput v-model="item.status" placeholder="请输入状态" :inputBorder="false" />
110 </template> 93 </template>
111 </uni-list-item> 94 </uni-list-item>
112 - <uni-list-item title="数量kg"> 95 + <uni-list-item title="需发数量(kg)">
113 <template v-slot:footer> 96 <template v-slot:footer>
114 <uni-easyinput type="digit" v-model="item.quantity" placeholder="请输入数量kg" 97 <uni-easyinput type="digit" v-model="item.quantity" placeholder="请输入数量kg"
115 :inputBorder="false" 98 :inputBorder="false"
@@ -117,12 +100,34 @@ @@ -117,12 +100,34 @@
117 @blur="onNonNegativeNumberBlur(item, idx, 'quantity')" /> 100 @blur="onNonNegativeNumberBlur(item, idx, 'quantity')" />
118 </template> 101 </template>
119 </uni-list-item> 102 </uni-list-item>
120 - <uni-list-item v-if="item.showSalesPrice" title="销售价格"> 103 + <uni-list-item title="实发数量(kg)">
121 <template v-slot:footer> 104 <template v-slot:footer>
122 - <uni-easyinput type="digit" v-model="item.salesPrice" placeholder="请输入销售价格" 105 + <uni-easyinput type="digit" v-model="item.shippedQuantity" placeholder="请输入实发数量kg"
123 :inputBorder="false" 106 :inputBorder="false"
124 - @input="onNonNegativeNumberInput($event, item, idx, 'salesPrice')"  
125 - @blur="onNonNegativeNumberBlur(item, idx, 'salesPrice')" /> 107 + @input="onNonNegativeNumberInput($event, item, idx, 'shippedQuantity')"
  108 + @blur="onNonNegativeNumberBlur(item, idx, 'shippedQuantity')" />
  109 + </template>
  110 + </uni-list-item>
  111 + <uni-list-item title="需求补货数量(kg)">
  112 + <template v-slot:footer>
  113 + <uni-easyinput type="digit" v-model="item.supplementaryQuantity"
  114 + placeholder="请输入需求补货数量kg" :inputBorder="false"
  115 + @input="onNonNegativeNumberInput($event, item, idx, 'supplementaryQuantity')"
  116 + @blur="onNonNegativeNumberBlur(item, idx, 'supplementaryQuantity')" />
  117 + </template>
  118 + </uni-list-item>
  119 + <uni-list-item class="amount-item">
  120 + <template v-slot:body>
  121 + <view class="item-title"><text>单价</text></view>
  122 + </template>
  123 + <template v-slot:footer>
  124 + <view class="amount-row">
  125 + <uni-easyinput type="digit" v-model="item.salesPrice" placeholder="0.00"
  126 + :inputBorder="false"
  127 + @input="onNonNegativeNumberInput($event, item, idx, 'salesPrice')"
  128 + @blur="onNonNegativeNumberBlur(item, idx, 'salesPrice')" />
  129 + <text class="unit">元</text>
  130 + </view>
126 </template> 131 </template>
127 </uni-list-item> 132 </uni-list-item>
128 <uni-list-item class="amount-item"> 133 <uni-list-item class="amount-item">
@@ -139,15 +144,14 @@ @@ -139,15 +144,14 @@
139 </view> 144 </view>
140 </template> 145 </template>
141 </uni-list-item> 146 </uni-list-item>
142 - <uni-list-item title="发货日期"> 147 + <uni-list-item title="生产科(车间)确认交付时间">
143 <template v-slot:footer> 148 <template v-slot:footer>
144 - <uni-datetime-picker type="date" v-model="item.deliveryDate" :start="minDeliveryDate"  
145 - @change="onDeliveryChange($event, item, idx)" /> 149 + <view class="value">{{ item.confirmedDeliveryDate }}</view>
146 </template> 150 </template>
147 </uni-list-item> 151 </uni-list-item>
148 - <uni-list-item title="考核超协"> 152 + <uni-list-item title="备注">
149 <template v-slot:footer> 153 <template v-slot:footer>
150 - <uni-easyinput v-model="item.assessmentExceedsAgreement" placeholder="请输入考核超协" 154 + <uni-easyinput v-model="item.remarks" placeholder="请输入备注"
151 :inputBorder="false" /> 155 :inputBorder="false" />
152 </template> 156 </template>
153 </uni-list-item> 157 </uni-list-item>
@@ -178,25 +182,33 @@ @@ -178,25 +182,33 @@
178 <view class="value value-spec"> 182 <view class="value value-spec">
179 <view v-if="item.thickness" class="value-spec_val">{{ item.thickness }}</view> 183 <view v-if="item.thickness" class="value-spec_val">{{ item.thickness }}</view>
180 <view v-if="item.thickness" class="value-spec_box"> 184 <view v-if="item.thickness" class="value-spec_box">
181 - <view v-if="item.thicknessTolPos" class="value-spec_box_1">{{ item.thicknessTolPos > 0 ? '+' + item.thicknessTolPos : item.thicknessTolPos }} 185 + <view v-if="item.thicknessTolPos" class="value-spec_box_1">{{ item.thicknessTolPos > 0 ? '+'
  186 + +
  187 + item.thicknessTolPos : item.thicknessTolPos }}
182 </view> 188 </view>
183 - <view v-if="item.thicknessTolNeg" class="value-spec_box_2">{{ item.thicknessTolNeg > 0 ? '+' + item.thicknessTolNeg : item.thicknessTolNeg }} 189 + <view v-if="item.thicknessTolNeg" class="value-spec_box_2">{{ item.thicknessTolNeg > 0 ? '+'
  190 + +
  191 + item.thicknessTolNeg : item.thicknessTolNeg }}
184 </view> 192 </view>
185 </view> 193 </view>
186 <view v-if="item.width" class="value-spec_val p12">*</view> 194 <view v-if="item.width" class="value-spec_val p12">*</view>
187 <view v-if="item.width" class="value-spec_val">{{ item.width }}</view> 195 <view v-if="item.width" class="value-spec_val">{{ item.width }}</view>
188 <view v-if="item.width" class="value-spec_box"> 196 <view v-if="item.width" class="value-spec_box">
189 - <view v-if="item.widthTolPos" class="value-spec_box_1">{{ item.widthTolPos > 0 ? '+' + item.widthTolPos : item.widthTolPos }} 197 + <view v-if="item.widthTolPos" class="value-spec_box_1">{{ item.widthTolPos > 0 ? '+' +
  198 + item.widthTolPos : item.widthTolPos }}
190 </view> 199 </view>
191 - <view v-if="item.widthTolNeg" class="value-spec_box_2">{{ item.widthTolNeg > 0 ? '+' + item.widthTolNeg : item.widthTolNeg }} 200 + <view v-if="item.widthTolNeg" class="value-spec_box_2">{{ item.widthTolNeg > 0 ? '+' +
  201 + item.widthTolNeg : item.widthTolNeg }}
192 </view> 202 </view>
193 </view> 203 </view>
194 <view v-if="item.length" class="value-spec_val p12">*</view> 204 <view v-if="item.length" class="value-spec_val p12">*</view>
195 <view v-if="item.length" class="value-spec_val">{{ item.length }}</view> 205 <view v-if="item.length" class="value-spec_val">{{ item.length }}</view>
196 <view v-if="item.length" class="value-spec_box"> 206 <view v-if="item.length" class="value-spec_box">
197 - <view v-if="item.lengthTolPos" class="value-spec_box_1">{{ item.lengthTolPos > 0 ? '+' + item.lengthTolPos : item.lengthTolPos }} 207 + <view v-if="item.lengthTolPos" class="value-spec_box_1">{{ item.lengthTolPos > 0 ? '+' +
  208 + item.lengthTolPos : item.lengthTolPos }}
198 </view> 209 </view>
199 - <view v-if="item.lengthTolNeg" class="value-spec_box_2">{{ item.lengthTolNeg > 0 ? '+' + item.lengthTolNeg : item.lengthTolNeg }} 210 + <view v-if="item.lengthTolNeg" class="value-spec_box_2">{{ item.lengthTolNeg > 0 ? '+' +
  211 + item.lengthTolNeg : item.lengthTolNeg }}
200 </view> 212 </view>
201 </view> 213 </view>
202 </view> 214 </view>
@@ -211,7 +223,7 @@ @@ -211,7 +223,7 @@
211 <view class="row"><text class="label">发货日期</text><text class="value">{{ item.deliveryDate }}</text> 223 <view class="row"><text class="label">发货日期</text><text class="value">{{ item.deliveryDate }}</text>
212 </view> 224 </view>
213 <view class="row"><text class="label">考核超协</text><text class="value">{{ item.assessmentExceedsAgreement 225 <view class="row"><text class="label">考核超协</text><text class="value">{{ item.assessmentExceedsAgreement
214 - }}</text></view> 226 + }}</text></view>
215 </view> 227 </view>
216 <view class="view-total"> 228 <view class="view-total">
217 <view class="head">合计</view> 229 <view class="head">合计</view>
@@ -278,7 +290,7 @@ export default { @@ -278,7 +290,7 @@ export default {
278 const init = Array.isArray(this.list) && this.list.length > 0 ? this.list.map(v => ({ ...this.defaultItem(), ...v, collapsed: false })) : [{ ...this.defaultItem(), collapsed: false }] 290 const init = Array.isArray(this.list) && this.list.length > 0 ? this.list.map(v => ({ ...this.defaultItem(), ...v, collapsed: false })) : [{ ...this.defaultItem(), collapsed: false }]
279 this.items = init 291 this.items = init
280 }, 292 },
281 - methods: { 293 + methods: {
282 defaultItem() { 294 defaultItem() {
283 return { 295 return {
284 id: '', 296 id: '',