Commit 4573108bf61f98f0bfb8b2a8188be7305c9f1d43

Authored by gesilong
1 parent 75d905df

commit:发货单列表功能

... ... @@ -65,18 +65,18 @@
65 65 <!-- 产品 -->
66 66 <view class="section2">
67 67 <Product mode="approve" :list="initPurchaseOrderLineList" @change="purchaseOrderLineListChange"
68   - :orderDate="form.orderDate" />
  68 + :orderDate="form.orderDate" :canEditDeliveryAndAssessment="canEditQualityFields" />
69 69 </view>
70 70
71 71 <view class="section">
72 72 <uni-list-item title="价格表编号">
73 73 <template v-slot:footer>
74   - <uni-easyinput v-model="form.priceListNo" placeholder="请输入价格表编号" :inputBorder="false" />
  74 + <uni-easyinput v-model="form.priceListNo" placeholder="请输入价格表编号" :inputBorder="false" :disabled="canEditQualityFields"/>
75 75 </template>
76 76 </uni-list-item>
77 77 <uni-list-item title="开票要求">
78 78 <template v-slot:footer>
79   - <uni-easyinput v-model="form.invoicingStatus" placeholder="请输入开票要求" :inputBorder="false" />
  79 + <uni-easyinput v-model="form.invoicingStatus" placeholder="请输入开票要求" :inputBorder="false" :disabled="canEditQualityFields" />
80 80 </template>
81 81 </uni-list-item>
82 82 <uni-list-item class="amount-item">
... ... @@ -85,12 +85,12 @@
85 85 </template>
86 86 <template v-slot:footer>
87 87 <view class="amount-row">
88   - <uni-easyinput type="digit" v-model="form.shippingCost" placeholder="请输入运费" :inputBorder="false" />
  88 + <uni-easyinput type="digit" v-model="form.shippingCost" placeholder="请输入运费" :inputBorder="false" :disabled="canEditQualityFields" />
89 89 <text class="unit">元</text>
90 90 </view>
91 91 </template>
92 92 </uni-list-item>
93   - <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" clickable
  93 + <uni-list-item class="select-item" :class="form.executionStandardName ? 'is-filled' : 'is-empty'" :clickable="!canEditQualityFields"
94 94 @click="openSheet('executionStandard')" :rightText="form.executionStandardName || '请选择'" showArrow>
95 95 <template v-slot:body>
96 96 <view class="item-title"><text>执行标准</text></view>
... ... @@ -112,32 +112,37 @@
112 112 <uni-list-item title="件重条头">
113 113 <template v-slot:footer>
114 114 <uni-easyinput type="textarea" v-model="form.pieceWeightHeader" placeholder="请输入件重条头"
115   - :inputBorder="false" />
  115 + :inputBorder="false" :disabled="!canEditQualityFields" />
116 116 </template>
117 117 </uni-list-item>
118 118 <uni-list-item title="表面">
119 119 <template v-slot:footer>
120   - <uni-easyinput type="textarea" v-model="form.surface" placeholder="请输入表面" :inputBorder="false" />
  120 + <uni-easyinput type="textarea" v-model="form.surface" placeholder="请输入表面" :inputBorder="false"
  121 + :disabled="!canEditQualityFields" />
121 122 </template>
122 123 </uni-list-item>
123 124 <uni-list-item title="公差">
124 125 <template v-slot:footer>
125   - <uni-easyinput type="textarea" v-model="form.tolerance" placeholder="请输入公差" :inputBorder="false" />
  126 + <uni-easyinput type="textarea" v-model="form.tolerance" placeholder="请输入公差" :inputBorder="false"
  127 + :disabled="!canEditQualityFields" />
126 128 </template>
127 129 </uni-list-item>
128 130 <uni-list-item title="性能">
129 131 <template v-slot:footer>
130   - <uni-easyinput type="textarea" v-model="form.performance" placeholder="请输入性能" :inputBorder="false" />
  132 + <uni-easyinput type="textarea" v-model="form.performance" placeholder="请输入性能" :inputBorder="false"
  133 + :disabled="!canEditQualityFields" />
