Prechádzať zdrojové kódy

修改导入数据后自动弹窗显示确认页面

gongwencan 5 mesiacov pred
rodič
commit
fb50bab68d

+ 6 - 0
src/api/TagApplyApi.js

@@ -39,6 +39,12 @@ class TagApplyApi extends BaseCurdApi {
     data: data
   })
 
+  updateConfirmOrder = (data) => this.api({
+    url: `${this.basePath}/update/confirm/order`,
+    method: 'POST',
+    data: data
+  })
+
   constructor () {
     super('/tag/apply')
   }

+ 3 - 3
src/components/DialogImport.vue

@@ -96,8 +96,8 @@ export default {
           return
         }
 
-        this.$$request(this.api, this.uploadData).then((flag) => {
-          if (flag) {
+        this.$$request(this.api, this.uploadData).then((data) => {
+          if (data) {
             this.$notify({
               title: '成功',
               message: '上传成功',
@@ -106,7 +106,7 @@ export default {
             })
 
             this.close()
-            this.$emit('imported')
+            this.$emit('imported', data)
           }
         }).catch(console.error).finally(() => {})
       })

+ 35 - 3
src/components/DialogTagApplyDetail.vue

@@ -130,8 +130,14 @@
           <el-button
             @click="onCloseBtnClick"
           >取消</el-button>
+          <el-button
+            v-if="oData && oData.tagApplyStateId === '0'"
+            type="primary"
+            @click="onConfirmOrderBtnClick"
+          >确认订单</el-button>
 
           <el-button
+            v-else
             type="primary"
             @click="onOkBtnClick"
           >确定</el-button>
@@ -201,9 +207,31 @@ export default {
       this.close()
     },
     onOkBtnClick () {
-      this.$$request(this.api, this.oData).then(() => {
-        this.close()
-        this.$emit('saved')
+      this.$$request(this.api, this.oData).then((flag) => {
+        if (flag) {
+          this.$notify({
+            title: '成功',
+            message: '操作成功',
+            type: 'success',
+            position: 'bottom-right'
+          })
+          this.close()
+          this.$emit('saved')
+        }
+      }).catch(console.error).finally(() => {})
+    },
+    onConfirmOrderBtnClick () {
+      this.$$request(this.$$api.updateConfirmOrder, this.oData).then((flag) => {
+        if (flag) {
+          this.$notify({
+            title: '成功',
+            message: '操作成功',
+            type: 'success',
+            position: 'bottom-right'
+          })
+          this.close()
+          this.$emit('saved')
+        }
       }).catch(console.error).finally(() => {})
     },
     handleInput (value) {
@@ -211,6 +239,10 @@ export default {
       sanitizedValue = sanitizedValue.replace(/^0+/, '')
       this.selectedData.number = sanitizedValue === '' ? '' : sanitizedValue
       this.selectedData.amount = sanitizedValue === '' ? 0 : (sanitizedValue * this.selectedData.unitPrice).toFixed(2)
+    },
+    // 重写方法否则接口会调用2次
+    setOptionGroup () {
+
     }
   }
 }

+ 3 - 5
src/components/DialogTagApplyTemplateExport.vue

@@ -10,15 +10,14 @@
       :model="downloadData"
       label-width="80px"
     >
-      <el-collapse v-model="activeCollapseName" class="form-collapse">
-        <el-collapse-item title="模版信息" name="1" class="form-collapse-item">
+    <div class="overflow-auto">
           <el-row :gutter="0">
             <el-col :span="24">
               <el-form-item prop="providerId" label="供应商" :rules="[{
                 required: true,
                 message: '请选择供应商'
               }]">
-                <div style="padding-right:70px">
+                <div style="padding-right:10px">
                   <my-select
                     v-model="downloadData.providerId"
                     :options="providers"
@@ -29,8 +28,7 @@
               </el-form-item>
             </el-col>
           </el-row>
-        </el-collapse-item>
-      </el-collapse>
+     </div>
     </el-form>
 
     <template #footer>

+ 22 - 17
src/components/DialogTagCodeSerialDetail.vue

@@ -41,7 +41,7 @@
             label="流水号范围"
             prop="formatSerialNumberRange"
             header-align="center"
-            min-width="150"
+            min-width="180"
             align="center"
           ></el-table-column>
           <el-table-column
@@ -76,21 +76,21 @@
             label="数量"
             prop="number"
             header-align="center"
-            min-width="80"
+            min-width="70"
             align="center"
           ></el-table-column>
           <el-table-column
             label="单价(元)"
             prop="unitPrice"
             header-align="center"
-            min-width="80"
+            min-width="70"
             align="right"
           ></el-table-column>
           <el-table-column
             label="费用(元)"
             prop="amount"
             header-align="center"
-            min-width="80"
+            min-width="70"
             align="right"
           ></el-table-column>
         </el-table>
@@ -100,39 +100,44 @@
 </template>
 
 <script>
-// import BaseCurdList from '@@/utils/BaseCurdList'
+import BaseCurdList from '@@/utils/BaseCurdList'
 // import bindPrototype from '@@/utils/bindPrototype'
 
-// import TagSerial from '@@/entries/TagSerial'
+import TagCode from '@@/entries/TagCode'
 
 export default {
   name: 'DialogTagCodeSerialDetail',
-  // extends: BaseCurdList(TagSerial),
+  extends: BaseCurdList(TagCode),
   data: () => ({
     visible: false,
-    oData: null,
-    list: null
+    oData: null
   }),
   computed: {
     formattedList () {
-      return this.list.map(item => {
-        return {
-          ...item,
-          formattedSerialNumberRange: item.serialNumberRange ? item.serialNumberRange.join('-') : ''
-        }
-      })
+      if (this.oData && this.oData.details) {
+        return this.oData.details.map(item => {
+          return {
+            ...item,
+            formatSerialNumberRange: item.serialNumberRange ? item.serialNumberRange.join('-') : ''
+          }
+        })
+      } else {
+        return Object.freeze([])
+      }
     }
   },
   methods: {
     open (data) {
       this.oData = data
       this.visible = true
-      this.list = this.oData && this.oData.details ? this.oData.details : []
     },
     close () {
       this.oData = null
       this.visible = false
-      this.list = Object.freeze([])
+    },
+    // 重写方法否则接口会调用2次
+    setOptionGroup () {
+
     }
   }
 }

+ 3 - 3
src/components/DialogTagDistribute.vue

@@ -22,18 +22,18 @@
                 <my-select
                   v-model="data.deliveryMethodId"
                   :options="optionGroup.DeliveryType ? optionGroup.DeliveryType.list : []"
-                  :disabled="data.tagApplyStateId === '5'"
+                  :disabled="data.tagApplyStateId === '6'"
                 ></my-select>
             </el-form-item>
         </el-col>
         <el-col :span="12">
           <el-form-item label="发货单号" prop="deliveryOrderNo" :rules= "(data.deliveryMethodId === '1') ? []:[{required:true,message:'请输入发货单号'}]">
-            <el-input v-model="data.deliveryOrderNo" :disabled="(data.deliveryMethodId === '1') || (data.tagApplyStateId === '5')"/>
+            <el-input v-model="data.deliveryOrderNo" :disabled="(data.deliveryMethodId === '1') || (data.tagApplyStateId === '6')"/>
           </el-form-item>
         </el-col>
         </el-row>
       </el-form>
-      <template #footer v-if="data && data.tagApplyStateId === '4'">
+      <template #footer v-if="data && data.tagApplyStateId === '5'">
       <div class="flex center dialog-footer">
         <el-button @click="onCloseBtnClick">取消</el-button>
         <el-button type="primary" @click="onSaveBtnClick">确定</el-button>

+ 4 - 0
src/components/DialogTagDistributeDetail.vue

@@ -115,6 +115,10 @@ export default {
       this.oData = null
       this.visible = false
       this.list = Object.freeze([])
+    },
+    // 重写方法否则接口会调用2次
+    setOptionGroup () {
+
     }
   }
 }

