hfxc226 il y a 2 ans
Parent
commit
fe17abbb0f

+ 10 - 6
src/utils/dict.js

@@ -817,10 +817,12 @@ DictCache.VALUE = {
    * 出库单状态
    */
   OUT_STORE_FORM_STATUS: {
-    CREATED: 0, // 未出库
-    NOT_EXECUTE: 1, // 未出库
-    EXECUTING: 2, // 已出库
-    FINISH: 3 // 未出库
+    CREATED: 0, // 新建
+    NOT_EXECUTE: 1, // 已提交审核
+    EXECUTING: 2, // 主管审核通过
+    PUSH_ERROR: 3, // 推送失败
+    PUSH_OK: 4, // 推送成功
+    FINISH: 5 // 已完成
   },
   /**
    * 入库单状态
@@ -1416,10 +1418,12 @@ DictCache.COLOR = {
    * 出库单状态
    */
   OUT_STORE_FORM_STATUS: {
-    0: 'error', // 新建
+    0: 'default', // 新建
     1: 'warning', // 待审核
     2: 'processing', // 待出库
-    3: 'success' // 已完成
+    3: 'error', // 推送失败
+    4: 'success', // 推送成功
+    5: 'processing' // 已完成
   },
   /**
    * 退货单状态

+ 12 - 6
src/views/store/outstoreform/OutStoreFormYY.vue

@@ -67,7 +67,11 @@
             <a-popconfirm v-if="record.status==0" title="是否提交审核?" @confirm="updateStore(record.id)">
               <a>提交审核</a>
             </a-popconfirm>
-            <a-divider v-if="record.status==1" type="vertical" />
+            <a-divider v-if="record.status==4" type="vertical" />
+            <a-popconfirm v-if="record.status==4" title="重新推送?" @confirm="rePush(record.id)">
+              <a>重新推送</a>
+            </a-popconfirm>
+            <a-divider v-if="record.status==0" type="vertical" />
             <a-popconfirm v-if="$auth('store-out-store-forms-del')&&record.status==1" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">
               <a>删除</a>
             </a-popconfirm>
@@ -98,7 +102,7 @@ import Detail from './modules/DetailYY'
 import TicketForm from './modules/TicketForm'
 
 import { updateStoreBack, getOutStoreFormPage, deleteOutStoreForms, fetchOutStoreForm, exportOutStoreForm } from '@/api/store/outstoreform'
-import { startOutStoreForm } from '@/api/activiti/activiti-outstoreform'
+import { addOutFormYY } from '@/api/yongyou/yongyou'
 import { startSbInfoScrap } from '@/api/activiti/activiti-sb-scrap'
 
 export default {
@@ -285,10 +289,6 @@ export default {
         this.$message.info('已提交,请等待主管审核')
         this.$refs.table.refresh()
       })
-      /* startOutStoreForm({ id: id }).then(res => {
-        this.$message.info('已提交,请等待主管审核')
-        this.$refs.table.refresh()
-      }) */
     },
     updateStoreBack (id) {
       updateStoreBack({ id: id }).then(res => {
@@ -296,6 +296,12 @@ export default {
         this.$refs.table.refresh()
       })
     },
+    rePush (id) {
+      addOutFormYY({ id: id }).then(res => {
+        this.$message.info('撤销成功')
+        this.$refs.table.refresh()
+      })
+    },
     handleOk () {
       this.visible = true
       this.$refs.table.refresh()

+ 12 - 6
src/views/store/outstoreform/modules/BaseFormYY.vue

@@ -124,11 +124,11 @@
       :data-source="data"
       :columns="columns"
       tableLayout="auto"
-      rowKey="id + cbatch"
+      rowKey="autoId"
       :row-selection="rowSelection">
       <template slot="num" slot-scope="text, record">
         <div class="editable-cell-input-wrapper">
-          <a-input :value="text" :id="record.cbatch + ',num'" @change="$event => onQuantityChange($event, record.cbatch, 'num')" />
+          <a-input :value="text" :id="record.autoId + ',num'" @change="$event => onQuantityChange($event, record.autoId, 'num')" />
         </div>
       </template>
       <template slot="remark" slot-scope="text, record">
@@ -431,7 +431,7 @@ export default {
     },
     handleDelOne (record) {
       const data = [...this.data]
-      this.data = data.filter(item => record.cbatch !== item.cbatch)
+      this.data = data.filter(item => record.autoId !== item.autoId)
     },
     handleSpareStoreSelect () {
       this.$refs.spareStoreSelectModal.base()
@@ -441,13 +441,14 @@ export default {
       for (let i = 0; i < rows.length; i++) {
         let find = false
         for (let j = 0; j < data.length; j++) {
-          if (rows[i].cbatch === data[j].cbatch) {
+          if (rows[i].autoId === data[j].autoId) {
             find = true
             break
           }
         }
         if (!find) {
           const selectData = rows[i]
+          selectData.storeNum = selectData.num
           selectData.num = 1
           data.push(selectData)
         }
@@ -470,14 +471,19 @@ export default {
         }
       }
     },
-    onQuantityChange (e, cbatch, attr) {
+    onQuantityChange (e, autoId, attr) {
       const value = e.target.value
       console.log(value)
       if (value !== 0 && !value) {
         return
       }
       const data = [...this.data]
-      const target = data.find(item => item.cbatch === cbatch)
+      const target = data.find(item => item.autoId === autoId)
+      if (value > target.storeNum) {
+        this.$message.error('领用数量不能大于库存数量')
+        target[attr] = 1
+        return
+      }
       console.log('target: ' + target)
       if (target) {
         target[attr] = value

+ 6 - 3
src/views/store/sparestore/modules/SpareStoreSelectModalYY.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     :title="modalTitle"
-    :width="1050"
+    :width="1200"
     :visible="visible"
     :confirmLoading="confirmLoading"
     class="ant-modal2"
@@ -64,7 +64,7 @@
           <s-table
             ref="table"
             size="default"
-            rowKey="cbatch"
+            rowKey="autoId"
             :columns="columns"
             :data="loadData"
             :alert="options.alert"
@@ -130,6 +130,7 @@ export default {
       isSpecial: null,
       // 查询参数
       queryParam: {
+        storeNo: '09'
       },
       // 表头
       columns: [
@@ -263,7 +264,9 @@ export default {
       this.selectedRows = selectedRows
     },
     resetSearchForm () {
-      this.queryParam = {}
+      this.queryParam = {
+        storeNo: '09'
+      }
       this.$refs.table.refresh(true)
     },
     base (record, queryParam = {}) {