Commit b22973328e7094190aaea219df8b71f0a1492c6f
Merge branch 'cjerp-contract-1.0' into publish_cjerp
Showing
5 changed files
with
25 additions
and
6 deletions
| @@ -16,7 +16,8 @@ | @@ -16,7 +16,8 @@ | ||
| 16 | </uni-list-item> | 16 | </uni-list-item> |
| 17 | <uni-list-item title="订货单位"> | 17 | <uni-list-item title="订货单位"> |
| 18 | <template v-slot:footer> | 18 | <template v-slot:footer> |
| 19 | - <view class="readonly-text">{{ form.orderingUnitName }}</view> | 19 | + <uni-easyinput v-if="orderingUnitEditable" v-model="form.orderingUnitName" placeholder="请输入订货单位" :inputBorder="false" /> |
| 20 | + <view v-else class="readonly-text">{{ form.orderingUnitName }}</view> | ||
| 20 | </template> | 21 | </template> |
| 21 | </uni-list-item> | 22 | </uni-list-item> |
| 22 | <uni-list-item title="订货日期"> | 23 | <uni-list-item title="订货日期"> |
| @@ -164,6 +165,7 @@ export default { | @@ -164,6 +165,7 @@ export default { | ||
| 164 | components: { Product, SingleSelectSheet, RelateSelectSheet }, | 165 | components: { Product, SingleSelectSheet, RelateSelectSheet }, |
| 165 | data() { | 166 | data() { |
| 166 | return { | 167 | return { |
| 168 | + orderingUnitEditable: false, | ||
| 167 | form: { | 169 | form: { |
| 168 | orderNo: '', | 170 | orderNo: '', |
| 169 | orderId: '', | 171 | orderId: '', |
| @@ -283,12 +285,14 @@ export default { | @@ -283,12 +285,14 @@ export default { | ||
| 283 | const _fieldKey = this.relate.fieldKey | 285 | const _fieldKey = this.relate.fieldKey |
| 284 | const first = (items && items.length > 0) ? items[0] : null | 286 | const first = (items && items.length > 0) ? items[0] : null |
| 285 | if (_fieldKey === 'orderNo') { | 287 | if (_fieldKey === 'orderNo') { |
| 288 | + this.orderingUnitEditable = false | ||
| 286 | const id = first && (first.id || first.code) | 289 | const id = first && (first.id || first.code) |
| 287 | if (id) { | 290 | if (id) { |
| 288 | try { | 291 | try { |
| 289 | const res = await loadOrderApi([id]) | 292 | const res = await loadOrderApi([id]) |
| 290 | const data = res && res.data ? res.data : null | 293 | const data = res && res.data ? res.data : null |
| 291 | const item = Array.isArray(data) ? (data[0] || {}) : (data || {}) | 294 | const item = Array.isArray(data) ? (data[0] || {}) : (data || {}) |
| 295 | + this.orderingUnitEditable = String(item.status || '') === 'ISSUED' | ||
| 292 | const next = { ...this.form, ...item } | 296 | const next = { ...this.form, ...item } |
| 293 | next.orderNo = next.orderNo || ((first && (first.orderNo || first.code)) || ''); | 297 | next.orderNo = next.orderNo || ((first && (first.orderNo || first.code)) || ''); |
| 294 | next.orderId = next.id || ''; | 298 | next.orderId = next.id || ''; |
| @@ -15,7 +15,8 @@ | @@ -15,7 +15,8 @@ | ||
| 15 | </uni-list-item> | 15 | </uni-list-item> |
| 16 | <uni-list-item title="订货单位"> | 16 | <uni-list-item title="订货单位"> |
| 17 | <template v-slot:footer> | 17 | <template v-slot:footer> |
| 18 | - <view class="readonly-text">{{ form.orderingUnitName }}</view> | 18 | + <uni-easyinput v-if="orderingUnitEditable" v-model="form.orderingUnitName" placeholder="请输入订货单位" :inputBorder="false" /> |
| 19 | + <view v-else class="readonly-text">{{ form.orderingUnitName }}</view> | ||
| 19 | </template> | 20 | </template> |
| 20 | </uni-list-item> | 21 | </uni-list-item> |
| 21 | <uni-list-item title="订货日期"> | 22 | <uni-list-item title="订货日期"> |
| @@ -148,7 +149,7 @@ | @@ -148,7 +149,7 @@ | ||
| 148 | </template> | 149 | </template> |
| 149 | 150 | ||
| 150 | <script> | 151 | <script> |
| 151 | -import { getDetailApi, updateApi } from '@/api/change_list.js' | 152 | +import { getDetailApi, loadOrderApi, updateApi } from '@/api/change_list.js' |
| 152 | import Product from './product.vue' | 153 | import Product from './product.vue' |
| 153 | import SingleSelectSheet from '@/components/single-select/index.vue' | 154 | import SingleSelectSheet from '@/components/single-select/index.vue' |
| 154 | import { getDicName } from '@/utils/dic.js' | 155 | import { getDicName } from '@/utils/dic.js' |
| @@ -160,6 +161,7 @@ export default { | @@ -160,6 +161,7 @@ export default { | ||
| 160 | data() { | 161 | data() { |
| 161 | return { | 162 | return { |
| 162 | id: '', | 163 | id: '', |
| 164 | + orderingUnitEditable: false, | ||
| 163 | form: { | 165 | form: { |
| 164 | orderId: '', | 166 | orderId: '', |
| 165 | purchaseOrderId: '', | 167 | purchaseOrderId: '', |
| @@ -219,6 +221,19 @@ export default { | @@ -219,6 +221,19 @@ export default { | ||
| 219 | })) : [] | 221 | })) : [] |
| 220 | this.form = next; | 222 | this.form = next; |
| 221 | this.initPurchaseOrderLineList = next.purchaseOrderLineList || []; | 223 | this.initPurchaseOrderLineList = next.purchaseOrderLineList || []; |
| 224 | + const oid = next.purchaseOrderId || next.orderId || '' | ||
| 225 | + if (oid) { | ||
| 226 | + try { | ||
| 227 | + const r = await loadOrderApi([oid]) | ||
| 228 | + const data = r && r.data ? r.data : null | ||
| 229 | + const item = Array.isArray(data) ? (data[0] || {}) : (data || {}) | ||
| 230 | + this.orderingUnitEditable = String(item.status || '') === 'ISSUED' | ||
| 231 | + } catch (e) { | ||
| 232 | + this.orderingUnitEditable = false | ||
| 233 | + } | ||
| 234 | + } else { | ||
| 235 | + this.orderingUnitEditable = false | ||
| 236 | + } | ||
| 222 | this.refreshStandardName() | 237 | this.refreshStandardName() |
| 223 | } catch (e) { | 238 | } catch (e) { |
| 224 | uni.showToast({ title: '加载失败', icon: 'none' }) | 239 | uni.showToast({ title: '加载失败', icon: 'none' }) |
| @@ -314,7 +314,7 @@ export default { | @@ -314,7 +314,7 @@ export default { | ||
| 314 | return [ | 314 | return [ |
| 315 | { ...this.buttons[0], visible: (s === 'DRAFT' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:modify')) }, //编辑 | 315 | { ...this.buttons[0], visible: (s === 'DRAFT' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:modify')) }, //编辑 |
| 316 | { ...this.buttons[1], visible: (s === 'DRAFT' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:delete')) }, //删除 | 316 | { ...this.buttons[1], visible: (s === 'DRAFT' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:delete')) }, //删除 |
| 317 | - { ...this.buttons[2], visible: (s === 'FORMAL' && !l && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:lock')) }, //锁价 | 317 | + { ...this.buttons[2], visible: (s === 'FORMAL' && this.detail.canPriceLock && !l && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:lock')) }, //锁价 |
| 318 | { ...this.buttons[3], visible: ((s === 'DRAFT' || s === 'FORMAL') && t !== 'AUDIT' && t !== 'PASS' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:upload')) }, | 318 | { ...this.buttons[3], visible: ((s === 'DRAFT' || s === 'FORMAL') && t !== 'AUDIT' && t !== 'PASS' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:upload')) }, |
| 319 | { ...this.buttons[4], visible: (s === 'STANDARD' && t !== 'AUDIT' && t !== 'PASS' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:upload')) }, | 319 | { ...this.buttons[4], visible: (s === 'STANDARD' && t !== 'AUDIT' && t !== 'PASS' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:upload')) }, |
| 320 | { ...this.buttons[5], visible: (s === 'STANDARD' && a !== 'AUDIT' && a !== 'PASS' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:standard-upload')) }, | 320 | { ...this.buttons[5], visible: (s === 'STANDARD' && a !== 'AUDIT' && a !== 'PASS' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:standard-upload')) }, |
| @@ -305,7 +305,7 @@ export default { | @@ -305,7 +305,7 @@ export default { | ||
| 305 | return [ | 305 | return [ |
| 306 | { ...this.buttons[0], visible: (s === 'DRAFT' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:modify')) }, | 306 | { ...this.buttons[0], visible: (s === 'DRAFT' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:modify')) }, |
| 307 | { ...this.buttons[1], visible: (s === 'DRAFT' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:delete')) }, | 307 | { ...this.buttons[1], visible: (s === 'DRAFT' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:delete')) }, |
| 308 | - { ...this.buttons[2], visible: (s === 'FORMAL' && !l && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:lock')) }, | 308 | + { ...this.buttons[2], visible: (s === 'FORMAL' && this.detail.canPriceLock && !l && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:lock')) }, |
| 309 | { ...this.buttons[3], visible: ((s === 'DRAFT' || s === 'FORMAL') && t !== 'AUDIT' && t !== 'PASS' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:upload')) }, | 309 | { ...this.buttons[3], visible: ((s === 'DRAFT' || s === 'FORMAL') && t !== 'AUDIT' && t !== 'PASS' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:upload')) }, |
| 310 | { ...this.buttons[4], visible: (s === 'STANDARD' && t !== 'AUDIT' && t !== 'PASS' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:upload')) }, | 310 | { ...this.buttons[4], visible: (s === 'STANDARD' && t !== 'AUDIT' && t !== 'PASS' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:upload')) }, |
| 311 | { ...this.buttons[5], visible: (s === 'STANDARD' && a !== 'AUDIT' && a !== 'PASS' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:standard-upload')) }, | 311 | { ...this.buttons[5], visible: (s === 'STANDARD' && a !== 'AUDIT' && a !== 'PASS' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:standard-upload')) }, |
| @@ -141,7 +141,7 @@ | @@ -141,7 +141,7 @@ | ||
| 141 | </uni-list-item> | 141 | </uni-list-item> |
| 142 | <uni-list-item title="备注"> | 142 | <uni-list-item title="备注"> |
| 143 | <template v-slot:footer> | 143 | <template v-slot:footer> |
| 144 | - <view class="readonly-text">{{ form.remarks }}</view> | 144 | + <uni-easyinput type="textarea" v-model="form.remarks" placeholder="请输入备注" :inputBorder="false" /> |
| 145 | </template> | 145 | </template> |
| 146 | </uni-list-item> | 146 | </uni-list-item> |
| 147 | <view class="footer"> | 147 | <view class="footer"> |