|
...
|
...
|
@@ -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' })
|
...
|
...
|
|