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 | 16 | </uni-list-item> |
| 17 | 17 | <uni-list-item title="订货单位"> |
| 18 | 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 | 21 | </template> |
| 21 | 22 | </uni-list-item> |
| 22 | 23 | <uni-list-item title="订货日期"> |
| ... | ... | @@ -164,6 +165,7 @@ export default { |
| 164 | 165 | components: { Product, SingleSelectSheet, RelateSelectSheet }, |
| 165 | 166 | data() { |
| 166 | 167 | return { |
| 168 | + orderingUnitEditable: false, | |
| 167 | 169 | form: { |
| 168 | 170 | orderNo: '', |
| 169 | 171 | orderId: '', |
| ... | ... | @@ -283,12 +285,14 @@ export default { |
| 283 | 285 | const _fieldKey = this.relate.fieldKey |
| 284 | 286 | const first = (items && items.length > 0) ? items[0] : null |
| 285 | 287 | if (_fieldKey === 'orderNo') { |
| 288 | + this.orderingUnitEditable = false | |
| 286 | 289 | const id = first && (first.id || first.code) |
| 287 | 290 | if (id) { |
| 288 | 291 | try { |
| 289 | 292 | const res = await loadOrderApi([id]) |
| 290 | 293 | const data = res && res.data ? res.data : null |
| 291 | 294 | const item = Array.isArray(data) ? (data[0] || {}) : (data || {}) |
| 295 | + this.orderingUnitEditable = String(item.status || '') === 'ISSUED' | |
| 292 | 296 | const next = { ...this.form, ...item } |
| 293 | 297 | next.orderNo = next.orderNo || ((first && (first.orderNo || first.code)) || ''); |
| 294 | 298 | next.orderId = next.id || ''; | ... | ... |
| ... | ... | @@ -15,7 +15,8 @@ |
| 15 | 15 | </uni-list-item> |
| 16 | 16 | <uni-list-item title="订货单位"> |
| 17 | 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 | 20 | </template> |
| 20 | 21 | </uni-list-item> |
| 21 | 22 | <uni-list-item title="订货日期"> |
| ... | ... | @@ -148,7 +149,7 @@ |
| 148 | 149 | </template> |
| 149 | 150 | |
| 150 | 151 | <script> |
| 151 | -import { getDetailApi, updateApi } from '@/api/change_list.js' | |
| 152 | +import { getDetailApi, loadOrderApi, updateApi } from '@/api/change_list.js' | |
| 152 | 153 | import Product from './product.vue' |
| 153 | 154 | import SingleSelectSheet from '@/components/single-select/index.vue' |
| 154 | 155 | import { getDicName } from '@/utils/dic.js' |
| ... | ... | @@ -160,6 +161,7 @@ export default { |
| 160 | 161 | data() { |
| 161 | 162 | return { |
| 162 | 163 | id: '', |
| 164 | + orderingUnitEditable: false, | |
| 163 | 165 | form: { |
| 164 | 166 | orderId: '', |
| 165 | 167 | purchaseOrderId: '', |
| ... | ... | @@ -219,6 +221,19 @@ export default { |
| 219 | 221 | })) : [] |
| 220 | 222 | this.form = next; |
| 221 | 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 | 237 | this.refreshStandardName() |
| 223 | 238 | } catch (e) { |
| 224 | 239 | uni.showToast({ title: '加载失败', icon: 'none' }) | ... | ... |
| ... | ... | @@ -314,7 +314,7 @@ export default { |
| 314 | 314 | return [ |
| 315 | 315 | { ...this.buttons[0], visible: (s === 'DRAFT' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:modify')) }, //编辑 |
| 316 | 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 | 318 | { ...this.buttons[3], visible: ((s === 'DRAFT' || s === 'FORMAL') && t !== 'AUDIT' && t !== 'PASS' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:upload')) }, |
| 319 | 319 | { ...this.buttons[4], visible: (s === 'STANDARD' && t !== 'AUDIT' && t !== 'PASS' && this.$auth.hasPermi('contract-manage:foreign-trade-inventory-contract:upload')) }, |
| 320 | 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 | 305 | return [ |
| 306 | 306 | { ...this.buttons[0], visible: (s === 'DRAFT' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:modify')) }, |
| 307 | 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 | 309 | { ...this.buttons[3], visible: ((s === 'DRAFT' || s === 'FORMAL') && t !== 'AUDIT' && t !== 'PASS' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:upload')) }, |
| 310 | 310 | { ...this.buttons[4], visible: (s === 'STANDARD' && t !== 'AUDIT' && t !== 'PASS' && this.$auth.hasPermi('contract-manage:distribution-inventory-contract:upload')) }, |
| 311 | 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 | 141 | </uni-list-item> |
| 142 | 142 | <uni-list-item title="备注"> |
| 143 | 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 | 145 | </template> |
| 146 | 146 | </uni-list-item> |
| 147 | 147 | <view class="footer"> | ... | ... |