瀏覽代碼

Merge remote-tracking branch 'origin/master'

lizhenhao 2 年之前
父節點
當前提交
f3ed027424

+ 15 - 1
src/api/materialManagement/WareHouseService.js

@@ -17,9 +17,23 @@ export default class WareHouseService {
   }
   save (param) {
     return request({
-      url: '/material/management/save',
+      url: '/material/management/wareHouse/save',
       method: 'post',
       data: param
     })
   }
+  findById (id) {
+    return request({
+      url: '/material/management/wareHouse/findById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  remove (id) {
+    return request({
+      url: '/material/management/wareHouse/remove',
+      method: 'get',
+      params: {id: id}
+    })
+  }
 }

+ 1 - 1
src/views/modules/materialManagement/wareHouse/PurchaseChooseForm.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <el-dialog
-      title="选择项目"
+      title="选择采购信息"
       :close-on-click-modal="false"
       v-dialogDrag
       width="1100px"

+ 31 - 18
src/views/modules/materialManagement/wareHouse/WareHouseAddForm.vue

@@ -49,9 +49,9 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="入库时间" prop="wareHouseDare" :rules="[{required: true, message:'请选择入库时间', trigger:'blur'}]">
+            <el-form-item label="入库时间" prop="wareHouseDate" :rules="[{required: true, message:'请选择入库时间', trigger:'blur'}]">
               <el-date-picker
-                v-model="inputForm.wareHouseDare"
+                v-model="inputForm.wareHouseDate"
                 type="date"
                 value-format="yyyy-MM-dd"
                 style="width: 100%"
@@ -261,6 +261,7 @@
   import CwProgramPageForm from '@/views/modules/cw/reimbursementApproval/info/CwProgramPageForm'
   import MaterialTypePullForm from '../info/MaterialTypePullForm'
   import MaterialManagementService from '@/api/materialManagement/MaterialManagementService'
+  import WareHouseService from '@/api/materialManagement/WareHouseService'
   import UpLoadComponent from '@/views/common/UpLoadComponent'
   import UserPullForm from '@/views/modules/finance/invoice/UserPullForm'
   import PurchaseChooseForm from './PurchaseChooseForm'
@@ -278,11 +279,12 @@
           fileInfoLost: [],
           purchaseNo: '',
           handledBy: '',
+          handledById: '',
           handledByOffice: '',
           wareHouseName: '',
           wareHouseNumber: '', // 入库编号
           userId: '',
-          wareHouseDare: '',
+          wareHouseDate: '',
           remarks: '',
           detailInfos: [],
           wareHouse: [],
@@ -292,8 +294,10 @@
       }
     },
     MaterialManagementService: null,
+    WareHouseService: null,
     created () {
       this.materialManagementService = new MaterialManagementService()
+      this.wareHouseService = new WareHouseService()
     },
     components: {
       SelectTree,
@@ -321,11 +325,12 @@
           fileInfoLost: [],
           purchaseNo: '',
           handledBy: JSON.parse(localStorage.getItem('user')).name,
-          handledByOffice: '',
+          handledById: JSON.parse(localStorage.getItem('user')).id,
+          handledByOffice: JSON.parse(localStorage.getItem('user')).officeDTO.id,
           wareHouseName: '',
           wareHouseNumber: '', // 入库编号
           userId: JSON.parse(localStorage.getItem('user')).id,
-          wareHouseDare: new Date(),
+          wareHouseDate: new Date(),
           remarks: '',
           detailInfos: [],
           wareHouse: [],
@@ -333,16 +338,13 @@
           files: [] // 附件信息
         }
         if (method === 'add') {
-          this.title = `新建采购类型`
+          this.title = `新建入库信息`
         } else if (method === 'edit') {
           this.inputForm.id = id
-          this.title = '修改采购类型'
+          this.title = '修改入库信息'
         } else if (method === 'view') {
           this.inputForm.id = id
-          this.title = '查看采购类型'
-        } else if (method === 'addChild') {
-          this.title = '添加下级结构'
-          this.inputForm.parentId = id
+          this.title = '查看入库信息'
         }
         this.visible = true
         this.loading = false
