Commit fd7f44a706fcc5776c7c359d68ada0b1c10a1608

Authored by 史婷婷
1 parent b4a9e32e

feat: 发货单-审核&审核详情

1 <template> 1 <template>
2 - <view class="page"> 2 + <!-- 办事处内勤 可编辑(部分编辑字段),其他角色都是不可编辑 -->
  3 + <view v-if="!isReadonly" class="page">
3 <scroll-view class="scroll" scroll-y> 4 <scroll-view class="scroll" scroll-y>
4 <uni-list> 5 <uni-list>
5 <view class="section"> 6 <view class="section">
@@ -145,6 +146,57 @@ @@ -145,6 +146,57 @@
145 <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" 146 <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value"
146 @confirm="onSheetConfirm" /> 147 @confirm="onSheetConfirm" />
147 </view> 148 </view>
  149 + <view v-else class="view-page">
  150 + <scroll-view class="scroll" scroll-y>
  151 + <view class="detail-page">
  152 + <view class="section">
  153 + <text class="row company">{{ form.orderNo }}</text>
  154 + <view :class="['status', `status_${form.status}`]" />
  155 + <view class="row"><text class="label">供货单位</text><text class="value">{{ getDicName('SUPPLIER',
  156 + form.supplyUnit, dicOptions.SUPPLIER) }}</text></view>
  157 + <view class="row"><text class="label">订货单位</text><text class="value">{{ form.orderingUnitName }}</text>
  158 + </view>
  159 + <view class="row"><text class="label">订货日期</text><text class="value">{{ form.orderDate }}</text></view>
  160 + <view class="row"><text class="label">生产厂</text><text class="value">{{ form.workshopName }}</text></view>
  161 + <view class="row"><text class="label">结算方式或期限</text><text class="value">{{ form.settlementTerms }}</text>
  162 + </view>
  163 + <view class="row"><text class="label">交货方式</text><text class="value">{{ form.deliveryMethod }}</text></view>
  164 + </view>
  165 +
  166 + <!-- 产品 -->
  167 + <view class="mgb10">
  168 + <Product mode="view" :list="form.purchaseOrderLineList"
  169 + :totalQuantity="form.totalQuantity || 0" />
  170 + </view>
  171 +
  172 + <view class="section">
  173 + <view class="row"><text class="label">价格表编号</text><text class="value">{{ form.priceListNo }}</text></view>
  174 + <view class="row"><text class="label">开票情况</text><text class="value">{{ form.invoicingStatus }}</text></view>
  175 + <view class="row"><text class="label">运费</text><text class="value">{{ form.shippingCost }}</text></view>
  176 + <view class="row"><text class="label">包装费</text><text class="value">{{ form.packagingFee }}</text></view>
  177 + <view class="row"><text class="label">执行标准</text><text class="value">{{ getDicName('APPLICABLE_STANDARD',
  178 + form.executionStandard, dicOptions.APPLICABLE_STANDARD) }}</text></view>
  179 + </view>
  180 +
  181 + <view class="title-header">
  182 + <image class="title-header_icon" src="/static/images/title.png" />
  183 + <span>具体质量要求</span>
  184 + </view>
  185 + <view class="section">
  186 + <view class="row"><text class="label">件重条头</text><text class="value">{{ form.pieceWeightHeader }}</text>
  187 + </view>
  188 + <view class="row"><text class="label">表面</text><text class="value">{{ form.surface }}</text></view>
  189 + <view class="row"><text class="label">公差</text><text class="value">{{ form.tolerance }}</text></view>
  190 + <view class="row"><text class="label">性能</text><text class="value">{{ form.performance }}</text></view>
  191 + <view class="row"><text class="label">成分</text><text class="value">{{ form.element }}</text></view>
  192 + <view class="row"><text class="label">包装</text><text class="value">{{ form.packaging }}</text></view>
  193 + <view class="row"><text class="label">备注</text><text class="value">{{ form.remarks }}</text></view>
  194 + </view>
  195 +
  196 + </view>
  197 + </scroll-view>
  198 +
  199 + </view>
