Parcourir la source

删除一些下拉框的change事件

gongwencan il y a 4 mois
Parent
commit
7619957a38

+ 3 - 5
src/components/DialogImport.vue

@@ -10,9 +10,8 @@
       :model="uploadData"
       label-width="80px"
     >
-      <el-collapse v-model="activeCollapseName" class="form-collapse">
-        <el-collapse-item title="申领信息" name="1" class="form-collapse-item">
-          <el-row :gutter="0">
+    <div class="overflow-auto">
+      <el-row :gutter="0">
             <el-col :span="24">
               <el-form-item prop="file" label="上传文件" :rules="[{
                 required: true,
@@ -36,8 +35,7 @@
               </el-form-item>
             </el-col>
           </el-row>
-        </el-collapse-item>
-      </el-collapse>
+      </div>
     </el-form>
 
     <template #footer>

+ 3 - 1
src/components/DialogImportTag.vue

@@ -10,7 +10,8 @@
         :model="uploadData"
         label-width="80px"
       >
-      <el-row :gutter="0">
+      <div class="overflow-auto">
+        <el-row :gutter="0">
               <el-col :span="24">
                 <el-form-item prop="file" label="上传文件" :rules="[{
                   required: true,
@@ -34,6 +35,7 @@
                 </el-form-item>
               </el-col>
             </el-row>
+          </div>
       </el-form>
 
       <template #footer>

+ 7 - 7
src/components/DialogTagApplyOrderExport.vue

@@ -36,15 +36,15 @@
             </tr>
           </thead>
           <tbody>
-            <tr v-if="data">
-              <td align="center"><div class="cell">{{ 1 }}</div></td>
+            <tr v-for="(item,index) in data.details" :key="index">
+              <td align="center"><div class="cell">{{ index + 1 }}</div></td>
               <td align="center"><div class="cell">{{ data.providerName }}</div></td>
               <td align="center"><div class="cell">{{ data.applicantName }}</div></td>
-              <td align="center"><div class="cell">{{ data. tagTypeName}}</div></td>
-              <td align="center"><div class="cell">{{ data.formatCreateTime }}</div></td>
-              <td align="center"><div class="cell">{{ data.number }}</div></td>
-              <td align="center"><div class="cell">{{ data.unitPrice }}</div></td>
-              <td align="center"><div class="cell">{{ data.subtotal }}</div></td>
+              <td align="center"><div class="cell">{{ item.tagTypeName}}</div></td>
+              <td align="center"><div class="cell">{{ data.dataTime }}</div></td>
+              <td align="center"><div class="cell">{{ item.number }}</div></td>
+              <td align="center"><div class="cell">{{ item.unitPrice }}</div></td>
+              <td align="center"><div class="cell">{{ item.amount }}</div></td>
             </tr>
             <tr>
               <td><div class="cell"></div></td>

+ 6 - 6
src/components/DialogTagPurchaseOrderExport.vue

@@ -32,13 +32,13 @@
             </tr>
           </thead>
           <tbody>
-            <tr v-if="data">
-              <td align="center"><div class="cell">{{ 1 }}</div></td>
-              <td align="center"><div class="cell">{{ data. tagTypeName}}</div></td>
-              <td align="center"><div class="cell">{{ data. number}}</div></td>
-              <td align="center"><div class="cell">{{ data. amount}}</div></td>
+            <tr v-for="(item, index) in data.details" :key="index">
+              <td align="center"><div class="cell">{{ index + 1 }}</div></td>
+              <td align="center"><div class="cell">{{ item.tagTypeName}}</div></td>
+              <td align="center"><div class="cell">{{ item. number}}</div></td>
+              <td align="center"><div class="cell">{{ item. amount}}</div></td>
               <td align="center"><div class="cell">{{ data. buyerName}}</div></td>
-              <td align="center"><div class="cell">{{ data. formatDataTime}}</div></td>
+              <td align="center"><div class="cell">{{ data. dataTime}}</div></td>
             </tr>
             <tr>
               <td><div class="cell"></div></td>

+ 1 - 1
src/components/MySelect.vue

@@ -52,7 +52,7 @@ export default {
   },
   methods: {
     change (...args) {
-      // this.$emit('change', ...args)
+      this.$emit('change', ...args)
     }
   }
 }

+ 14 - 3
src/entries/TagApply.js

