gongwencan 1 tháng trước cách đây
mục cha
commit
0fce5e823b

+ 6 - 0
src/api/PrintQueueApi.js

@@ -16,6 +16,12 @@ class PrintQueueApi extends BaseCurdApi {
       method: 'POST'
     })
 
+    allContinuePrint = (data) => this.api({
+      url: `${this.basePath}/continue`,
+      method: 'POST',
+      data
+    })
+
     constructor () {
       super('/print/management')
     }

+ 14 - 5
src/components/DialogAddTagNullify.vue

@@ -32,7 +32,7 @@
       <template #footer>
       <div class="flex center dialog-footer">
         <el-button @click="onCloseBtnClick">取消</el-button>
-        <el-button type="primary" @click="onSaveTagNullifyBtnClick">确定</el-button>
+        <el-button :disabled="!visible || isSave" type="primary" @click="onSaveTagNullifyBtnClick">确定</el-button>
       </div>
     </template>
     </el-dialog>
@@ -53,20 +53,26 @@ export default {
   },
   data: () => ({
     visible: false,
-    data: {tagTypeId: null, number: 0}
+    data: {tagTypeId: null, number: 0},
+    isSave: false
   }),
   methods: {
     open () {
       if (this.optionGroup.TagType && this.optionGroup.TagType.list && this.optionGroup.TagType.list.length > 0) {
         this.data.tagTypeId = this.optionGroup.TagType.list[0].id
       }
+      this.saving = false
       this.visible = true
     },
     close () {
       this.visible = false
     },
     onSaveTagNullifyBtnClick () {
+      if (this.isSave) {
+        return
+      }
       if (this.data.tagTypeId && this.data.number && this.data.number > 0) {
+        this.isSave = true
         this.$$request(this.$$api.tagCancel, this.data).then((flag) => {
           if (flag) {
             this.$notify({
@@ -75,16 +81,19 @@ export default {
               type: 'success',
               position: 'bottom-right'
             })
-            this.$emit('saveTagCancel')
             this.close()
+            this.$emit('saveTagCancel')
           }
-        }).catch(console.error).finally(() => {})
+        }).catch(console.error).finally(() => {
+          this.isSave = false
+        })
       } else {
         this.$notify.error({
           title: '新增失败',
-          message: '作废数量大于0',
+          message: '作废数量大于0',
           position: 'bottom-right'
         })
+        this.isSave = true
       }
     }
   }

+ 34 - 2
src/components/DialogTagApplyDetail.vue

@@ -67,6 +67,13 @@
               header-align="center"
               align="center"
             ></el-table-column>
+            <el-table-column
+              label="申领人员"
+              min-width="100"
+              prop="applicantName"
+              header-align="center"
+              align="center"
+            ></el-table-column>
             <el-table-column
               label="最小包装数量"
               min-width="80"
@@ -89,7 +96,7 @@
               align="center"
             >
                 <template slot-scope="scope">
-                    <el-input v-model="scope.row.number" :class="{ 'input-error': scope.row.number === '' }" @input="handleInput" :disabled="oData.tagApplyStateId !='0'"></el-input>
+                    <el-input v-model="scope.row.number" :class="{ 'input-error': scope.row.number === '' }" maxlength="10" @input="handleInput" :disabled="oData.tagApplyStateId !='0'"></el-input>
                 </template>
             </el-table-column>
             <el-table-column
@@ -149,7 +156,7 @@
         <div class="flex center dialog-footer">
           <el-button
             @click="onCloseBtnClick"
-          >取消</el-button>
+          >导入</el-button>
           <el-button
             v-if="oData && oData.tagApplyStateId === '0'"
             type="primary"
