Commit 94b6f0ed214ce4cb9b84fcd0a62a13a19f7edb46

Authored by 史婷婷
1 parent aa0076c0

feat: 变更单-新增完成

Showing 1 changed file with 15 additions and 1 deletions
... ... @@ -308,11 +308,25 @@ export default {
308 308 }
309 309 },
310 310 getDicName: getDicName,
  311 + validateRequired() {
  312 + const checks = [
  313 + { key: 'orderNo', label: '订单编号' }
  314 + ]
  315 + for (const it of checks) {
  316 + const val = this.form[it.key]
  317 + if (val === undefined || val === null || String(val).trim() === '') {
  318 + uni.showToast({ title: `请先选择${it.label}`, icon: 'none' })
  319 + return false
  320 + }
  321 + }
  322 + return true
  323 + },
311 324 async onSubmit() {
  325 + if (!this.validateRequired()) return
312 326 const payload = { ...this.form }
313   - console.log('onSubmit__payload', payload)
314 327 payload.orderSpecList = payload.purchaseOrderLineList || [];
315 328 delete payload.purchaseOrderLineList;
  329 + console.log('onSubmit__payload', payload)
316 330 try {
317 331 await createApi(payload)
318 332 uni.showToast({ title: '保存成功', icon: 'success' })
... ...