Showing
3 changed files
with
18 additions
and
14 deletions
| @@ -141,7 +141,6 @@ | @@ -141,7 +141,6 @@ | ||
| 141 | <text class="label">总数量</text><text class="value">{{ form.totalQuantity }}</text> | 141 | <text class="label">总数量</text><text class="value">{{ form.totalQuantity }}</text> |
| 142 | </view> | 142 | </view> |
| 143 | </view> | 143 | </view> |
| 144 | - <button class="btn submit" type="primary" @click="onSubmit">提交</button> | ||
| 145 | </view> | 144 | </view> |
| 146 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" | 145 | <SingleSelectSheet :visible.sync="sheet.visible" :title="sheet.title" :options="sheet.options" v-model="sheet.value" |
| 147 | @confirm="onSheetConfirm" /> | 146 | @confirm="onSheetConfirm" /> |
| @@ -158,9 +157,9 @@ import { getDicByCodes } from '@/utils/dic' | @@ -158,9 +157,9 @@ import { getDicByCodes } from '@/utils/dic' | ||
| 158 | export default { | 157 | export default { |
| 159 | name: 'OrderListModify', | 158 | name: 'OrderListModify', |
| 160 | components: { Product, SingleSelectSheet }, | 159 | components: { Product, SingleSelectSheet }, |
| 160 | + props: { id: { type: [String, Number], default: '' } }, | ||
| 161 | data() { | 161 | data() { |
| 162 | return { | 162 | return { |
| 163 | - id: '', | ||
| 164 | form: { | 163 | form: { |
| 165 | code: '', | 164 | code: '', |
| 166 | supplier: '', | 165 | supplier: '', |
| @@ -193,24 +192,30 @@ export default { | @@ -193,24 +192,30 @@ export default { | ||
| 193 | packaging: '', | 192 | packaging: '', |
| 194 | }, | 193 | }, |
| 195 | initPurchaseOrderLineList: [], | 194 | initPurchaseOrderLineList: [], |
| 196 | - dicOptions: { SUPPLIER: [], APPLICABLE_STANDARD: [], AUDIT_STATUS: [] }, | 195 | + dicOptions: { SUPPLIER: [], APPLICABLE_STANDARD: [] }, |
| 197 | sheet: { visible: false, title: '请选择', options: [], value: '', field: '' } | 196 | sheet: { visible: false, title: '请选择', options: [], value: '', field: '' } |
| 198 | } | 197 | } |
| 199 | }, | 198 | }, |
| 200 | - onLoad(query) { | ||
| 201 | - this.id = (query && (query.id || query.code)) || '' | ||
| 202 | - if (this.id) this.loadDetail(this.id) | ||
| 203 | - this.loadDicOptions() | 199 | + watch: { |
| 200 | + id: { | ||
| 201 | + immediate: true, | ||
| 202 | + handler(val) { | ||
| 203 | + const v = (val !== undefined && val !== null) ? String(val) : '' | ||
| 204 | + if (v) this.loadDetail(v) | ||
| 205 | + } | ||
| 206 | + } | ||
| 207 | + }, | ||
| 208 | + created() { | ||
| 209 | + this.loadAllDicData() | ||
| 204 | }, | 210 | }, |
| 205 | methods: { | 211 | methods: { |
| 206 | loadDicOptions() { | 212 | loadDicOptions() { |
| 207 | - const dicCodes = ['SUPPLIER', 'APPLICABLE_STANDARD', 'AUDIT_STATUS'] | 213 | + const dicCodes = ['SUPPLIER', 'APPLICABLE_STANDARD'] |
| 208 | return getDicByCodes(dicCodes).then(results => { | 214 | return getDicByCodes(dicCodes).then(results => { |
| 209 | this.dicOptions.SUPPLIER = results.SUPPLIER && results.SUPPLIER.data ? results.SUPPLIER.data : [] | 215 | this.dicOptions.SUPPLIER = results.SUPPLIER && results.SUPPLIER.data ? results.SUPPLIER.data : [] |
| 210 | this.dicOptions.APPLICABLE_STANDARD = results.APPLICABLE_STANDARD && results.APPLICABLE_STANDARD.data ? results.APPLICABLE_STANDARD.data : [] | 216 | this.dicOptions.APPLICABLE_STANDARD = results.APPLICABLE_STANDARD && results.APPLICABLE_STANDARD.data ? results.APPLICABLE_STANDARD.data : [] |
| 211 | - this.dicOptions.AUDIT_STATUS = results.AUDIT_STATUS && results.AUDIT_STATUS.data ? results.AUDIT_STATUS.data : [] | ||
| 212 | this.refreshStandardName() | 217 | this.refreshStandardName() |
| 213 | - }).catch(() => { this.dicOptions = { SUPPLIER: [], APPLICABLE_STANDARD: [], AUDIT_STATUS: [] } }) | 218 | + }).catch(() => { this.dicOptions = { SUPPLIER: [], APPLICABLE_STANDARD: [] } }) |
| 214 | }, | 219 | }, |
| 215 | async loadDetail(id) { | 220 | async loadDetail(id) { |
| 216 | try { | 221 | try { |
| @@ -275,7 +280,7 @@ export default { | @@ -275,7 +280,7 @@ export default { | ||
| 275 | 280 | ||
| 276 | .scroll { | 281 | .scroll { |
| 277 | flex: 1; | 282 | flex: 1; |
| 278 | - padding: 6rpx 0 310rpx; | 283 | + padding: 0 0 350rpx; |
| 279 | } | 284 | } |
| 280 | 285 | ||
| 281 | 286 | ||
| @@ -460,7 +465,7 @@ export default { | @@ -460,7 +465,7 @@ export default { | ||
| 460 | position: fixed; | 465 | position: fixed; |
| 461 | left: 0; | 466 | left: 0; |
| 462 | right: 0; | 467 | right: 0; |
| 463 | - bottom: 0; | 468 | + bottom: 120rpx; |
| 464 | padding: 0 32rpx 32rpx; | 469 | padding: 0 32rpx 32rpx; |
| 465 | padding-bottom: calc(32rpx + env(safe-area-inset-bottom)); | 470 | padding-bottom: calc(32rpx + env(safe-area-inset-bottom)); |
| 466 | background: #fff; | 471 | background: #fff; |