@@ -350,7 +352,7 @@
           if (method === 'edit' || method === 'view') { // 修改或者查看
             this.loading = true
             this.$refs.inputForm.resetFields()
-            this.materialManagementService.findById(this.inputForm.id).then(({data}) => {
+            this.wareHouseService.findById(this.inputForm.id).then(({data}) => {
               this.inputForm = this.recover(this.inputForm, data)
               if (this.commonJS.isEmpty(this.inputForm.handledByOffice)) {
                 this.inputForm.handledByOffice = JSON.parse(localStorage.getItem('user')).officeDTO.id
@@ -363,6 +365,14 @@
                   }
                 }
               }
+              let k = this.inputForm.wareHouse.length
+              for (let j = 0; j < k; j++) {
+                if (this.commonJS.isNotEmpty(this.inputForm.wareHouse[j].tradePrice)) {
+                  if (this.commonJS.isNotEmpty(this.inputForm.wareHouse[j].tradeNumber)) {
+                    this.inputForm.wareHouse[j].priceSum = this.inputForm.wareHouse[j].tradePrice * this.inputForm.wareHouse[j].tradeNumber
+                  }
+                }
+              }
               this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'reimbursement')
               this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
               this.loading = false
@@ -589,12 +599,12 @@
               let i = this.inputForm.wareHouse.length
               for (let j = 0; j < i; j++) {
                 let k = j + 1
-                if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].purchaser)) {
+                if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].wareHouseMan)) {
                   this.$message.error('入库详情第' + k + '行请选择入库人')
                   this.loading = false
                   return
                 }
-                if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].procurementType)) {
+                if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].wareHouseType)) {
                   this.$message.error('入库详情第' + k + '行请选择入库类型')
                   this.loading = false
                   return
@@ -607,14 +617,17 @@
               }
             }
             this.inputForm.files = this.$refs.uploadComponent.getDataList()
-            this.materialManagementService.save(this.inputForm).then(({data}) => {
+            this.wareHouseService.save(this.inputForm).then(({data}) => {
               // eslint-disable-next-line no-undef
-              callback(data.businessTable, data.businessId, this.inputForm)
-              this.$refs.inputForm.resetFields()
+              // callback(data.businessTable, data.businessId, this.inputForm)
+              // this.$refs.inputForm.resetFields()
+              this.$emit('refreshList')
               this.loading = false
+              this.close()
             }).catch(() => {
-              this.$refs.inputForm.resetFields()
+              // this.$refs.inputForm.resetFields()
               this.loading = false
+              // this.close()
             })
           }
         })

+ 7 - 7
src/views/modules/materialManagement/wareHouse/WareHouseList.vue

@@ -88,15 +88,15 @@
             </template>
           </vxe-column>
           <vxe-column min-width="160" align="center" title="入库时间" field="wareHouseDate"></vxe-column>
-          <vxe-column min-width="160" align="center" title="经办人" field="handledBy"></vxe-column>
+          <vxe-column min-width="160" align="center" title="经办人" field="handleByName"></vxe-column>
           <vxe-column min-width="160" align="center" title="经办人部门" field="handledByOfficeName"></vxe-column>
 
           <vxe-column title="操作" width="150px" fixed="right" align="center">
             <template  slot-scope="scope">
-              <el-button v-if="hasPermission('material:edit')&&scope.row.createBy === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4')" type="text"  size="small" @click="push(scope.row)">修改</el-button>
-              <el-button v-else-if="hasPermission('material:edit')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
-              <el-button v-if="hasPermission('material:del')&&scope.row.createBy === $store.state.user.id&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
-              <el-button v-else-if="hasPermission('material:del')&&isAdmin&&(scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'||scope.row.status==='5')" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
+              <el-button v-if="hasPermission('material:edit')&&scope.row.createBy === $store.state.user.id" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-else-if="hasPermission('material:edit')&&isAdmin" type="text"  size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('material:del')&&scope.row.createBy === $store.state.user.id" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
+              <el-button v-else-if="hasPermission('material:del')&&isAdmin" type="text"   size="small" @click="del(scope.row.id)">删除</el-button>
             </template>
           </vxe-column>
         </vxe-table>
@@ -111,7 +111,7 @@
           @page-change="currentChangeHandle">
         </vxe-pager>
 <!--        <UpdateInfoForm ref="updateInfoForm" @refreshDataList="refreshList"></UpdateInfoForm>-->
-        <WareHouseAddForm ref="wareHouseAddForm" @refreshDataList="refreshList"></WareHouseAddForm>
+        <WareHouseAddForm ref="wareHouseAddForm" @refreshList="refreshList"></WareHouseAddForm>
       </div>
     </div>
   </div>
@@ -276,7 +276,7 @@
           type: 'warning'
         }).then(() => {
           this.loading = true
-          this.materialManagementService.remove(ids).then(({data}) => {
+          this.wareHouseService.remove(ids).then(({data}) => {
             this.$message.success(data)
             this.refreshList()
             this.loading = false