131 134 </template>
132 135 </uni-list-item>
133 136 <uni-list-item title="成分">
134 137 <template v-slot:footer>
135   - <uni-easyinput type="textarea" v-model="form.element" placeholder="请输入成分" :inputBorder="false" />
  138 + <uni-easyinput type="textarea" v-model="form.element" placeholder="请输入成分" :inputBorder="false"
  139 + :disabled="!canEditQualityFields" />
136 140 </template>
137 141 </uni-list-item>
138 142 <uni-list-item title="包装">
139 143 <template v-slot:footer>
140   - <uni-easyinput type="textarea" v-model="form.packaging" placeholder="请输入包装" :inputBorder="false" />
  144 + <uni-easyinput type="textarea" v-model="form.packaging" placeholder="请输入包装" :inputBorder="false"
  145 + :disabled="!canEditQualityFields" />
141 146 </template>
142 147 </uni-list-item>
143 148 <uni-list-item title="备注">
... ... @@ -286,13 +291,22 @@ export default {
286 291 isReadonly: false,
287 292 historyProductionProcessLoaded: false,
288 293 historyProductionProcessLoading: false,
  294 + canEditQualityFields: false,
289 295 }
290 296 },
291 297 computed: {
292 298 roleCodes() {
293 299 const g = this.$store && this.$store.getters
294 300 return (g && g.roleCodes) || []
295   - }
  301 + },
  302 + // isNewRole() {
  303 + // const specialRoles = ['yfcjybjhy', 'efcjybjhy', 'sfcjybjhy', 'ztfcjybjhy']
  304 + // return this.roleCodes.some(code => specialRoles.includes(code))
  305 + // },
  306 + // canEditQualityFields() {
  307 + // if (!this.isReadonly) return true
  308 + // return this.isNewRole
  309 + // }
