Commit 0fa4a675ece2e88ccc159ecd24ef8acb43bbde6b

Authored by lxf
1 parent 1275108f

fix: 宁夏邮政定制

pages.json
... ... @@ -28,6 +28,11 @@
28 28 "navigationBarTitleText": "创建货源"
29 29 }
30 30 },{
  31 + "path": "pages/goodSource/goods-info",
  32 + "style": {
  33 + "navigationBarTitleText": "货物信息"
  34 + }
  35 + },{
31 36 "path": "pages/goodSource/select-remark",
32 37 "style": {
33 38 "navigationBarTitleText": "填写备注"
... ...
pages/goodSource/add.vue
... ... @@ -24,7 +24,7 @@
24 24 </u-form-item>
25 25 </view>
26 26 <view class="card">
27   - <u-form-item label="货物类型" required @click="choseGoodsName">
  27 + <u-form-item label="货物信息" required @click="selectGoodsInfo">
28 28 <u-input :value="form.goodsName" border="none" suffix-icon="arrow-right" placeholder="请选择" disabledColor="#ffffff" disabled />
29 29 </u-form-item>
30 30 <u-form-item label="需求车型" required @click="specificationVisible = true">
... ... @@ -161,6 +161,9 @@ export default {
161 161 specification: '',
162 162 vanType: '',
163 163 goodsName: '',
  164 + dispatchUnit: '',
  165 + customerContractNo: '',
  166 + transportShiftNo: '',
164 167 priceType: 'VEHICLE', // VEHICLE, TON
165 168 priceTypeName: '',
166 169 goodsWeight: '',
... ... @@ -178,7 +181,7 @@ export default {
178 181 };
179 182 },
180 183 computed: {
181   - ...mapGetters(['dictList', 'dictValue', 'userInfo']),
  184 + ...mapGetters(['dictList', 'dictValue', 'userInfo', 'freightInfo']),
182 185 // 箱型
183 186 vanTypeList() {
184 187 return [...this.dictList('VEHICLE_COMPARTMENT_TYPE'), { valueCode: 'ALL', valueName: '不限' }];
... ... @@ -212,6 +215,9 @@ export default {
212 215 priceTypeColumns() {
213 216 return [this.dictList('FREIGHT_GOODS_SOURCE_PRICE_TYPE')];
214 217 },
  218 + ningXiaYouZhengFlag() {
  219 + return this.freightInfo.enterpriseName === '中国邮政速递物流股份有限公司宁夏物流运营分公司' && this.form.projectName === 'JYYJ';
  220 + },
215 221 },
216 222 onLoad(option) {
217 223 if (option.code) {
... ... @@ -310,20 +316,21 @@ export default {
310 316 chosePriceType() {
311 317 this.priceTypeVisible = true;
312 318 },
313   - choseGoodsName() {
314   - uni.$off('select-common');
315   - uni.$once('select-common', option => {
316   - this.form.goodsName = option.name;
317   - });
  319 + selectGoodsInfo() {
318 320 uni.navigateTo({
319   - url: `/pages/global/search-common${urlParam({
320   - mode: 'select',
321   - url: 'goodsName',
322   - title: '货物名称',
323   - label: 'name',
324   - value: '',
325   - params: `{"projectCode":"${this.form.projectCode}"}`,
326   - })}`,
  321 + url: `/pages/goodSource/goods-info`,
  322 + events: {
  323 + submitData: option => {
  324 + this.form = {
  325 + ...this.form,
  326 + ...option,
  327 + };
  328 + uni.navigateBack();
  329 + },
  330 + },
  331 + success: res => {
  332 + res.eventChannel.emit('data', { form: this.form, ningXiaYouZhengFlag: this.ningXiaYouZhengFlag });
  333 + },
327 334 });
328 335 },
329 336 selectAddress(index) {
... ...
pages/goodSource/detail.vue
... ... @@ -7,6 +7,18 @@
7 7 <view class="card__item_field">货物类型</view>
8 8 <view class="card__item_content">{{ form.goodsName || '' }}</view>
9 9 </view>
  10 + <view class="card__item">
  11 + <view class="card__item_field">发货单位</view>
  12 + <view class="card__item_content">{{ form.dispatchUnit || '' }}</view>
  13 + </view>
  14 + <view class="card__item">
  15 + <view class="card__item_field">合同号</view>
  16 + <view class="card__item_content">{{ form.customerContractNo || '' }}</view>
  17 + </view>
  18 + <view class="card__item">
  19 + <view class="card__item_field">运输班次号</view>
  20 + <view class="card__item_content">{{ form.transportShiftNo || '' }}</view>
  21 + </view>
10 22 <template v-if="form.priceType === 'TON'">
11 23 <view class="card__item">
12 24 <view class="card__item_field">货物总量</view>
... ...
pages/goodSource/goods-info.vue 0 → 100644
... ... @@ -0,0 +1,112 @@
  1 +<template>
  2 + <Page name="goods-info" flank>
  3 + <template #content>
  4 + <u-form :model="form" ref="uForm" labelWidth="100">
  5 + <view class="card">
  6 + <u-form-item label="货物名称" required @click="choseGoodsName">
  7 + <u-input v-model="form.goodsName" border="none" suffix-icon="arrow-right" placeholder="请选择" disabledColor="#ffffff" disabled />
  8 + </u-form-item>
  9 + <u-form-item label="发货单位" :required="ningXiaYouZhengFlag">
  10 + <u-input v-model="form.dispatchUnit" border="none" placeholder="请输入" />
  11 + </u-form-item>
  12 + <u-form-item label="合同号" :required="ningXiaYouZhengFlag">
  13 + <u-input v-model="form.customerContractNo" border="none" placeholder="请输入" />
  14 + </u-form-item>
  15 + <u-form-item label="运输班次号" :required="ningXiaYouZhengFlag">
  16 + <u-input v-model="form.transportShiftNo" border="none" placeholder="请输入" />
  17 + </u-form-item>
  18 + </view>
  19 + </u-form>
  20 + </template>
  21 + <template #footer>
  22 + <u-button type="primary" @click="onSubmit">确定</u-button>
  23 + </template>
  24 + </Page>
  25 +</template>
  26 +<script>
  27 +import { urlParam } from '@/utils/param';
  28 +
  29 +export default {
  30 + name: 'goods-info',
  31 + data() {
  32 + return {
  33 + ningXiaYouZhengFlag: false,
  34 + projectCode: '',
  35 + form: {
  36 + goodsName: '',
  37 + dispatchUnit: '',
  38 + customerContractNo: '',
  39 + transportShiftNo: '',
  40 + },
  41 + };
  42 + },
  43 + onLoad(option) {
  44 + const eventChannel = this.getOpenerEventChannel();
  45 + eventChannel.on('data', data => {
  46 + this.ningXiaYouZhengFlag = data.ningXiaYouZhengFlag || false;
  47 + this.setHisData(data.form);
  48 + this.projectCode = data.form.projectCode || '';
  49 + });
  50 + },
  51 +
  52 + methods: {
  53 + setHisData(v) {
  54 + Object.keys(this.form).forEach(k => {
  55 + this.form[k] = v[k] || '';
  56 + });
  57 + },
  58 + choseGoodsName() {
  59 + uni.$off('select-common');
  60 + uni.$once('select-common', option => {
  61 + this.form.goodsName = option.name;
  62 + });
  63 + uni.navigateTo({
  64 + url: `/pages/global/search-common${urlParam({
  65 + mode: 'select',
  66 + url: 'goodsName',
  67 + title: '货物名称',
  68 + label: 'name',
  69 + value: '',
  70 + params: `{"projectCode":"${this.projectCode}"}`,
  71 + })}`,
  72 + });
  73 + },
  74 + onSubmit() {
  75 + if (this.ningXiaYouZhengFlag) {
  76 + if (!this.form.dispatchUnit) {
  77 + return uni.showToast({ title: '发货单位不能为空', icon: 'none' });
  78 + }
  79 + if (!this.form.customerContractNo) {
  80 + return uni.showToast({ title: '合同号不能为空', icon: 'none' });
  81 + }
  82 + if (!this.form.transportShiftNo) {
  83 + return uni.showToast({ title: '运输班次号不能为空', icon: 'none' });
  84 + }
  85 + }
  86 + this.getOpenerEventChannel().emit('submitData', this.form);
  87 + // setTimeout(() => uni.navigateBack(), 500);
  88 + },
  89 + },
  90 +};
  91 +</script>
  92 +
  93 +<style lang="scss">
  94 +.page-goods-info {
  95 + &__footer {
  96 + background: $color-white;
  97 + }
  98 + .card {
  99 + color: #999999;
  100 + background-color: $color-white;
  101 + border-radius: $radius-md;
  102 + box-shadow: $shadow-normal;
  103 + .u-form-item {
  104 + padding-left: $padding-md !important;
  105 + padding-right: $padding-sm !important;
  106 + }
  107 + .u-form-item + .u-form-item {
  108 + border-top: 1px solid #f6f6f6;
  109 + }
  110 + }
  111 +}
  112 +</style>
... ...
pages/me/index.vue
... ... @@ -79,9 +79,7 @@
79 79 </template>
80 80  
81 81 <script>
82   -import cache from '@/utils/cache';
83 82 import { mapState, mapGetters } from 'vuex';
84   -import { version } from '@/config';
85 83 import page from '@/mixins/page';
86 84  
87 85 export default {
... ... @@ -89,15 +87,17 @@ export default {
89 87 data() {
90 88 return {
91 89 loading: false,
  90 + version: '',
92 91 versionInfo: uni.getSystemInfoSync(),
93 92 };
94 93 },
  94 + onLoad() {
  95 + const accountInfo = wx.getAccountInfoSync();
  96 + this.version = accountInfo.miniProgram?.version;
  97 + },
95 98 computed: {
96 99 ...mapState(['authed']),
97 100 ...mapGetters(['userInfo', 'freightInfo']),
98   - version() {
99   - return version;
100   - },
101 101 },
102 102 methods: {
103 103 mobileFilter(value = '') {
... ...
pages/order/add.vue
... ... @@ -25,7 +25,7 @@
25 25 <u-input v-model="form.waypoints[1].address" border="none" suffix-icon="arrow-right" placeholder="请选择" disabledColor="#ffffff" disabled />
26 26 </u-form-item>
27 27 <u-form-item label="货物信息" required @click="selectGoodsInfo">
28   - <u-input v-model="form.goodsInfo" border="none" suffix-icon="arrow-right" placeholder="请输入" disabledColor="#ffffff" disabled />
  28 + <u-input :value="goodsInfo" border="none" suffix-icon="arrow-right" placeholder="请输入" disabledColor="#ffffff" disabled />
29 29 </u-form-item>
30 30 </view>
31 31 <!-- <view class="card">-->
... ... @@ -241,7 +241,6 @@ export default {
241 241 loadTime: '',
242 242 projectName: '',
243 243 customerOrderCode: '',
244   - goodsInfo: '',
245 244 goodsName: '',
246 245 goodsValue: '',
247 246 goodsPiece: '',
... ... @@ -269,6 +268,9 @@ export default {
269 268 receiveInsuranceAmount: '',
270 269 insuranceProgramCode: '',
271 270 coverageLimit: '',
  271 + dispatchUnit: '',
  272 + customerContractNo: '',
  273 + transportShiftNo: '',
272 274 },
273 275 payeeModel: {},
274 276 driverObj: {}, //司机信息
... ... @@ -289,6 +291,22 @@ export default {
289 291 // 自动计算货到
290 292 return 'OUT_INVITE_ARRIVAL' === this.currentFreight?.autoComputeFeeType;
291 293 },
  294 + goodsInfo() {
  295 + let infoList = [];
  296 + if (this.form.goodsName) {
  297 + infoList.push(this.form.goodsName);
  298 + }
  299 + if (this.form.goodsPiece) {
  300 + infoList.push(this.form.goodsPiece + '件');
  301 + }
  302 + if (this.form.goodsWeight) {
  303 + infoList.push(this.form.goodsWeight + '吨');
  304 + }
  305 + if (this.form.goodsVolume) {
  306 + infoList.push(this.form.goodsVolume + '方');
  307 + }
  308 + return infoList.join(',');
  309 + },
292 310 // 获取价值
293 311 showGoodsValue() {
294 312 return this.currentFreight ? this.currentFreight.driverSecurityServiceFlag || this.currentFreight.securityServiceFlag : false;
... ... @@ -355,7 +373,17 @@ export default {
355 373 },
356 374 ],
357 375 };
358   - this.setFormValue(detail, ['priceType', 'weightUnitPrice', 'goodsSourceCode', 'goodsSourceBiddingCode', 'loadTime', 'paidAmount']);
  376 + this.setFormValue(detail, [
  377 + 'priceType',
  378 + 'weightUnitPrice',
  379 + 'goodsSourceCode',
  380 + 'goodsSourceBiddingCode',
  381 + 'loadTime',
  382 + 'paidAmount',
  383 + 'dispatchUnit',
  384 + 'customerContractNo',
  385 + 'transportShiftNo',
  386 + ]);
359 387 this.getAllowDriverSeeFreightAmount();
360 388 this.clipboard(`手机号:${detail.driverMobile || ''}车牌:${detail.vehicleLicenseNum || ''}车挂:${detail.trailerLicenseNum || ''}`);
361 389 this.computedService();
... ... @@ -488,20 +516,7 @@ export default {
488 516 };
489 517 this.computedPaid();
490 518 this.computedService();
491   - let goodsInfo = [];
492   - if (this.form.goodsName) {
493   - goodsInfo.push(this.form.goodsName);
494   - }
495   - if (this.form.goodsPiece) {
496   - goodsInfo.push(this.form.goodsPiece + '件');
497   - }
498   - if (this.form.goodsWeight) {
499   - goodsInfo.push(this.form.goodsWeight + '吨');
500   - }
501   - if (this.form.goodsVolume) {
502   - goodsInfo.push(this.form.goodsVolume + '方');
503   - }
504   - this.form.goodsInfo = goodsInfo.join(',');
  519 +
505 520 uni.navigateBack();
506 521 },
507 522 },
... ...