@@ -204,6 +211,14 @@ export default {
     },
     onBatchDeleteBtnClick () {
       const { selectedList } = this
+      if (selectedList.length === this.list.length) {
+        this.$notify.error({
+          title: '删除失败',
+          message: '请至少保留一条标签',
+          position: 'bottom-right'
+        })
+        return
+      }
       this.$confirm(`此操作将删除选中的记录, 是否继续?`, '确认', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -217,6 +232,14 @@ export default {
       }).catch(() => {})
     },
     onDeleteBtnClick (data) {
+      if (this.list.length === 1) {
+        this.$notify.error({
+          title: '删除失败',
+          message: '请至少保留一条标签',
+          position: 'bottom-right'
+        })
+        return
+      }
       this.$confirm(`此操作将删除该记录, 是否继续?`, '确认', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
@@ -247,6 +270,15 @@ export default {
     },
     onConfirmOrderBtnClick () {
       if (this.oData && this.oData.details.length > 0) {
+        const datas = this.oData.details.filter(item => item.number && item.number > 0)
+        if (datas.length !== this.oData.details.length) {
+          this.$notify.error({
+            title: '失败',
+            message: '标签数量需大于0',
+            position: 'bottom-right'
+          })
+          return
+        }
         this.$$request(this.$$api.updateConfirmOrder, this.oData).then((flag) => {
           if (flag) {
             this.$notify({

+ 1 - 3
src/components/DialogTagApplyOrderExport.vue

@@ -28,7 +28,6 @@
             <tr>
               <th><div class="cell">序号</div></th>
               <th><div class="cell">供应商名称</div></th>
-              <th><div class="cell">申领人员</div></th>
               <th><div class="cell">标签类型</div></th>
               <th><div class="cell">创建日期</div></th>
               <th><div class="cell">单价(元)</div></th>
@@ -40,7 +39,6 @@
             <tr v-if="details.length > 0" v-for="(item,index) in details" :key="index">
               <td align="center"><div class="cell">{{ index + 1 }}</div></td>
               <td align="center"><div class="cell">{{ providerName }}</div></td>
-              <td align="center"><div class="cell">{{ applicantName }}</div></td>
               <td align="center"><div class="cell">{{ item.tagTypeName}}</div></td>
               <td align="center"><div class="cell">{{ formatDataTime }}</div></td>
               <td align="center"><div class="cell">{{ item.unitPrice }}</div></td>
@@ -48,7 +46,7 @@
               <td align="center"><div class="cell">{{ formatAmount(item.amount) }}</div></td>
             </tr>
             <tr>
-              <td align="center" colspan="6"><div class="cell">总计</div></td>
+              <td align="center" colspan="5"><div class="cell">总计</div></td>
               <td align="center"><div class="cell">{{number}}</div></td>
               <td align="center"><div class="cell">{{amount}}</div></td>
             </tr>

+ 1 - 1
src/components/DialogTagPurchaseDetail.vue

@@ -71,7 +71,7 @@
               align="center"
             >
                 <template slot-scope="scope">
-                    <el-input v-model="scope.row.number" :class="{ 'input-error': scope.row.number === '' }" @input="handleInput" :disabled="oData.tagPurchaseStateId !='0'"></el-input>
+                    <el-input v-model="scope.row.number" :class="{ 'input-error': scope.row.number === '' }" maxlength="10" @input="handleInput" :disabled="oData.tagPurchaseStateId !='0'"></el-input>
                 </template>
             </el-table-column>
             <el-table-column

+ 3 - 1
src/components/IntegerInput.vue

@@ -25,7 +25,9 @@ export default {
         return this.value
       },
       set (number) {
-        this.$emit('input', (number || '').replace(/\D/g, ''))
+        const sanitizedNumber = (number || '').replace(/\D/g, '').slice(0, 10)
+        this.$emit('input', sanitizedNumber)
+        // this.$emit('input', (number || '').replace(/\D/g, ''))
       }
     }
   }

+ 7 - 7
src/entries/TagApply.js

@@ -106,13 +106,13 @@ export default class TagApply extends BaseCurdEntry {
         }
       }
     }, {
-      Target: Provider,
-      setQuery: (options, query, Target) => {
-        const [ option ] = options
-        if (option) {
-          query.providerId = option[Target.$$idProp]
-        }
-      }
+      Target: Provider
+      // setQuery: (options, query, Target) => {
+      //   const [ option ] = options
+      //   if (option) {
+      //     query.providerId = option[Target.$$idProp]
+      //   }
+      // }
     }]
   ]
   static $$optionData = {}

+ 53 - 1
src/views/PrintQueue.vue

@@ -1,6 +1,18 @@
 <template>
     <div class="wrapper flex column layout-gap">
-
+      <el-card shadow="hover" class="filter-card">
+        <el-form label-width="100px">
+          <el-row :gutter="$$Constant.LAYOUT_GAP">
+            <el-col :span="24" class="text-right">
+              <el-button
+                type="primary"
+                class="filter-button"
+                @click="onAllContinuePrintBtnClick"
+              >继续打印</el-button>
+            </el-col>
+          </el-row>
+        </el-form>
+      </el-card>
       <el-card
         shadow="hover"
         class="z-card flex column flex-1 fit-size"
@@ -18,7 +30,15 @@
               height="100%"
               size="small"
               class="custom-el-table-style"
+              @selection-change="onSelectionChange"
             >
+            <el-table-column
+              type="selection"
+              width="55"
+              align="center"
+              :selectable="printSelectAble"
+              fixed
+            ></el-table-column>
               <el-table-column
                 type="index"
                 label="序号"
@@ -181,6 +201,38 @@ export default {
           this.loadList()
         }
       }).catch(console.error).finally(() => {})
+    },
+    printSelectAble (row) {
+      return row.printStatus === 2
+    },
+    onAllContinuePrintBtnClick () {
+      const { selectedList } = this
+      const { $$idProp } = this
+
+      const ids = selectedList
+        .filter(data => data.printStatus === 2)
+        .map(data => data[$$idProp])
+
+      if (!Array.isArray(ids) || ids.length === 0) {
+        this.$notify.error({
+          title: '失败',
+          message: '请选择需要继续打印的任务',
+          position: 'bottom-right'
+        })
+        return
+      }
+      console.log(ids)
+      this.$$request(this.$$api.allContinuePrint, ids).then((flag) => {
+        if (flag) {
+          this.$notify({
+            title: '成功',
+            message: '操作成功',
+            type: 'success',
+            position: 'bottom-right'
+          })
+          this.loadList()
+        }
+      }).catch(console.error).finally(() => {})
     }
   }
 }