148 </template> 200 </template>
149 201
150 <script> 202 <script>
@@ -155,7 +207,7 @@ import { getDicName } from '@/utils/dic.js' @@ -155,7 +207,7 @@ import { getDicName } from '@/utils/dic.js'
155 import { getDicByCodes } from '@/utils/dic' 207 import { getDicByCodes } from '@/utils/dic'
156 208
157 export default { 209 export default {
158 - name: 'OrderListModify', 210 + name: 'OrderListApprove',
159 components: { Product, SingleSelectSheet }, 211 components: { Product, SingleSelectSheet },
160 props: { id: { type: [String, Number], default: '' } }, 212 props: { id: { type: [String, Number], default: '' } },
161 data() { 213 data() {
@@ -193,7 +245,14 @@ export default { @@ -193,7 +245,14 @@ export default {
193 }, 245 },
194 initPurchaseOrderLineList: [], 246 initPurchaseOrderLineList: [],
195 dicOptions: { SUPPLIER: [], APPLICABLE_STANDARD: [] }, 247 dicOptions: { SUPPLIER: [], APPLICABLE_STANDARD: [] },
196 - sheet: { visible: false, title: '请选择', options: [], value: '', field: '' } 248 + sheet: { visible: false, title: '请选择', options: [], value: '', field: '' },
  249 + isReadonly: false,
  250 + }
  251 + },
  252 + computed: {
  253 + roleCodes() {
  254 + const g = this.$store && this.$store.getters
  255 + return (g && g.roleCodes) || []
197 } 256 }
198 }, 257 },
199 watch: { 258 watch: {
@@ -203,10 +262,22 @@ export default { @@ -203,10 +262,22 @@ export default {
203 const v = (val !== undefined && val !== null) ? String(val) : '' 262 const v = (val !== undefined && val !== null) ? String(val) : ''
204 if (v) this.loadDetail(v) 263 if (v) this.loadDetail(v)
205 } 264 }
  265 + },
  266 + roleCodes: {
  267 + immediate: true,
  268 + handler(val) {
  269 + console.log('roleCodes', val);
  270 + // 办事处内勤 可编辑(部分编辑字段),其他角色都是不可编辑
  271 + if (val.includes('bscnq')) {
  272 + this.isReadonly = false;
  273 + } else {
  274 + this.isReadonly = true;
  275 + }
  276 + }
206 } 277 }
207 }, 278 },
208 created() { 279 created() {
209 - this.loadAllDicData() 280 + this.loadDicOptions()
210 }, 281 },
211 methods: { 282 methods: {
212 loadDicOptions() { 283 loadDicOptions() {
@@ -267,6 +338,10 @@ export default { @@ -267,6 +338,10 @@ export default {
267 const list = Array.isArray(data) ? data : [] 338 const list = Array.isArray(data) ? data : []
268 this.form.purchaseOrderLineList = list; 339 this.form.purchaseOrderLineList = list;
269 }, 340 },
  341 + getFormValues() {
  342 + const m = this.form || {}
  343 + return JSON.parse(JSON.stringify(m))
  344 + }
270 } 345 }
271 } 346 }
272 </script> 347 </script>
@@ -445,11 +520,6 @@ export default { @@ -445,11 +520,6 @@ export default {
445 } 520 }
446 } 521 }
447 522
448 -/* 只读 easyinput 根据内容自适应高度 */  
449 -::v-deep .uni-list-item__container {  
450 - align-items: flex-start;  
451 -}  
452 -  
453 /* 只读文本样式 */ 523 /* 只读文本样式 */
454 .readonly-text { 524 .readonly-text {
455 color: rgba(0, 0, 0, 0.9); 525 color: rgba(0, 0, 0, 0.9);
@@ -519,4 +589,127 @@ export default { @@ -519,4 +589,127 @@ export default {
519 } 589 }
520 } 590 }
521 } 591 }
  592 +
  593 +.view-page {
  594 + .scroll {
  595 + padding: 0;
  596 + }
  597 +
  598 + .section {
  599 + padding: 32rpx;
  600 + background: #fff;
  601 + margin-bottom: 20rpx;
  602 + position: relative;
  603 +
  604 + .status {
  605 + position: absolute;
  606 + top: 16rpx;
  607 + right: 52rpx;
  608 + width: 180rpx;
  609 + height: 146rpx;
  610 + background-repeat: no-repeat;
  611 + background-size: 100% 100%;
  612 + background-position: center;
  613 +
  614 + // 已下发
  615 + &_ISSUED {
  616 + background-image: url('~@/static/images/order_list/status_ISSUED.png');
  617 + }
  618 +
  619 + // 待发货
  620 + &_WAIT {
  621 + background-image: url('~@/static/images/order_list/status_WAIT.png');
  622 + }
  623 +
  624 + // 部分发货
  625 + &_TRANSIT {
  626 + background-image: url('~@/static/images/order_list/status_TRANSIT.png');
  627 + }
  628 +
  629 + // 发货完成
  630 + &_SHIPPED {
  631 + background-image: url('~@/static/images/order_list/status_SHIPPED.png');
  632 + }
  633 +
  634 + // 已签收
  635 + &_DELIVERED {
  636 + background-image: url('~@/static/images/order_list/status_DELIVERED.png');
  637 + }
  638 +
  639 + }
  640 + }
  641 +
  642 + .mgb10 {
  643 + margin-bottom: 20rpx;
  644 + }
  645 +
  646 + .row {
  647 + display: flex;
  648 + margin-bottom: 28rpx;
  649 +
  650 + &:last-child {
  651 + margin-bottom: 0;
  652 + }
  653 +
  654 + &.company {
  655 + font-size: 36rpx;
  656 + font-weight: 600;
  657 + color: rgba(0, 0, 0, 0.9);
  658 + padding-top: 32rpx;
  659 + line-height: 50rpx;
  660 + }
  661 +
  662 + .label {
  663 + max-width: 420rpx;
  664 + line-height: 32rpx;
  665 + font-size: 28rpx;
  666 + color: rgba(0, 0, 0, 0.6);
  667 + }
  668 +
  669 + .value {
  670 + flex: 1;
  671 + line-height: 32rpx;
  672 + font-size: 28rpx;
  673 + color: rgba(0, 0, 0, 0.9);
  674 + text-align: right;
  675 +
  676 + &.act {
  677 + color: $theme-primary;
  678 + }
  679 +
  680 + .category {
  681 + display: inline-block;
  682 + padding: 4rpx 12rpx;
  683 + border-radius: 6rpx;
  684 + font-size: 24rpx;
  685 + width: auto;
  686 +
  687 + &.category_A {
  688 + background: #FFF0ED;
  689 + color: #D54941;
  690 + }
  691 +
  692 + &.category_B {
  693 + background: #FFF1E9;
  694 + color: #E37318;
  695 + }
  696 +
  697 + &.category_C {
  698 + background: #F2F3FF;
  699 + color: $theme-primary;
  700 + }
  701 +
  702 + &.category_D {
  703 + background: #E3F9E9;
  704 + color: #2BA471;
  705 + }
  706 + }
  707 + }
  708 + }
  709 +
  710 + .card {
  711 + padding: 16rpx 0 8rpx;
  712 + border-top: 1rpx solid #f0f0f0;
  713 + }
  714 +}
