|
@@ -2,65 +2,196 @@ |
|
@@ -2,65 +2,196 @@ |
|
2
|
<view class="page">
|
2
|
<view class="page">
|
|
3
|
<scroll-view class="scroll" scroll-y>
|
3
|
<scroll-view class="scroll" scroll-y>
|
|
4
|
<view class="detail-page">
|
4
|
<view class="detail-page">
|
|
5
|
- <view class="section">
|
|
|
|
6
|
- <text class="row company">{{ form.purchaseOrderName }}</text>
|
|
|
|
7
|
- <view class="row"><text class="label">补货单编号</text><text class="value">{{ form.code }}</text></view>
|
|
|
|
8
|
- <view class="row"><text class="label">分厂</text><text class="value">{{ form.workshopName }}</text>
|
5
|
+ <view v-if="isEditAll">
|
|
|
|
6
|
+ <view class="section">
|
|
|
|
7
|
+ <uni-list-item title="订货单位" class="no-border-top">
|
|
|
|
8
|
+ <template v-slot:footer>
|
|
|
|
9
|
+ <view class="readonly-text">{{ form.orderingUnitName }}</view>
|
|
|
|
10
|
+ </template>
|
|
|
|
11
|
+ </uni-list-item>
|
|
|
|
12
|
+ <uni-list-item class="select-item" :class="form.sampleTypeName ? 'is-filled' : 'is-empty'"
|
|
|
|
13
|
+ clickable @click="openSheet('sampleType')" :rightText="form.sampleTypeName || '请选择'"
|
|
|
|
14
|
+ showArrow>
|
|
|
|
15
|
+ <template v-slot:body>
|
|
|
|
16
|
+ <view class="item-title"><text>试样种类</text></view>
|
|
|
|
17
|
+ </template>
|
|
|
|
18
|
+ </uni-list-item>
|
|
|
|
19
|
+ <uni-list-item class="select-item" :class="form.customerTypeName ? 'is-filled' : 'is-empty'"
|
|
|
|
20
|
+ clickable @click="openSheet('customerType')" :rightText="form.customerTypeName || '请选择'"
|
|
|
|
21
|
+ showArrow>
|
|
|
|
22
|
+ <template v-slot:body>
|
|
|
|
23
|
+ <view class="item-title"><text>客户类型</text></view>
|
|
|
|
24
|
+ </template>
|
|
|
|
25
|
+ </uni-list-item>
|
|
|
|
26
|
+ <uni-list-item title="生产厂">
|
|
|
|
27
|
+ <template v-slot:footer>
|
|
|
|
28
|
+ <view class="readonly-text">{{ form.workshopName }}</view>
|
|
|
|
29
|
+ </template>
|
|
|
|
30
|
+ </uni-list-item>
|
|
|
|
31
|
+ <uni-list-item title="所属品种">
|
|
|
|
32
|
+ <template v-slot:footer>
|
|
|
|
33
|
+ <view class="readonly-text">{{ form.belongingBreed }}</view>
|
|
|
|
34
|
+ </template>
|
|
|
|
35
|
+ </uni-list-item>
|
|
|
|
36
|
+ <uni-list-item title="原供货同行">
|
|
|
|
37
|
+ <template v-slot:footer>
|
|
|
|
38
|
+ <uni-easyinput v-model="form.originalSupplierPeer" placeholder="请输入原供货同行"
|
|
|
|
39
|
+ :inputBorder="false" />
|
|
|
|
40
|
+ </template>
|
|
|
|
41
|
+ </uni-list-item>
|
|
9
|
</view>
|
42
|
</view>
|
|
10
|
- <view class="row"><text class="label">办事处</text><text class="value">{{ form.deptName }}</text>
|
|
|
|
11
|
- </view>
|
|
|
|
12
|
- <view class="row"><text class="label">区域</text><text class="value">{{ form.regionName }}</text>
|
43
|
+
|
|
|
|
44
|
+ <!-- 产品 -->
|
|
|
|
45
|
+ <view class="section2">
|
|
|
|
46
|
+ <!-- mode="add" 允许编辑 -->
|
|
|
|
47
|
+ <Product mode="add" :list="initPurchaseOrderLineList" @change="purchaseOrderLineListChange"
|
|
|
|
48
|
+ :provideSamplesOptions="provideSamplesOptions"
|
|
|
|
49
|
+ :clearParametersOptions="clearParametersOptions" />
|
|
13
|
</view>
|
50
|
</view>
|
|
14
|
- <view class="row"><text class="label">购货单位</text><text class="value">{{ form.customerName }}</text>
|
51
|
+
|
|
|
|
52
|
+ <view class="section3">
|
|
|
|
53
|
+ <view class="view-total">
|
|
|
|
54
|
+ <view class="head">合计</view>
|
|
|
|
55
|
+ <view class="row">
|
|
|
|
56
|
+ <view class="row2">
|
|
|
|
57
|
+ <text class="label">数量</text><text class="value">{{ form.totalQuantity }}</text>
|
|
|
|
58
|
+ </view>
|
|
|
|
59
|
+ </view>
|
|
|
|
60
|
+ </view>
|
|
15
|
</view>
|
61
|
</view>
|
|
16
|
- <view class="row"><text class="label">原计划发货日期</text><text class="value">{{ form.originPlanShipDate
|
|
|
|
17
|
- }}</text></view>
|
|
|
|
18
|
- </view>
|
|
|
|
19
|
|
62
|
|
|
20
|
- <!-- 产品 -->
|
|
|
|
21
|
- <view class="section2">
|
|
|
|
22
|
- <Product mode="approve" :list="initPurchaseOrderLineList"
|
|
|
|
23
|
- :canEditSupplementary="canEditSupplementary" @change="purchaseOrderLineListChange" />
|
63
|
+ <view class="section2">
|
|
|
|
64
|
+
|
|
|
|
65
|
+ <uni-list-item class="select-item"
|
|
|
|
66
|
+ :class="form.sampleQuantityRegulationName ? 'is-filled' : 'is-empty'" clickable
|
|
|
|
67
|
+ @click="openSheet('sampleQuantityRegulation')"
|
|
|
|
68
|
+ :rightText="form.sampleQuantityRegulationName || '请选择'" showArrow>
|
|
|
|
69
|
+ <template v-slot:body>
|
|
|
|
70
|
+ <view class="item-title"><text>本次试样数量是否超规定</text></view>
|
|
|
|
71
|
+ </template>
|
|
|
|
72
|
+ </uni-list-item>
|
|
|
|
73
|
+
|
|
|
|
74
|
+ <uni-list-item class="select-item"
|
|
|
|
75
|
+ :class="form.specificationQuantityRegulationName ? 'is-filled' : 'is-empty'" clickable
|
|
|
|
76
|
+ @click="openSheet('specificationQuantityRegulation')"
|
|
|
|
77
|
+ :rightText="form.specificationQuantityRegulationName || '请选择'" showArrow>
|
|
|
|
78
|
+ <template v-slot:body>
|
|
|
|
79
|
+ <view class="item-title"><text>试样规格个数是否超规定</text></view>
|
|
|
|
80
|
+ </template>
|
|
|
|
81
|
+ </uni-list-item>
|
|
|
|
82
|
+
|
|
|
|
83
|
+ <uni-list-item title="试样次数">
|
|
|
|
84
|
+ <template v-slot:footer>
|
|
|
|
85
|
+ <uni-easyinput type="textarea" v-model="form.sampleFrequency" placeholder="请输入试样次数"
|
|
|
|
86
|
+ :inputBorder="false" />
|
|
|
|
87
|
+ </template>
|
|
|
|
88
|
+ </uni-list-item>
|
|
|
|
89
|
+
|
|
|
|
90
|
+ <uni-list-item title="前期不合格描述">
|
|
|
|
91
|
+ <template v-slot:footer>
|
|
|
|
92
|
+ <uni-easyinput type="textarea" v-model="form.earlyNonconformityDescription"
|
|
|
|
93
|
+ placeholder="请输入前期不合格描述" :inputBorder="false" />
|
|
|
|
94
|
+ </template>
|
|
|
|
95
|
+ </uni-list-item>
|
|
|
|
96
|
+
|
|
|
|
97
|
+ </view>
|
|
24
|
</view>
|
98
|
</view>
|
|
25
|
- <view class="section3">
|
|
|
|
26
|
- <view class="view-total">
|
|
|
|
27
|
- <view class="head">合计</view>
|
|
|
|
28
|
- <view class="row">
|
|
|
|
29
|
- <view class="row2">
|
|
|
|
30
|
- <text class="label">需发</text><text class="value">{{ form.totalQuantity }}</text>
|
|
|
|
31
|
- </view>
|
|
|
|
32
|
- <view class="row2">
|
|
|
|
33
|
- <text class="label">实发</text><text class="value">{{ form.totalShippedQuantity }}</text>
|
|
|
|
34
|
- </view>
|
99
|
+ <view v-else class="detail-section">
|
|
|
|
100
|
+ <view class="section">
|
|
|
|
101
|
+ <text class="row company">{{ form.orderingUnitName }}</text>
|
|
|
|
102
|
+ <view :class="['status', `status_${form.status}`]" />
|
|
|
|
103
|
+ <view class="row"><text class="label">试样种类</text><text class="value">{{ form.sampleTypeName
|
|
|
|
104
|
+ }}</text></view>
|
|
|
|
105
|
+ <view class="row"><text class="label">客户类型</text><text class="value">{{ form.customerTypeName
|
|
|
|
106
|
+ }}</text></view>
|
|
|
|
107
|
+ <view class="row"><text class="label">分厂</text><text class="value">{{ form.workshopName
|
|
|
|
108
|
+ }}</text></view>
|
|
|
|
109
|
+ <view class="row"><text class="label">所属品种</text><text class="value">{{ form.belongingBreed
|
|
|
|
110
|
+ }}</text></view>
|
|
|
|
111
|
+ <view class="row"><text class="label">原供货同行</text><text class="value">{{
|
|
|
|
112
|
+ form.originalSupplierPeer }}</text>
|
|
35
|
</view>
|
113
|
</view>
|
|
36
|
- <view class="row">
|
|
|
|
37
|
- <view class="row2">
|
|
|
|
38
|
- <text class="label">需求补货</text><text class="value">{{ form.totalSupplementaryQuantity
|
|
|
|
39
|
- }}</text>
|
114
|
+ </view>
|
|
|
|
115
|
+
|
|
|
|
116
|
+ <!-- 产品 -->
|
|
|
|
117
|
+ <view class="section2">
|
|
|
|
118
|
+ <Product mode="view" :list="form.productSampleConfirmationSlipDetailList" />
|
|
|
|
119
|
+ </view>
|
|
|
|
120
|
+
|
|
|
|
121
|
+ <view class="section3">
|
|
|
|
122
|
+ <view class="view-total">
|
|
|
|
123
|
+ <view class="head">合计</view>
|
|
|
|
124
|
+ <view class="row">
|
|
|
|
125
|
+ <view class="row2">
|
|
|
|
126
|
+ <text class="label">数量</text><text class="value">{{ form.totalQuantity }}</text>
|
|
|
|
127
|
+ </view>
|
|
40
|
</view>
|
128
|
</view>
|
|
41
|
</view>
|
129
|
</view>
|
|
42
|
</view>
|
130
|
</view>
|
|
|
|
131
|
+
|
|
|
|
132
|
+ <view class="section">
|
|
|
|
133
|
+ <view class="row"><text class="label">数量</text><text class="value">{{ form.totalQuantity
|
|
|
|
134
|
+ }}</text></view>
|
|
|
|
135
|
+ <view class="row"><text class="label">本次试样数量是否超规定</text><text class="value">{{
|
|
|
|
136
|
+ form.sampleQuantityRegulation ?
|
|
|
|
137
|
+ '是' : '否' }}</text></view>
|
|
|
|
138
|
+ <view class="row"><text class="label">试样规格个数是否超规定</text><text class="value">{{
|
|
|
|
139
|
+ form.specificationQuantityRegulation ? '是' : '否' }}</text></view>
|
|
|
|
140
|
+ <view class="row"><text class="label">试样次数</text><text class="value">{{ form.sampleFrequency
|
|
|
|
141
|
+ }}</text></view>
|
|
|
|
142
|
+ <uni-list-item v-if="isEditEarlyNonconformityDescription" title="前期不合格描述">
|
|
|
|
143
|
+ <template v-slot:footer>
|
|
|
|
144
|
+ <uni-easyinput type="textarea" v-model="form.earlyNonconformityDescription"
|
|
|
|
145
|
+ placeholder="请输入前期不合格描述" :inputBorder="false" />
|
|
|
|
146
|
+ </template>
|
|
|
|
147
|
+ </uni-list-item>
|
|
|
|
148
|
+ <view v-else class="row"><text class="label">前期不合格描述</text><text class="value">{{
|
|
|
|
149
|
+ form.earlyNonconformityDescription
|
|
|
|
150
|
+ }}</text></view>
|
|
|
|
151
|
+ </view>
|
|
43
|
</view>
|
152
|
</view>
|
|
44
|
|
153
|
|
|
|
|
154
|
+
|
|
45
|
</view>
|
155
|
</view>
|
|
46
|
</scroll-view>
|
156
|
</scroll-view>
|
|
|
|
157
|
+ <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options"
|
|
|
|
158
|
+ v-model="sheet.value" @confirm="onSheetConfirm" />
|
|
47
|
</view>
|
159
|
</view>
|
|
48
|
</template>
|
160
|
</template>
|
|
49
|
|
161
|
|
|
50
|
<script>
|
162
|
<script>
|
|
51
|
-import { getDetailApi } from '@/api/replenishment_order.js'
|
163
|
+import { getDetailApi } from '@/api/confirmation_form.js'
|
|
52
|
import Product from './product.vue'
|
164
|
import Product from './product.vue'
|
|
53
|
-
|
165
|
+import {
|
|
|
|
166
|
+ getDicByCodes
|
|
|
|
167
|
+} from '@/utils/dic'
|
|
|
|
168
|
+import SingleSelectSheet from '@/components/single-select/index.vue'
|
|
|
|
169
|
+// 办事处内勤:可编辑 (编辑时的所有字段)
|
|
|
|
170
|
+// 办事处主管:只能编辑 :前期不合格描述
|
|
|
|
171
|
+// 其他人 :只能查看
|
|
54
|
export default {
|
172
|
export default {
|
|
55
|
- name: 'ReplenishmentOrderApprove',
|
|
|
|
56
|
- components: { Product },
|
173
|
+ name: 'ConfirmationFormApprove',
|
|
|
|
174
|
+ components: { Product, SingleSelectSheet },
|
|
57
|
props: { id: { type: [String, Number], default: '' } },
|
175
|
props: { id: { type: [String, Number], default: '' } },
|
|
58
|
data() {
|
176
|
data() {
|
|
59
|
return {
|
177
|
return {
|
|
60
|
form: {},
|
178
|
form: {},
|
|
61
|
initPurchaseOrderLineList: [],
|
179
|
initPurchaseOrderLineList: [],
|
|
62
|
roleCodes: [],
|
180
|
roleCodes: [],
|
|
63
|
- canEditSupplementary: false
|
181
|
+ canEditSupplementary: false,
|
|
|
|
182
|
+ isEditAll: false,
|
|
|
|
183
|
+ isEditEarlyNonconformityDescription: false,
|
|
|
|
184
|
+ sheet: { visible: false, title: '请选择', options: [], value: '', field: '' },
|
|
|
|
185
|
+ dicOptions: {
|
|
|
|
186
|
+ ENTERPRISE_TYPE: [], // 客户类型
|
|
|
|
187
|
+ SAMPLE_TYPE: [], // 试样种类
|
|
|
|
188
|
+ CLEAR_PARAMETERS: [], // 是否提供明确参数
|
|
|
|
189
|
+ PROVIDE_SAMPLES: [], // 是否提供样品
|
|
|
|
190
|
+ },
|
|
|
|
191
|
+ enterpriseTypeLocal: [], // 客户类型
|
|
|
|
192
|
+ sampleTypeLocal: [], // 试样种类
|
|
|
|
193
|
+ provideSamplesOptions: [], // 是否提供样品
|
|
|
|
194
|
+ clearParametersOptions: [], // 是否提供明确参数
|
|
64
|
}
|
195
|
}
|
|
65
|
},
|
196
|
},
|
|
66
|
computed: {
|
197
|
computed: {
|
|
@@ -72,6 +203,7 @@ export default { |
|
@@ -72,6 +203,7 @@ export default { |
|
72
|
const v = (val !== undefined && val !== null) ? String(val) : ''
|
203
|
const v = (val !== undefined && val !== null) ? String(val) : ''
|
|
73
|
if (v) {
|
204
|
if (v) {
|
|
74
|
this.loadDetail(v);
|
205
|
this.loadDetail(v);
|
|
|
|
206
|
+ this.loadAllDicData()
|
|
75
|
this.getRoleInfo();
|
207
|
this.getRoleInfo();
|
|
76
|
}
|
208
|
}
|
|
77
|
}
|
209
|
}
|
|
@@ -84,10 +216,10 @@ export default { |
|
@@ -84,10 +216,10 @@ export default { |
|
84
|
getRoleInfo() {
|
216
|
getRoleInfo() {
|
|
85
|
this.roleCodes = this.$store.getters.roleCodes || [];
|
217
|
this.roleCodes = this.$store.getters.roleCodes || [];
|
|
86
|
console.log('roleCodes', this.roleCodes)
|
218
|
console.log('roleCodes', this.roleCodes)
|
|
87
|
- // 一分厂经营办计划员/二分厂经营办计划员/三分厂经营办计划员/四分厂经营办计划员
|
|
|
|
88
|
- const allowed = ['yfcjybjhy', 'efcjybjhy', 'sfcjybjhy', 'ztfcjybjhy'];
|
|
|
|
89
|
- this.canEditSupplementary = allowed.some((code) => this.roleCodes.includes(code));
|
|
|
|
90
|
- console.log('canEditSupplementary', this.canEditSupplementary)
|
219
|
+ // 办事处内勤:可编辑 (编辑时的所有字段) bscnq
|
|
|
|
220
|
+ this.isEditAll = this.roleCodes.includes('bscnq');
|
|
|
|
221
|
+ // 办事处主管:只能编辑 :前期不合格描述 bsczg
|
|
|
|
222
|
+ this.isEditEarlyNonconformityDescription = this.roleCodes.includes('bsczg');
|
|
91
|
},
|
223
|
},
|
|
92
|
async loadDetail(id) {
|
224
|
async loadDetail(id) {
|
|
93
|
try {
|
225
|
try {
|
|
@@ -96,10 +228,12 @@ export default { |
|
@@ -96,10 +228,12 @@ export default { |
|
96
|
const next = { ...this.form, ...m }
|
228
|
const next = { ...this.form, ...m }
|
|
97
|
// 确保ID存在
|
229
|
// 确保ID存在
|
|
98
|
next.id = m.id || id
|
230
|
next.id = m.id || id
|
|
|
|
231
|
+ next.sampleQuantityRegulationName = m.sampleQuantityRegulation === true ? '是' : '否'
|
|
|
|
232
|
+ next.specificationQuantityRegulationName = m.specificationQuantityRegulation === true ? '是' : '否'
|
|
99
|
// 映射列表
|
233
|
// 映射列表
|
|
100
|
- // 注意:详情返回的是 replenishmentOrderLineList,需要赋值给 initPurchaseOrderLineList 以便 Product 组件初始化
|
234
|
+ // 注意:详情返回的是 productSampleConfirmationSlipDetailList,需要赋值给 initPurchaseOrderLineList 以便 Product 组件初始化
|
|
101
|
// 且需要处理字段兼容性,确保 Product 组件能正确显示和编辑
|
235
|
// 且需要处理字段兼容性,确保 Product 组件能正确显示和编辑
|
|
102
|
- const lines = Array.isArray(m.replenishmentOrderLineList) ? m.replenishmentOrderLineList.map(x => ({
|
236
|
+ const lines = Array.isArray(m.productSampleConfirmationSlipDetailList) ? m.productSampleConfirmationSlipDetailList.map(x => ({
|
|
103
|
...x,
|
237
|
...x,
|
|
104
|
// 确保 Product 组件需要的字段存在
|
238
|
// 确保 Product 组件需要的字段存在
|
|
105
|
// Product组件使用: quantity(需发), shippedQuantity(实发), supplementaryQuantity(需求补货), salesPrice(单价)
|
239
|
// Product组件使用: quantity(需发), shippedQuantity(实发), supplementaryQuantity(需求补货), salesPrice(单价)
|
|
@@ -109,12 +243,47 @@ export default { |
|
@@ -109,12 +243,47 @@ export default { |
|
109
|
|
243
|
|
|
110
|
this.form = next;
|
244
|
this.form = next;
|
|
111
|
this.initPurchaseOrderLineList = lines;
|
245
|
this.initPurchaseOrderLineList = lines;
|
|
112
|
- // 初始计算合计
|
|
|
|
113
|
- this.calculateSummary(lines)
|
|
|
|
114
|
} catch (e) {
|
246
|
} catch (e) {
|
|
115
|
this.form = {}
|
247
|
this.form = {}
|
|
116
|
}
|
248
|
}
|
|
117
|
},
|
249
|
},
|
|
|
|
250
|
+ loadAllDicData() {
|
|
|
|
251
|
+ const dicCodes = ['ENTERPRISE_TYPE', 'SAMPLE_TYPE', 'CLEAR_PARAMETERS', 'PROVIDE_SAMPLES']
|
|
|
|
252
|
+ return getDicByCodes(dicCodes).then(results => {
|
|
|
|
253
|
+ this.dicOptions.ENTERPRISE_TYPE = results.ENTERPRISE_TYPE.data || []
|
|
|
|
254
|
+ this.dicOptions.SAMPLE_TYPE = results.SAMPLE_TYPE.data || []
|
|
|
|
255
|
+ this.dicOptions.CLEAR_PARAMETERS = results.CLEAR_PARAMETERS.data || []
|
|
|
|
256
|
+ this.dicOptions.PROVIDE_SAMPLES = results.PROVIDE_SAMPLES.data || []
|
|
|
|
257
|
+
|
|
|
|
258
|
+ this.enterpriseTypeLocal = (this.dicOptions.ENTERPRISE_TYPE || []).map(it => ({
|
|
|
|
259
|
+ value: it.code,
|
|
|
|
260
|
+ label: it.name
|
|
|
|
261
|
+ }))
|
|
|
|
262
|
+ this.sampleTypeLocal = (this.dicOptions.SAMPLE_TYPE || []).map(it => ({
|
|
|
|
263
|
+ value: it.code,
|
|
|
|
264
|
+ label: it.name
|
|
|
|
265
|
+ }))
|
|
|
|
266
|
+ this.provideSamplesOptions = (this.dicOptions.PROVIDE_SAMPLES || []).map(it => ({
|
|
|
|
267
|
+ value: it.code,
|
|
|
|
268
|
+ label: it.name
|
|
|
|
269
|
+ }))
|
|
|
|
270
|
+ this.clearParametersOptions = (this.dicOptions.CLEAR_PARAMETERS || []).map(it => ({
|
|
|
|
271
|
+ value: it.code,
|
|
|
|
272
|
+ label: it.name
|
|
|
|
273
|
+ }))
|
|
|
|
274
|
+ }).catch(() => {
|
|
|
|
275
|
+ this.dicOptions = {
|
|
|
|
276
|
+ ENTERPRISE_TYPE: [], // 客户类型
|
|
|
|
277
|
+ SAMPLE_TYPE: [], // 试样种类
|
|
|
|
278
|
+ CLEAR_PARAMETERS: [], // 是否提供明确参数
|
|
|
|
279
|
+ PROVIDE_SAMPLES: [], // 是否提供样品
|
|
|
|
280
|
+ }
|
|
|
|
281
|
+ this.enterpriseTypeLocal = []
|
|
|
|
282
|
+ this.sampleTypeLocal = []
|
|
|
|
283
|
+ this.provideSamplesOptions = []
|
|
|
|
284
|
+ this.clearParametersOptions = []
|
|
|
|
285
|
+ })
|
|
|
|
286
|
+ },
|
|
118
|
calculateSummary(list) {
|
287
|
calculateSummary(list) {
|
|
119
|
const summary = (list || []).reduce((acc, it) => {
|
288
|
const summary = (list || []).reduce((acc, it) => {
|
|
120
|
const qty = Number(it.supplementaryQuantity) || 0
|
289
|
const qty = Number(it.supplementaryQuantity) || 0
|
|
@@ -135,41 +304,49 @@ export default { |
|
@@ -135,41 +304,49 @@ export default { |
|
135
|
},
|
304
|
},
|
|
136
|
purchaseOrderLineListChange(data) {
|
305
|
purchaseOrderLineListChange(data) {
|
|
137
|
const list = Array.isArray(data) ? data : []
|
306
|
const list = Array.isArray(data) ? data : []
|
|
138
|
- this.form.purchaseOrderLineList = list
|
|
|
|
139
|
- this.calculateSummary(list)
|
307
|
+ this.form.productSampleConfirmationSlipDetailList = list
|
|
140
|
},
|
308
|
},
|
|
141
|
getFormValues() {
|
309
|
getFormValues() {
|
|
|
|
310
|
+ delete this.form.status;
|
|
142
|
const m = this.form || {}
|
311
|
const m = this.form || {}
|
|
143
|
return JSON.parse(JSON.stringify(m))
|
312
|
return JSON.parse(JSON.stringify(m))
|
|
144
|
},
|
313
|
},
|
|
145
|
// 审批-通过:校验表单
|
314
|
// 审批-通过:校验表单
|
|
146
|
checkForm() {
|
315
|
checkForm() {
|
|
147
|
- if (this.canEditSupplementary) {
|
|
|
|
148
|
- const list = Array.isArray(this.form.purchaseOrderLineList) ? this.form.purchaseOrderLineList : [];
|
|
|
|
149
|
- console.log('checkForm__list', list)
|
|
|
|
150
|
- if (list.length === 0) {
|
|
|
|
151
|
- uni.showToast({ title: '请先添加产品', icon: 'none' })
|
|
|
|
152
|
- return false
|
|
|
|
153
|
- }
|
|
|
|
154
|
- const fields = [
|
|
|
|
155
|
- { key: 'supplementaryQuantity', label: '需求补货数量' },
|
|
|
|
156
|
- ]
|
|
|
|
157
|
- for (let i = 0; i < list.length; i++) {
|
|
|
|
158
|
- const it = list[i] || {}
|
|
|
|
159
|
- for (const f of fields) {
|
|
|
|
160
|
- const v = it && it[f.key]
|
|
|
|
161
|
- if (v === undefined || v === null || String(v).trim() === '') {
|
|
|
|
162
|
- uni.showToast({ title: `产品第${i + 1}条:${f.label}不能为空!`, icon: 'none' })
|
|
|
|
163
|
- return false
|
|
|
|
164
|
- }
|
|
|
|
165
|
- }
|
|
|
|
166
|
- }
|
|
|
|
167
|
- return true
|
|
|
|
168
|
- } else {
|
|
|
|
169
|
- return true
|
316
|
+ return true
|
|
|
|
317
|
+ },
|
|
|
|
318
|
+ openSheet(field) {
|
|
|
|
319
|
+ let options = []
|
|
|
|
320
|
+ let title = ''
|
|
|
|
321
|
+ let value = ''
|
|
|
|
322
|
+
|
|
|
|
323
|
+ if (field === 'sampleType') {
|
|
|
|
324
|
+ title = '试样种类'
|
|
|
|
325
|
+ options = this.sampleTypeLocal
|
|
|
|
326
|
+ value = this.form.sampleType
|
|
|
|
327
|
+ } else if (field === 'customerType') {
|
|
|
|
328
|
+ title = '客户类型'
|
|
|
|
329
|
+ options = this.enterpriseTypeLocal
|
|
|
|
330
|
+ value = this.form.customerType
|
|
|
|
331
|
+ } else if (field === 'sampleQuantityRegulation') {
|
|
|
|
332
|
+ title = '本次试样数量是否超规定'
|
|
|
|
333
|
+ options = [{ value: true, label: '是' }, { value: false, label: '否' }]
|
|
|
|
334
|
+ value = this.form.sampleQuantityRegulation
|
|
|
|
335
|
+ } else if (field === 'specificationQuantityRegulation') {
|
|
|
|
336
|
+ title = '试样规格个数是否超规定'
|
|
|
|
337
|
+ options = [{ value: true, label: '是' }, { value: false, label: '否' }]
|
|
|
|
338
|
+ value = this.form.specificationQuantityRegulation
|
|
170
|
}
|
339
|
}
|
|
171
|
|
340
|
|
|
172
|
- }
|
341
|
+ const match = options.find(o => String(o.value) === String(value))
|
|
|
|
342
|
+ this.sheet = { ...this.sheet, visible: true, title, options, field, value: match ? match.value : '' }
|
|
|
|
343
|
+ },
|
|
|
|
344
|
+ onSheetConfirm({ value, label }) {
|
|
|
|
345
|
+ const field = this.sheet.field
|
|
|
|
346
|
+ this.form[field] = value
|
|
|
|
347
|
+ this.form[field + 'Name'] = label
|
|
|
|
348
|
+ this.sheet.visible = false
|
|
|
|
349
|
+ },
|
|
173
|
}
|
350
|
}
|
|
174
|
}
|
351
|
}
|
|
175
|
</script>
|
352
|
</script>
|
|
@@ -256,7 +433,7 @@ export default { |
|
@@ -256,7 +433,7 @@ export default { |
|
256
|
.section3 {
|
433
|
.section3 {
|
|
257
|
padding: 0 32rpx;
|
434
|
padding: 0 32rpx;
|
|
258
|
background-color: #fff;
|
435
|
background-color: #fff;
|
|
259
|
- margin-top: 20rpx;
|
436
|
+ margin-bottom: 20rpx;
|
|
260
|
}
|
437
|
}
|
|
261
|
|
438
|
|
|
262
|
.view-total {
|
439
|
.view-total {
|
|
@@ -297,4 +474,128 @@ export default { |
|
@@ -297,4 +474,128 @@ export default { |
|
297
|
}
|
474
|
}
|
|
298
|
}
|
475
|
}
|
|
299
|
}
|
476
|
}
|
|
|
|
477
|
+
|
|
|
|
478
|
+::v-deep .no-border-top {
|
|
|
|
479
|
+ .uni-list--border::after {
|
|
|
|
480
|
+ background-color: transparent;
|
|
|
|
481
|
+ }
|
|
|
|
482
|
+}
|
|
|
|
483
|
+
|
|
|
|
484
|
+.detail-section {
|
|
|
|
485
|
+
|
|
|
|
486
|
+ .section {
|
|
|
|
487
|
+ padding: 32rpx;
|
|
|
|
488
|
+ background: #fff;
|
|
|
|
489
|
+ margin-bottom: 20rpx;
|
|
|
|
490
|
+ position: relative;
|
|
|
|
491
|
+
|
|
|
|
492
|
+
|
|
|
|
493
|
+ }
|
|
|
|
494
|
+
|
|
|
|
495
|
+ .row {
|
|
|
|
496
|
+ display: flex;
|
|
|
|
497
|
+ margin-bottom: 28rpx;
|
|
|
|
498
|
+
|
|
|
|
499
|
+ &:last-child {
|
|
|
|
500
|
+ margin-bottom: 0;
|
|
|
|
501
|
+ }
|
|
|
|
502
|
+
|
|
|
|
503
|
+ &.company {
|
|
|
|
504
|
+ font-size: 36rpx;
|
|
|
|
505
|
+ font-weight: 600;
|
|
|
|
506
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
507
|
+ padding-top: 10rpx;
|
|
|
|
508
|
+ margin-bottom: 32rpx;
|
|
|
|
509
|
+ line-height: 50rpx;
|
|
|
|
510
|
+ }
|
|
|
|
511
|
+
|
|
|
|
512
|
+ .label {
|
|
|
|
513
|
+ max-width: 400rpx;
|
|
|
|
514
|
+ margin-right: 20rpx;
|
|
|
|
515
|
+ line-height: 32rpx;
|
|
|
|
516
|
+ font-size: 28rpx;
|
|
|
|
517
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
|
518
|
+ }
|
|
|
|
519
|
+
|
|
|
|
520
|
+ .value {
|
|
|
|
521
|
+ flex: 1;
|
|
|
|
522
|
+ line-height: 32rpx;
|
|
|
|
523
|
+ font-size: 28rpx;
|
|
|
|
524
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
525
|
+ text-align: right;
|
|
|
|
526
|
+ word-break: break-all;
|
|
|
|
527
|
+ }
|
|
|
|
528
|
+ }
|
|
|
|
529
|
+
|
|
|
|
530
|
+ .title-header {
|
|
|
|
531
|
+ background-color: #fff;
|
|
|
|
532
|
+ display: flex;
|
|
|
|
533
|
+ align-items: center;
|
|
|
|
534
|
+ padding: 32rpx 32rpx 22rpx;
|
|
|
|
535
|
+ border-bottom: 1rpx dashed #f0f0f0;
|
|
|
|
536
|
+
|
|
|
|
537
|
+ &_icon {
|
|
|
|
538
|
+ width: 32rpx;
|
|
|
|
539
|
+ height: 28rpx;
|
|
|
|
540
|
+ margin-right: 16rpx;
|
|
|
|
541
|
+ }
|
|
|
|
542
|
+
|
|
|
|
543
|
+ span {
|
|
|
|
544
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
545
|
+ font-size: 32rpx;
|
|
|
|
546
|
+ line-height: 44rpx;
|
|
|
|
547
|
+ font-weight: 600;
|
|
|
|
548
|
+ }
|
|
|
|
549
|
+ }
|
|
|
|
550
|
+
|
|
|
|
551
|
+ .section2 {
|
|
|
|
552
|
+ background: #f1f1f1;
|
|
|
|
553
|
+ }
|
|
|
|
554
|
+
|
|
|
|
555
|
+
|
|
|
|
556
|
+ .section3 {
|
|
|
|
557
|
+ padding: 0 32rpx;
|
|
|
|
558
|
+ background-color: #fff;
|
|
|
|
559
|
+ margin: 20rpx 0;
|
|
|
|
560
|
+ }
|
|
|
|
561
|
+
|
|
|
|
562
|
+ .view-total {
|
|
|
|
563
|
+ padding-bottom: 20rpx;
|
|
|
|
564
|
+
|
|
|
|
565
|
+ .head {
|
|
|
|
566
|
+ font-size: 32rpx;
|
|
|
|
567
|
+ font-weight: 600;
|
|
|
|
568
|
+ line-height: 50rpx;
|
|
|
|
569
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
570
|
+ padding-bottom: 16rpx;
|
|
|
|
571
|
+ margin-bottom: 24rpx;
|
|
|
|
572
|
+ border-bottom: 1px dashed #E7E7E7;
|
|
|
|
573
|
+ }
|
|
|
|
574
|
+
|
|
|
|
575
|
+ .row {
|
|
|
|
576
|
+ display: flex;
|
|
|
|
577
|
+ margin-bottom: 24rpx;
|
|
|
|
578
|
+ line-height: 32rpx;
|
|
|
|
579
|
+
|
|
|
|
580
|
+ .row2 {
|
|
|
|
581
|
+ width: 50%;
|
|
|
|
582
|
+ }
|
|
|
|
583
|
+
|
|
|
|
584
|
+ .label {
|
|
|
|
585
|
+ width: 180rpx;
|
|
|
|
586
|
+ margin-right: 14rpx;
|
|
|
|
587
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
|
588
|
+ font-size: 28rpx;
|
|
|
|
589
|
+ }
|
|
|
|
590
|
+
|
|
|
|
591
|
+ .value {
|
|
|
|
592
|
+ flex: 1;
|
|
|
|
593
|
+ color: rgba(0, 0, 0, 0.9);
|
|
|
|
594
|
+ font-size: 28rpx;
|
|
|
|
595
|
+ white-space: pre-wrap;
|
|
|
|
596
|
+ word-break: break-all;
|
|
|
|
597
|
+ }
|
|
|
|
598
|
+ }
|
|
|
|
599
|
+ }
|
|
|
|
600
|
+}
|
|
300
|
</style> |
601
|
</style> |