+ 22 - 5
src/components/DialogTagPurchaseDetail.vue

@@ -113,7 +113,7 @@
       </template>
       <dialog-add-tag-purchase
       ref="addTagPurchaseDialog"
-      :optionGroup="optionGroup"
+      :optionGroup="optionGroup1"
       @saved="loadTag"
     ></dialog-add-tag-purchase>
     </el-dialog>
@@ -131,6 +131,11 @@ export default {
     api: {
       required: true,
       type: Function
+    },
+    // 为区分BaseCurdList里面optionGroup 而定义
+    optionGroup1: {
+      required: true,
+      type: Object
     }
   },
   data: () => ({
@@ -181,9 +186,17 @@ export default {
       this.close()
     },
     onOkBtnClick () {
-      this.$$request(this.api, this.oData).then(() => {
-        this.close()
-        this.$emit('saved')
+      this.$$request(this.api, this.oData).then((flag) => {
+        if (flag) {
+          this.$notify({
+            title: '成功',
+            message: '操作成功',
+            type: 'success',
+            position: 'bottom-right'
+          })
+          this.close()
+          this.$emit('saved')
+        }
       }).catch(console.error).finally(() => {})
     },
     handleInput (value) {
@@ -199,7 +212,7 @@ export default {
       if (data.number > 0) {
         const currentTag = this.list.filter(item => item.tagTypeId === data.tagTypeId)
         if (currentTag.length <= 0) {
-          const providerConfig = this.optionGroup.TagType
+          const providerConfig = this.optionGroup1.TagType
           const tag = providerConfig.list.find(item => item.id === data.tagTypeId)
           if (tag) {
             const amount = (data.number * tag.price).toFixed(2)
@@ -217,6 +230,10 @@ export default {
           }
         }
       }
+    },
+    // 重写方法否则接口会调用2次
+    setOptionGroup () {
+
     }
   }
 }

+ 0 - 1
src/views/MaterialDetail.vue

@@ -47,7 +47,6 @@
                         <my-select
                             v-model="query.smallCategoryId"
                             :options="middleCategories"
-                             @change="onSearchBtnClick"
                         >
                         <el-option label="全部" value=""></el-option>
                         </my-select>

+ 12 - 3
src/views/TagApply.vue

@@ -205,7 +205,7 @@
   <dialog-import
     ref="dialogImport"
     :api="$$api.importData"
-    @imported="onSaved"
+    @imported="onDataImported"
   ></dialog-import>
 
   <dialog-tag-apply-template-export
@@ -237,8 +237,11 @@ export default {
     onImportDataBtnClick () {
       this.$refs.dialogImport.open()
     },
-    onDataImported () {
-      this.loadList()
+    onDataImported (data) {
+      if (data) {
+        this.loadList()
+        this.$refs.tagApplyDetailDialog.open(data)
+      }
     },
     onExportOrderBtnClick () {
       this.$$request(TagApply.$$api.getDetail, this.selectedData, this)
@@ -299,6 +302,12 @@ export default {
         this.$$request(TagApply.$$api.delete, data, this)
           .then(flag => {
             if (flag) {
+              this.$notify({
+                title: '成功',
+                message: '操作成功',
+                type: 'success',
+                position: 'bottom-right'
+              })
               this.loadList()
             }
           }).catch(console.error).finally(() => {})

+ 2 - 2
src/views/TagDistribute.vue

@@ -125,7 +125,7 @@
                 <template v-slot="{ row }">
                   <div class="flex center layout-gap">
                     <edit-button :data="row" :on-click="onOpenDetailEditorBtnClick" icon="el-icon-tickets">详情</edit-button>
-                    <edit-button :data="row" :on-click="onTagDistributeBtnClick" icon="el-icon-share" :disabled="row.tagApplyStateId !== '4' && row.tagApplyStateId !== '5'">发放</edit-button>
+                    <edit-button :data="row" :on-click="onTagDistributeBtnClick" icon="el-icon-share" :disabled="row.tagApplyStateId !== '5' && row.tagApplyStateId !== '6'">发放</edit-button>
                   </div>
                 </template>
               </el-table-column>
@@ -160,7 +160,7 @@ export default {
   extends: BaseCurdList(TagDistribute),
   methods: {
     onTagDistributeBtnClick (data) {
-      this.onOpenEditorBtnClick(data, data.tagApplyStateId === '5')
+      this.onOpenEditorBtnClick(data, data.tagApplyStateId === '6')
     },
     onOpenDetailEditorBtnClick (data) {
       this.$$request(TagDistribute.$$api.getDetail, data, this)

+ 1 - 0
src/views/TagPurchase.vue

@@ -176,6 +176,7 @@
     <dialog-tag-purchase-order-export ref="orderExportDialog"></dialog-tag-purchase-order-export>
     <dialog-tag-purchase-detail
       ref="tagPurchaseDetailDialog"
+      :optionGroup1="optionGroup"
       :api="$$api.update"
       @saved="loadList"
     ></dialog-tag-purchase-detail>