522 </style> 715 </style>
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 19
20 <!-- 产品 --> 20 <!-- 产品 -->
21 <view class="mgb10"> 21 <view class="mgb10">
22 - <Product mode="view" :options="genderOptions" :list="form.purchaseOrderLineList" :totalQuantity="form.totalQuantity" /> 22 + <Product mode="view" :options="genderOptions" :list="form.purchaseOrderLineList" :totalQuantity="form.totalQuantity || 0" />
23 </view> 23 </view>
24 24
25 <view class="section"> 25 <view class="section">
@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 17
18 <!-- 产品 --> 18 <!-- 产品 -->
19 <view class="mgb10"> 19 <view class="mgb10">
20 - <Product mode="view" :options="genderOptions" :list="form.purchaseOrderLineList" :totalQuantity="form.totalQuantity" /> 20 + <Product mode="view" :list="form.purchaseOrderLineList" :totalQuantity="form.totalQuantity || 0" />
21 </view> 21 </view>
22 22
23 <view class="section"> 23 <view class="section">
@@ -67,7 +67,6 @@ export default { @@ -67,7 +67,6 @@ export default {
67 return { 67 return {
68 form: {}, 68 form: {},
69 enterpriseTypeOptions: [], 69 enterpriseTypeOptions: [],
70 - genderOptions: [],  
71 categoryOptions: [], 70 categoryOptions: [],
72 historyList: [], 71 historyList: [],
73 showExamine: false, 72 showExamine: false,
@@ -263,70 +262,14 @@ export default { @@ -263,70 +262,14 @@ export default {
263 border-top: 1rpx solid #f0f0f0; 262 border-top: 1rpx solid #f0f0f0;
264 } 263 }
265 264
266 -.history-header {  
267 - display: flex;  
268 - background: #F7F7F7;  
269 - padding: 20rpx 52rpx 20rpx 32rpx;  
270 -  
271 - .col {  
272 - font-size: 28rpx;  
273 - color: rgba(0, 0, 0, 0.9);  
274 - line-height: 40rpx;  
275 - }  
276 -  
277 - .col1 {  
278 - width: 20%;  
279 - }  
280 -  
281 - .col2 {  
282 - width: 50%;  
283 - text-align: center;  
284 - }  
285 -  
286 - .col3 {  
287 - width: 30%;  
288 - text-align: right;  
289 - }  
290 -}  
291 -  
292 -.history-row {  
293 - display: flex;  
294 - padding: 20rpx 52rpx 20rpx 32rpx;  
295 - border-bottom: 1rpx solid #f7f7f7;  
296 -  
297 - .col {  
298 - font-size: 28rpx;  
299 - color: rgba(0, 0, 0, 0.9);  
300 - line-height: 40rpx;  
301 - }  
302 -  
303 - .col1 {  
304 - width: 20%;  
305 - }  
306 -  
307 - .col2 {  
308 - width: 50%;  
309 - text-align: center;  
310 - }  
311 -  
312 - .col3 {  
313 - width: 30%;  
314 - text-align: right;  
315 - }  
316 -  
317 - .link {  
318 - color: $theme-primary;  
319 - }  
320 -}  
321 265
322 .title-header { 266 .title-header {
323 background-color: #fff; 267 background-color: #fff;
324 display: flex; 268 display: flex;
325 align-items: center; 269 align-items: center;
326 padding: 32rpx 32rpx 22rpx; 270 padding: 32rpx 32rpx 22rpx;
327 - border-bottom: 1rpx dashed #f0f0f0;  
328 271
329 - &_icon { 272 + .title-header_icon {
330 width: 32rpx; 273 width: 32rpx;
331 height: 28rpx; 274 height: 28rpx;
332 margin-right: 16rpx; 275 margin-right: 16rpx;
@@ -339,4 +282,5 @@ export default { @@ -339,4 +282,5 @@ export default {
339 font-weight: 600; 282 font-weight: 600;
340 } 283 }
341 } 284 }
  285 +
342 </style> 286 </style>