chris пре 3 година
родитељ
комит
d56bc2daf5

+ 16 - 4
src/views/modules/sale/purchase.vue

@@ -1,7 +1,7 @@
 <!-- 采购管理 -->
 <template>
   <div class="purchase">
-    <template v-if="!addOrUpdateVisible && !detailVisible && !operateVisible">
+    <template v-if="!addOrUpdateVisible && !detailVisible && !operateVisible && !inboundVisible">
       <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
         <el-form-item label="类别">
           <el-select
@@ -205,8 +205,8 @@
             <el-button v-if="isAuth('purchase:detail:info')" type="text" size="small" @click="detailHandle(scope.row.procurementId)">查看</el-button>
             <el-button v-if="isAuth('purchase:detail:update') && (Number(scope.row.approvalState) <= 1)" type="text" size="small" @click="addOrUpdateHandle(scope.row.procurementId, false)">编辑</el-button>
             <el-button v-if="isAuth('purchase:detail:updatePurchaseDetail') && (Number(scope.row.approvalState) === 3)" type="text" size="small" @click="operateHandle(scope.row)">采购</el-button>
-            <el-button v-if="isAuth('purchase:detail:infoPutIn') && (Number(scope.row.approvalState) === 3)" type="text" size="small" @click="revokeHandle(scope.row.procurementId)">入库</el-button>
-            <el-button v-if="isAuth('purchase:detail:infoPutInAgain') && (Number(scope.row.purchaseState) === 5)" type="text" size="small" @click="revokeHandle(scope.row.procurementId)">再次入库</el-button>
+            <el-button v-if="isAuth('purchase:detail:infoPutIn') && (Number(scope.row.approvalState) === 3)" type="text" size="small" @click="inboundHandle(scope.row)">入库</el-button>
+            <el-button v-if="isAuth('purchase:detail:infoPutInAgain') && (Number(scope.row.purchaseState) === 5)" type="text" size="small" @click="inboundHandle(scope.row.procurementId)">再次入库</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -225,6 +225,8 @@
     <detail v-if="detailVisible" ref="detail" @onChose="onChose"/>
     <!-- 采购操作 -->
     <operate v-if="operateVisible" ref="operate" @onChose="onChose"/>
+    <!-- 入库 -->
+    <inbound v-if="inboundVisible" ref="inbound" @onChose="onChose"/>
   </div>
 </template>
 
@@ -232,18 +234,20 @@
   import AddOrUpdate from './purchase-add-or-update'
   import Detail from './purchase-detail'
   import Operate from './purchase-operate'
+  import Inbound from '../warehouse/stock-order-inbound'
   import { getDictList } from '@/api/dict'
   import { getPurchaseList, revokePurchase } from '@/api/sale'
   export default {
     name: 'purchase',
     components: {
-      AddOrUpdate, Detail, Operate
+      AddOrUpdate, Detail, Operate, Inbound
     },
     data () {
       return {
         addOrUpdateVisible: false,
         detailVisible: false,
         operateVisible: false,
+        inboundVisible: false,
         dataForm: {},
         dataList: [],
         pageIndex: 1,
@@ -275,6 +279,7 @@
         this.addOrUpdateVisible = false
         this.detailVisible = false
         this.operateVisible = false
+        this.inboundVisible = false
       },
       // 获取采购类别字典
       getTypeList () {
@@ -391,6 +396,13 @@
         this.$nextTick(() => {
           this.$refs.operate.init(row)
         })
+      },
+      // 入库
+      inboundHandle (row) {
+        this.inboundVisible = true
+        this.$nextTick(() => {
+          this.$refs.inbound.init(0, false, row)
+        })
       }
     }
   }

+ 1 - 0
src/views/modules/warehouse/inventory-add.vue

@@ -1,3 +1,4 @@
+<!-- 新增盘点 -->
 <template>
   <!-- <el-dialog
     title="新增盘点"

+ 9 - 10
src/views/modules/warehouse/stock-order-inbound.vue

@@ -1,9 +1,5 @@
+<!-- 入库申请 -->
 <template>
-  <!-- <el-dialog
-    :title="!display ? '入库申请':'详情'"
-    width="80%"
-    :close-on-click-modal="false"
-    :visible.sync="visible"> -->
     <div>
       <div class="my-title">{{ !display ? '入库申请':'详情' }}</div>
       <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
@@ -101,7 +97,6 @@
         <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
       </span>
     </div>
-  <!-- </el-dialog> -->
 </template>
 
 <script>
@@ -130,13 +125,15 @@
       onChose () {
         this.$emit('onChose')
       },
-      async init (id, display) {
+      async init (id, display, dataForm) {
         this.display = display
         this.id = id || 0
         this.visible = true
         this.dataForm = {}
         this.dataList = []
-        if (!display) {
+        if (dataForm) {
+          this.addOne(dataForm, 1)
+        } else if (!display) {
           this.addOne()
         } else {
           // 获取详情
@@ -156,10 +153,12 @@
           })
         }
       },
-      addOne (item) {
+      addOne (item, outside) {
+        // console.log(item)
+        // console.log(outside)
         this.dataList.push({
+          buttonType: outside ? '1' : '0',
           id: item ? item.id : '',
-          // code: item ? item.id : '',
           amount: item ? item.amount : 0,
           applicant: item ? item.applicant : '',
           approver: item ? item.approver : '',