@@ -98,11 +98,22 @@ export default class TagApply extends BaseCurdEntry {
   static $$optionTargetConfigGroup = [
     [{
       Target: TagApplyState,
-      getQuery: () => ({})
+      getQuery: () => ({}),
+      setQuery: (options, query, Target) => {
+        const [ option ] = options
+        if (option) {
+          query.tagApplyStateId = option[Target.$$idProp]
+        }
+      }
     }, {
-      Target: Provider
+      Target: Provider,
+      setQuery: (options, query, Target) => {
+        const [ option ] = options
+        if (option) {
+          query.providerId = option[Target.$$idProp]
+        }
+      }
     }]
   ]
-
   static $$optionData = {}
 }

+ 46 - 43
src/views/TagApply.vue

@@ -8,7 +8,6 @@
             <data-time-query
               :query="query"
               style="width:100%"
-              @change="onSearchBtnClick"
             ></data-time-query>
           </el-form-item>
         </el-col>
@@ -21,7 +20,6 @@
               filterable
               clearable
               placeholder="输入供应商全名或缩写"
-              @change="onSearchBtnClick"
             ></my-select>
           </el-form-item>
         </el-col>
@@ -31,9 +29,7 @@
             <my-select
               v-model="query.tagApplyStateId"
               :options="optionGroup.TagApplyState ? optionGroup.TagApplyState.list : []"
-              @change="onSearchBtnClick"
             >
-              <el-option label="全部" value=""></el-option>
             </my-select>
           </el-form-item>
         </el-col>
@@ -83,6 +79,7 @@
           @click="onExportTemplateBtnClick"
         >下载模版</el-button>
         <el-button
+         v-if="query.tagApplyStateId === '0'"
          :disabled="selectedList.length === 0"
           icon="el-icon-check"
           plain
@@ -92,6 +89,7 @@
           @click="onConfirmOrderBtnClick"
         >确认订单</el-button>
         <el-button
+          v-if="query.tagApplyStateId === '1'"
           :disabled="selectedList.length === 0"
           icon="el-icon-check"
           plain
@@ -182,13 +180,14 @@
           ></el-table-column>
           <el-table-column
                 label="操作栏"
-                min-width="80"
+                min-width="120"
                 header-align="center"
                 align="center"
               >
                 <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="onDeleteBtnClick" :disabled="row.tagApplyStateId!=='0'&& row.tagApplyStateId!=='1'" icon="el-icon-delete">删除</edit-button>
                   </div>
                 </template>
               </el-table-column>