296 310 },
297 311 watch: {
298 312 id: {
... ... @@ -309,8 +323,13 @@ export default {
309 323 // 办事处内勤 可编辑(部分编辑字段),其他角色都是不可编辑
310 324 if (val.includes('bscnq')) {
311 325 this.isReadonly = false;
  326 + this.canEditQualityFields = false
  327 + } else if (val.some(code => ['yfcjybjhy', 'efcjybjhy', 'sfcjybjhy', 'ztfcjybjhy'].includes(code))) {
  328 + this.isReadonly = false;
  329 + this.canEditQualityFields = true
312 330 } else {
313 331 this.isReadonly = true;
  332 + this.canEditQualityFields = false
314 333 }
315 334 }
316 335 }
... ... @@ -319,6 +338,7 @@ export default {
319 338 this.loadDicOptions()
320 339 },
321 340 methods: {
  341 +
322 342 loadDicOptions() {
323 343 const dicCodes = ['SUPPLIER', 'APPLICABLE_STANDARD']
324 344 return getDicByCodes(dicCodes).then(results => {
... ... @@ -457,6 +477,9 @@ export default {
457 477
458 478 ::v-deep .uni-list {
459 479 background: transparent;
  480 + .uni-input-input:disabled {
  481 + color: rgb(51, 51, 51) !important;
  482 + }
460 483
461 484 &-item {
462 485 &__extra-text {
... ...
... ... @@ -63,18 +63,18 @@
63 63
64 64 <!-- 产品 -->
65 65 <view class="section2">
66   - <Product mode="add" :list="initPurchaseOrderLineList" @change="purchaseOrderLineListChange" :pageType="'modify'" :orderDate="form.orderDate" />
  66 + <Product mode="add" :list="initPurchaseOrderLineList" @change="purchaseOrderLineListChange" :pageType="'modify'" :orderDate="form.orderDate" :canEditDeliveryAndAssessment="true" />
67 67 </view>
68 68
69 69 <view class="section">
70 70 <uni-list-item title="价格表编号">
71 71 <template v-slot:footer>
72   - <uni-easyinput v-model="form.priceListNo" placeholder="请输入价格表编号" :inputBorder="false" />
  72 + <view class="readonly-text">{{ form.priceListNo }}</view>
73 73 </template>
74 74 </uni-list-item>
75 75 <uni-list-item title="开票要求">
76 76 <template v-slot:footer>
77   - <uni-easyinput v-model="form.invoicingStatus" placeholder="请输入开票要求" :inputBorder="false" />
  77 + <view class="readonly-text">{{ form.invoicingStatus }}</view>
78 78 </template>
79 79 </uni-list-item>
80 80 <uni-list-item class="amount-item">
... ... @@ -83,8 +83,7 @@
83 83 </template>
84 84 <template v-slot:footer>
85 85 <view class="amount-row">
86   - <uni-easyinput type="number" v-model="form.shippingCost" placeholder="0.00" :inputBorder="false" />
87   - <text class="unit">元</text>
  86 + <view class="readonly-text">{{ form.shippingCost }}元</view>
88 87 </view>
89 88 </template>
90 89 </uni-list-item>
... ... @@ -96,7 +95,7 @@
96 95 </uni-list-item>
97 96 <uni-list-item title="标准" v-if="form.executionStandard === 'OTHER'">
98 97 <template v-slot:footer>
99   - <uni-easyinput v-model="form.executionStandardRemarks" placeholder="请输入标准" :inputBorder="false" />
  98 + <view class="readonly-text">{{ form.executionStandardRemarks }}</view>
100 99 </template>
101 100 </uni-list-item>
102 101 </view>
... ... @@ -140,7 +139,7 @@
140 139 </uni-list-item>
141 140 <uni-list-item title="备注">
142 141 <template v-slot:footer>
143   - <uni-easyinput type="textarea" v-model="form.remarks" placeholder="请输入备注" :inputBorder="false" />
  142 + <view class="readonly-text">{{ form.remarks }}</view>
144 143 </template>
145 144 </uni-list-item>
146 145 <view class="footer">
... ... @@ -341,7 +340,9 @@ export default {
341 340
342 341 ::v-deep .uni-list {
343 342 background: transparent;
344   -
  343 + .uni-input-input:disabled {
  344 + color: rgb(51, 51, 51) !important;
  345 + }
345 346 &-item {
346 347 &__extra-text {
347 348 font-size: 32rpx;
... ...
... ... @@ -16,43 +16,95 @@
16 16
17 17 <view v-if="mode === 'add'" class="section">
18 18 <view v-for="(item, idx) in items" :key="'a-' + idx" class="block">
19   - <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view>
20   - <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view>
21   - <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view>
  19 + <view v-show="item.collapsed">
  20 + <view class="row"><text class="label">行业</text><text class="value">{{ item.industry }}</text></view>
  21 + <view class="row"><text class="label">品质</text><text class="value">{{ item.quality }}</text></view>
  22 + <view class="row"><text class="label">牌号</text><text class="value">{{ item.brand }}</text></view>
  23 + </view>
  24 +
22 25
23 26 <view v-show="!item.collapsed">
24   - <!-- 厚(公差) * 宽(公差) * 长(公差) -->
25   - <view class="row row-spec"><text class="label">规格(mm)</text>
26   - <view class="value value-spec">
27   - <view v-if="item.thickness" class="value-spec_val">{{ item.thickness }}</view>
28   - <view v-if="item.thickness" class="value-spec_box">
29   - <view v-if="item.thicknessTolPos" class="value-spec_box_1">{{ item.thicknessTolPos ? '+' + item.thicknessTolPos : item.thicknessTolPos }}
30   - </view>
31   - <view v-if="item.thicknessTolNeg" class="value-spec_box_2">{{ item.thicknessTolNeg ? '+' + item.thicknessTolNeg : item.thicknessTolNeg }}
32   - </view>
33   - </view>
34   - <view v-if="item.width" class="value-spec_val p12">*</view>
35   - <view v-if="item.width" class="value-spec_val">{{ item.width }}</view>
36   - <view v-if="item.width" class="value-spec_box">
37   - <view v-if="item.widthTolPos" class="value-spec_box_1">{{ item.widthTolPos > 0 ? '+' + item.widthTolPos : item.widthTolPos }}</view>
38   - <view v-if="item.widthTolNeg" class="value-spec_box_2">{{ item.widthTolNeg > 0 ? '+' + item.widthTolNeg : item.widthTolNeg }}</view>
39   - </view>
40   - <view v-if="item.length" class="value-spec_val p12">*</view>
41   - <view v-if="item.length" class="value-spec_val">{{ item.length }}</view>
42   - <view v-if="item.length" class="value-spec_box">
43   - <view v-if="item.lengthTolPos" class="value-spec_box_1">{{ item.lengthTolPos > 0 ? '+' + item.lengthTolPos : item.lengthTolPos }}</view>
44   - <view v-if="item.lengthTolNeg" class="value-spec_box_2">{{ item.lengthTolNeg > 0 ? '+' + item.lengthTolNeg : item.lengthTolNeg }}</view>
45   - </view>
46   - </view>
47   - </view>
48   - <view class="row"><text class="label">状态</text><text class="value">{{ item.status }}</text></view>
49   - <view class="row" :class="{ 'noneStyle': !item.showSalesPrice }"><text
50   - class="label">数量kg</text><text class="value">{{ item.quantity }}</text>
51   - </view>
52   - <view class="row" :class="{ 'noneStyle': item.showSalesPrice }" v-if="item.showSalesPrice"><text
53   - class="label">销售价格</text><text class="value">{{
54   - item.salesPrice }}</text></view>
55 27 <uni-list class="edit-list">
  28 + <uni-list-item title="行业">
  29 + <template v-slot:footer>
  30 + <uni-easyinput v-model="item.industry" placeholder="请输入行业" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  31 + </template>
  32 + </uni-list-item>
  33 + <uni-list-item title="品质">
  34 + <template v-slot:footer>
  35 + <uni-easyinput v-model="item.quality" placeholder="请输入品质" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  36 + </template>
  37 + </uni-list-item>
  38 + <uni-list-item title="牌号">
  39 + <template v-slot:footer>
  40 + <uni-easyinput v-model="item.brand" placeholder="请输入牌号" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  41 + </template>
  42 + </uni-list-item>
  43 +
  44 + <uni-list-item title="厚度(mm)">
  45 + <template v-slot:footer>
  46 + <uni-easyinput type="digit" v-model="item.thickness" placeholder="请输入厚度" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  47 + </template>
  48 + </uni-list-item>
  49 + <uni-list-item title="厚度公差上限(mm)">
  50 + <template v-slot:footer>
  51 + <uni-easyinput type="digit" v-model="item.thicknessTolPos" placeholder="请输入厚度公差上限" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  52 + </template>
  53 + </uni-list-item>
  54 + <uni-list-item title="厚度公差下限(mm)">
  55 + <template v-slot:footer>
  56 + <uni-easyinput type="digit" v-model="item.thicknessTolNeg" placeholder="请输入厚度公差下限" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  57 + </template>
  58 + </uni-list-item>
  59 +
  60 + <uni-list-item title="宽度(mm)">
  61 + <template v-slot:footer>
  62 + <uni-easyinput type="digit" v-model="item.width" placeholder="请输入宽度" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  63 + </template>
  64 + </uni-list-item>
  65 + <uni-list-item title="宽度公差上限(mm)">
  66 + <template v-slot:footer>
  67 + <uni-easyinput type="digit" v-model="item.widthTolPos" placeholder="请输入宽度公差上限" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  68 + </template>
  69 + </uni-list-item>
  70 + <uni-list-item title="宽度公差下限(mm)">
  71 + <template v-slot:footer>
  72 + <uni-easyinput type="digit" v-model="item.widthTolNeg" placeholder="请输入宽度公差下限" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  73 + </template>
  74 + </uni-list-item>
  75 +
  76 + <uni-list-item title="长度(mm)">
  77 + <template v-slot:footer>
  78 + <uni-easyinput type="digit" v-model="item.length" placeholder="请输入长度" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  79 + </template>
  80 + </uni-list-item>
  81 + <uni-list-item title="长度公差上限(mm)">
  82 + <template v-slot:footer>
  83 + <uni-easyinput type="digit" v-model="item.lengthTolPos" placeholder="请输入长度公差上限" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  84 + </template>
  85 + </uni-list-item>
  86 + <uni-list-item title="长度公差下限(mm)">
  87 + <template v-slot:footer>
  88 + <uni-easyinput type="digit" v-model="item.lengthTolNeg" placeholder="请输入长度公差下限" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  89 + </template>
  90 + </uni-list-item>
  91 +
  92 + <uni-list-item title="状态">
  93 + <template v-slot:footer>
  94 + <uni-easyinput v-model="item.status" placeholder="请输入状态" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  95 + </template>
  96 + </uni-list-item>
  97 + <uni-list-item title="数量kg">
  98 + <template v-slot:footer>
  99 + <uni-easyinput type="digit" v-model="item.quantity" placeholder="请输入数量" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  100 + </template>
  101 + </uni-list-item>
  102 + <uni-list-item title="销售价格" v-if="item.showSalesPrice">
  103 + <template v-slot:footer>
  104 + <uni-easyinput type="digit" v-model="item.salesPrice" placeholder="请输入销售价格" :inputBorder="false" :disabled="canEditDeliveryAndAssessment" />
  105 + </template>
  106 + </uni-list-item>
  107 +
56 108 <uni-list-item class="amount-item">
57 109 <template v-slot:body>
58 110 <view class="item-title"><text>包装费</text></view>
... ... @@ -61,6 +113,7 @@
61 113 <view class="amount-row">
62 114 <uni-easyinput type="digit" v-model="item.packagingFee" placeholder="0.00"
63 115 :inputBorder="false"
  116 + :disabled="canEditDeliveryAndAssessment"
64 117 @input="onNonNegativeNumberInput($event, item, idx, 'packagingFee')"
65 118 @blur="onNonNegativeNumberBlur(item, idx, 'packagingFee')" />
66 119 <text class="unit">元</text>
... ... @@ -70,17 +123,23 @@
70 123 <uni-list-item title="发货日期">
71 124 <template v-slot:footer>
72 125 <uni-datetime-picker type="date" v-model="item.deliveryDate" :start="minDeliveryDate"
  126 + :disabled="!canEditDeliveryAndAssessment"
73 127 @change="onDeliveryChange($event, item, idx)" />
74 128 </template>
75 129 </uni-list-item>
76 130 <uni-list-item title="考核超协">
77 131 <template v-slot:footer>
78   - <uni-easyinput type="digit" :disabled="pageType === 'modify'"
79   - v-model="item.assessmentExceedsAgreement"
80   - :placeholder="pageType === 'modify' ? '' : '请输入考核超协'" :inputBorder="false"
  132 + <uni-easyinput type="digit" v-model="item.assessmentExceedsAgreement" placeholder="请输入考核超协" :inputBorder="false"
  133 + :disabled="!canEditDeliveryAndAssessment"
81 134 @input="onAssessmentInput($event, idx)" @blur="onAssessmentBlur($event, idx)" />
82 135 </template>
83 136 </uni-list-item>
  137 + <uni-list-item class="select-item" :class="String(item.sampleOrder) ? 'is-filled' : 'is-empty'" :clickable="!canEditDeliveryAndAssessment"
  138 + @click="openSheet(idx)" :rightText="(item.sampleOrder === true ? '是' : (item.sampleOrder === false ? '否' : '')) || '请选择'" showArrow>
  139 + <template v-slot:body>
  140 + <view class="item-title"><text>是否为试样订单</text></view>
  141 + </template>
  142 + </uni-list-item>
84 143 </uni-list>
85 144 </view>
86 145
... ... @@ -142,7 +201,7 @@
142 201 <uni-easyinput type="digit" v-model="item.packagingFee" placeholder="0.00"
143 202 :inputBorder="false"
144 203 @input="onNonNegativeNumberInput($event, item, idx, 'packagingFee')"
145   - @blur="onNonNegativeNumberBlur(item, idx, 'packagingFee')" />
  204 + @blur="onNonNegativeNumberBlur(item, idx, 'packagingFee')" :disabled="canEditDeliveryAndAssessment"/>
146 205 <text class="unit">元</text>
147 206 </view>
148 207 </template>
... ... @@ -150,17 +209,18 @@
150 209 <uni-list-item title="发货日期">
151 210 <template v-slot:footer>
152 211 <uni-datetime-picker type="date" v-model="item.deliveryDate" :start="minDeliveryDate"
  212 + :disabled="!canEditDeliveryAndAssessment"
153 213 @change="onDeliveryChange($event, item, idx)" />
154 214 </template>
155 215 </uni-list-item>
156 216 <uni-list-item title="考核超协">
157 217 <template v-slot:footer>
158   - <uni-easyinput :disabled="pageType === 'modify'"
  218 + <uni-easyinput :disabled="pageType === 'modify' || !canEditDeliveryAndAssessment"
159 219 v-model="item.assessmentExceedsAgreement"
160 220 :placeholder="pageType === 'modify' ? '' : '请输入考核超协'" :inputBorder="false" />
161 221 </template>
162 222 </uni-list-item>
163   - <uni-list-item class="select-item" :class="String(item.sampleOrder) ? 'is-filled' : 'is-empty'" clickable
  223 + <uni-list-item class="select-item" :class="String(item.sampleOrder) ? 'is-filled' : 'is-empty'" :clickable="!canEditDeliveryAndAssessment"
164 224 @click="openSheet(idx)" :rightText="(item.sampleOrder ? '是' : '否') || '请选择'" showArrow>
165 225 <template v-slot:body>
166 226 <view class="item-title"><text>是否为试样订单</text></view>
... ... @@ -310,7 +370,9 @@ export default {
310 370 max: { type: Number, default: 8 },
311 371 totalQuantity: { type: Number, default: 0 },
312 372 pageType: { type: String, default: '' },
313   - orderDate: { type: String, default: '' }
  373 + orderDate: { type: String, default: '' },
  374 + canEditDeliveryAndAssessment: { type: Boolean, default: false },
  375 + // onlyEditDeliveryAndAssessment: { type: Boolean, default: false }
314 376 },
315 377 data() {
316 378 return {
... ... @@ -358,7 +420,29 @@ export default {
358 420 },
359 421 methods: {
360 422 defaultItem() {
361   - return { collapsed: false, packagingFee: '' }
  423 + return {
  424 + collapsed: false,
  425 + industry: '',
  426 + quality: '',
  427 + brand: '',
  428 + thickness: '',
  429 + thicknessTolPos: '',
  430 + thicknessTolNeg: '',
  431 + width: '',
  432 + widthTolPos: '',
  433 + widthTolNeg: '',
  434 + length: '',
  435 + lengthTolPos: '',
  436 + lengthTolNeg: '',
  437 + status: '',
  438 + quantity: '',
  439 + salesPrice: '',
  440 + showSalesPrice: false,
  441 + packagingFee: '',
  442 + deliveryDate: '',
  443 + assessmentExceedsAgreement: '',
  444 + sampleOrder: ''
  445 + }
362 446 },
363 447 toggleItem(idx) {
364 448 const it = this.items[idx]
... ... @@ -707,7 +791,7 @@ export default {
707 791
708 792 .block {
709 793 background: #ffffff;
710   - padding: 32rpx 0;
  794 + //padding: 32rpx 0;
711 795 margin-bottom: 20rpx;
712 796
713 797 &:last-child {
... ...