+ 1 - 1
src/views/TagApply.vue

@@ -20,7 +20,7 @@
               filterable
               clearable
               placeholder="输入供应商"
-            ></my-select>
+            ><el-option label="全部" value=""></el-option></my-select>
           </el-form-item>
         </el-col>
 

+ 12 - 0
src/views/TagCode.vue

@@ -67,6 +67,7 @@
           <div class="flex valign-right" style="justify-content: flex-end;">
           <el-button type="primary" class="filter-button" @click="onSearchBtnClick">查询</el-button>
           <el-button
+           v-if="query.tagApplyStateId==='2'"
            :disabled="selectedList.length === 0"
             plain
             icon="el-icon-plus"
@@ -77,6 +78,7 @@
           >赋码</el-button>
 
           <el-button
+            v-if="query.tagApplyStateId==='3'"
             :disabled="selectedList.length === 0"
             plain
             type="primary"
@@ -291,6 +293,15 @@ export default {
         .filter(data => data.tagApplyStateId === '3')
         .map(data => data[$$idProp])
 
+      if (!Array.isArray(ids) || ids.length === 0) {
+        this.$notify.error({
+          title: '失败',
+          message: '所有订单都已打印,无需重复操作!',
+          position: 'bottom-right'
+        })
+        return
+      }
+
       this.$$request(this.$$api.print, ids).then((flag) => {
         if (flag) {
           this.$notify({
@@ -299,6 +310,7 @@ export default {
             type: 'success',
             position: 'bottom-right'
           })
+          this.loadList()
         }
       }).catch(console.error).finally(() => {})
     },

+ 1 - 1
src/views/TagDistribute.vue

@@ -116,7 +116,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 !== '5' && row.tagApplyStateId !== '6'">发放</edit-button>
+                    <edit-button :data="row" :on-click="onTagDistributeBtnClick" icon="el-icon-share" :disabled="row.tagApplyStateId === '6'">发放</edit-button>
                   </div>
                 </template>
               </el-table-column>