@@ -242,7 +241,10 @@ export default {
       this.loadList()
     },
     onExportOrderBtnClick () {
-      this.$refs.orderExportDialog.open(this.selectedData)
+      this.$$request(TagApply.$$api.getDetail, this.selectedData, this)
+        .then(data => {
+          this.$refs.orderExportDialog.open(data)
+        }).catch(console.error).finally(() => {})
     },
     onExportTemplateBtnClick () {
       this.$refs.dialogExportTemplate.open()
@@ -250,28 +252,20 @@ export default {
     onConfirmPayBtnClick () {
       const { selectedList } = this
       const { $$idProp } = this
-      const ids = []
-      selectedList.forEach(data => {
-        if (data.tagApplyStateId === '1') {
-          ids.push(data.id)
+      this.$$api.confirmPay(selectedList.map(data => data[$$idProp])).then((flag) => {
+        if (flag) {
+          this.$notify({
+            title: '成功',
+            message: '操作成功',
+            type: 'success',
+            position: 'bottom-right'
+          })
+          this.loadList()
         }
-      })
-      if (ids.length > 0) {
-        this.$$api.confirmPay(selectedList.map(data => data[$$idProp])).then((flag) => {
-          if (flag) {
-            this.$notify({
-              title: '成功',
-              message: '操作成功',
-              type: 'success',
-              position: 'bottom-right'
-            })
-            this.loadList()
-          }
-        }).catch(console.error).finally(() => {})
-      }
+      }).catch(console.error).finally(() => {})
     },
     tagSelectAble (row) {
-      return row.tagApplyStateId === '0' || row.tagApplyStateId === '1'
+      return row.tagApplyStateId === this.query.tagApplyStateId
     },
     onOpenDetailEditorBtnClick (data) {
       this.$$request(TagApply.$$api.getDetail, data, this)
@@ -281,25 +275,34 @@ export default {
     },
     onConfirmOrderBtnClick () {
       const { selectedList } = this
-      const ids = []
-      selectedList.forEach(data => {
-        if (data.tagApplyStateId === '0') {
-          ids.push(data.id)
+      const { $$idProp } = this
+      this.$$api.confirmOrder(selectedList.map(data => data[$$idProp])).then((flag) => {
+        if (flag) {
+          this.$notify({
+            title: '成功',
+            message: '操作成功',
+            type: 'success',
+            position: 'bottom-right'
+          })
+          this.loadList()
         }
-      })
-      if (ids.length > 0) {
-        this.$$api.confirmOrder(ids).then((flag) => {
-          if (flag) {
-            this.$notify({
-              title: '成功',
-              message: '操作成功',
-              type: 'success',
-              position: 'bottom-right'
-            })
-            this.loadList()
-          }
-        }).catch(console.error).finally(() => {})
-      }
+      }).catch(console.error).finally(() => {})
+    },
+    onDeleteBtnClick (data) {
+      this.$confirm(`此操作将删除该记录, 是否继续?`, '确认', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        confirmButtonClass: 'confirm-dialog-confirm-btn',
+        cancelButtonClass: 'confirm-dialog-cancel-btn',
+        type: 'warning'
+      }).then(() => {
+        this.$$request(TagApply.$$api.delete, data, this)
+          .then(flag => {
+            if (flag) {
+              this.loadList()
+            }
+          }).catch(console.error).finally(() => {})
+      }).catch(() => {})
     }
   }
 }

+ 0 - 1
src/views/TagDistribute.vue

@@ -8,7 +8,6 @@
                     <my-select
                         v-model="query.tagApplyStateId"
                         :options="optionGroup.TagApplyState ? optionGroup.TagApplyState.list : []"
-                        @change="onSearchBtnClick"
                     >
               <el-option label="全部" value=""></el-option>
             </my-select>

+ 20 - 11
src/views/TagPurchase.vue

@@ -8,7 +8,6 @@
               <data-time-query
                 :query="query"
                 style="width:100%"
-                @change="onSearchBtnClick"
               ></data-time-query>
             </el-form-item>
           </el-col>
@@ -18,7 +17,6 @@
               <my-select
                 v-model="query.tagPurchaseStateId"
                 :options="optionGroup.TagPurchaseState ? optionGroup.TagPurchaseState.list : []"
-                @change="onSearchBtnClick"
               ></my-select>
             </el-form-item>
           </el-col>
@@ -65,7 +63,7 @@
           >导出采购</el-button>
 
           <el-button
-            :disabled="selectedList.length === 0"
+            :disabled="selectedList.length === 0 || query.tagPurchaseStateId!=='0'"
             plain
             icon="el-icon-finished"
             type="primary"
@@ -153,7 +151,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="onDeleteBtnClick" icon="el-icon-delete">删除</edit-button>
+                  <edit-button :data="row" :on-click="onDeleteBtnClick" :disabled="row.tagPurchaseStateId!=='0'" icon="el-icon-delete">删除</edit-button>
                 </div>
               </template>
             </el-table-column>
@@ -205,7 +203,10 @@ export default {
       }).catch(console.error).finally(() => {})
     },
     onExportOrderBtnClick () {
-      this.$refs.orderExportDialog.open(this.selectedData)
+      this.$$request(TagPurchase.$$api.getDetail, this.selectedData, this)
+        .then(data => {
+          this.$refs.orderExportDialog.open(data)
+        }).catch(console.error).finally(() => {})
     },
     onOpenDetailEditorBtnClick (data) {
       this.$$request(TagPurchase.$$api.getDetail, data, this)
@@ -214,12 +215,20 @@ export default {
         }).catch(console.error).finally(() => {})
     },
     onDeleteBtnClick (data) {
-      this.$$request(TagPurchase.$$api.delete, data, this)
-        .then(flag => {
-          if (flag) {
-            this.loadList()
-          }
-        }).catch(console.error).finally(() => {})
+      this.$confirm(`此操作将删除该记录, 是否继续?`, '确认', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        confirmButtonClass: 'confirm-dialog-confirm-btn',
+        cancelButtonClass: 'confirm-dialog-cancel-btn',
+        type: 'warning'
+      }).then(() => {
+        this.$$request(TagPurchase.$$api.delete, data, this)
+          .then(flag => {
+            if (flag) {
+              this.loadList()
+            }
+          }).catch(console.error).finally(() => {})
+      }).catch(() => {})
     }
   }
 }