mxx 4 éve
szülő
commit
debd203b0c

+ 9 - 2
src/api/V2/warehouse/index.js

@@ -7,12 +7,11 @@ export const API_GET_WAREHOUSE_LOOK = '/warehouseBaseInfo/getWarehouse'
 export const API_GET_WAREHOUSE_CUSTOMDROPDOWN = '/warehouseBaseInfo/selectWarehouse'
 //删除
 export const API_POST_WAREHOUSE_DELETE = '/warehouseBaseInfo/api/deleteWarehouse'
-//删除仓库列表
+//查询删除仓库列表
 export const API_GET_WAREHOUSE_DELETELIST = '/warehouseBaseInfo/selectAllWarehouse'
 //隐藏
 export const API_POST_WAREHOUSE_HIDE = '/warehouseBaseInfo/api/editShow'
 
-
 export const API_GET_WAREHOUSE_DELETE = '/warehouseBaseInfo/api/deleteWarehouse'
 
 //仓库编辑
@@ -39,5 +38,13 @@ export const API_POST_WAREHOUSE_DEL_POSITION = '/warehousePositionInfo/api/delet
 export const API_POST_WAREHOUSE_DEL_INOUTINFO = '/warehouseInOutInfo/api/deleteWarehouse'
 //临时仓库增加
 export const API_POST_WAREHOUSE_ADD = '/warehouseBaseInfo/api/addTemporaryWarehouse'
+
 //临时库清仓
 export const API_POST_WAREHOUSE_CLEARANCEE = '/warehouseBaseInfo/api/editCleared'
+
+//临时出入库合同编号下拉
+export const API_GET_WAREHOUSE_NO = '/warehouseBaseInfo/selectContractNoList'
+// 获取负责人
+export const API_GET_STAFF = '/staff/query/getStaffListByCompId'
+
+

+ 4 - 1
src/model/warehouse/index.js

@@ -20,7 +20,10 @@ import {
     API_POST_WAREHOUSE_DEL_POSITION,
     API_POST_WAREHOUSE_DEL_INOUTINFO,
     API_POST_WAREHOUSE_ADD,
-    API_POST_WAREHOUSE_CLEARANCEE
+    API_POST_WAREHOUSE_CLEARANCEE,
+    API_GET_WAREHOUSE_NO,
+    API_GET_STAFF
+
 } from '@/api/V2/warehouse'
 // 列表
 export const getList = appRx.get(API_GET_WAREHOUSE_BASEINFO, errorCatcher, errorHandle, filter)

+ 59 - 45
src/views/warehouse/warehouseManagementDelete.vue

@@ -3,7 +3,7 @@
   <div class="homepage">
     <el-row>
       <el-col :span="20">
-        <h2 class="bg-left title">删除库</h2>
+        <h2 class="bg-left title">删除库</h2>
       </el-col>
       <el-col :span="4" class="bg-right">
         <el-button
@@ -35,18 +35,41 @@
           </template>
         </el-table-column>
         <el-table-column prop="warehouseName" label="仓库名称">
-
         </el-table-column>
-        <el-table-column prop="warehousePrivate" label="仓库所在地">
-          <template scope="scope">
-            {{scope.row.warehousePrivate}}{{scope.row.warehouseCity}}{{scope.row.warehouseArea}}
-          </template>
+        <el-table-column prop="warehouseLocation" label="仓库所在地">
         </el-table-column>
-        <el-table-column prop="residual" label="应余库存(吨)">
+        <el-table-column prop="nowStorage" label="应余库存(吨)">
         </el-table-column>
-        <el-table-column prop="personCharge" label="负责人"> </el-table-column>
-
+        <el-table-column prop="personCharge;" label="负责人"></el-table-column>
         <el-table-column prop="address" label="操作" width="200">
+          <!-- <template slot-scope="scope">
+            <ws-button
+              type="primary"
+              @click="handleHide(scope.row)"
+              v-hasPermission="
+                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+              "
+              v-if="scope.row.showFlag == 0"
+              >显示</ws-button
+            >
+            <ws-button
+              type="primary"
+              @click="handleHide(scope.row)"
+              v-hasPermission="
+                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+              "
+              v-if="scope.row.showFlag == 1"
+              >隐藏</ws-button
+            >
+            <ws-button
+              type="primary"
+              @click="handleDelete(sv-ifcope.row)"
+              v-hasPermission="
+                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+              "
+              >删除</ws-button
+            >
+          </template> -->
           <template slot-scope="scope">
             <div
               class="record"
@@ -71,6 +94,7 @@
 </template>
 <script>
 import {
+  getList,
   delectlist,
   deletewarehouse,
   hide,
@@ -167,41 +191,6 @@ export default {
     handleCloe() {
       this.dialogViewSpareMoney = false
     },
-    //删除
-    handleDelete(row) {
-      if(row.residual == 0){
-    // console.log(row)
-    this.$confirm(`此操作永久删除该仓库全部信息,是否确认删除`, {
-      cancelButtonText: '取消',
-      confirmButtonText: '确定',
-      type: 'warning',
-    })
-      .then(() => {
-        deletewarehouse({ id: row.id })
-          .toPromise()
-          .then((response) => {
-            this.$notify.success({
-              title: '成功',
-              message: '删除成功',
-            })
-            this.getList()
-          })
-          .catch((response) => {
-            // console.log(3333)
-            // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-          })
-      })
-      .catch(() => {
-        return false
-      })
-      }else{
-         this.$message({
-            message: '还有应余库存,不能删除此仓库!',
-            type: 'warning',
-          })
-          return
-      }
-  },
     //隐藏
     handleHide(row) {
       if (row.showFlag == 1) {
@@ -245,7 +234,32 @@ export default {
       }
     },
   },
-  
+  handleDelete(row) {
+    // console.log(row)
+    this.$confirm(`此操作永久删除该仓库全部信息,是否确认删除`, {
+      cancelButtonText: '取消',
+      confirmButtonText: '确定',
+      type: 'warning',
+    })
+      .then(() => {
+        deletewarehouse({ id: row.id })
+          .toPromise()
+          .then((response) => {
+            this.$notify.success({
+              title: '成功',
+              message: '删除成功',
+            })
+            this.getList()
+          })
+          .catch((response) => {
+            // console.log(3333)
+            // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+          })
+      })
+      .catch(() => {
+        return false
+      })
+  },
   // deletecontract(){},
   //删除
   approve() {},

+ 138 - 76
src/views/warehouse/warehouseManagementDelivery.vue

@@ -25,7 +25,13 @@
       <div class="basicInformation">
         <h2>
           {{ deptBudgetList.warehouseName }}库
-          <span class="position"> {{ deptBudgetList.binNumber }}仓位 </span>
+          <span
+            class="position"
+            v-show="this.deptBudgetList.warehouseType == 1"
+          >
+            {{ deptBudgetList.binNumber }}仓位
+          </span>
+          <span v-show="this.deptBudgetList.warehouseType == 2">(临)</span>
         </h2>
         <div class="small-title">基本信息</div>
         <ws-info-table>
@@ -99,12 +105,18 @@
           </ws-form-item>
           <!--经办人-->
           <ws-form-item label="经办人" span="1" prop="agent">
-            <ws-input
+            <ws-select
               v-model="deptBudgetList.agent"
-              placeholder="请输入出库经办人姓名"
-              maxlength="100"
-              size="small"
-            />
+              placeholder=""
+              class="typeselect"
+            >
+              <ws-option
+                v-for="item in agent"
+                :key="item.constKey"
+                :label="item.staffName"
+                :value="item.staffName"
+              />
+            </ws-select>
           </ws-form-item>
           <!--出库日期-->
           <ws-form-item
@@ -120,16 +132,16 @@
               value-format="yyyy-MM-dd"
             />
           </ws-form-item>
-          <!-- 库类型 -->
+          <!-- 库类型 -->
           <ws-form-item label="出库类型" span="1">
             <ws-select
-              v-model="deptBudgetList.inOutType"
+              v-model="deptBudgetList.deliveryType"
               placeholder=""
               class="typeselect"
               @change="selectstorageType"
             >
               <ws-option
-                v-for="item in storageType"
+                v-for="item in deliveryType"
                 :key="item.constKey"
                 :label="item.constValue"
                 :value="item.constValue"
@@ -147,12 +159,18 @@
           </ws-form-item>
           <!--合同编号-->
           <ws-form-item label="合同编号" span="1" prop="contractNo">
-            <ws-input
+            <ws-select
               v-model="deptBudgetList.contractNo"
-              placeholder="请输入合同编号"
-              maxlength="100"
-              size="small"
-            />
+              placeholder="请选择合同编号或移库任务编号"
+              class="typeselect"
+            >
+              <ws-option
+                v-for="item in outContractNo"
+                :key="item.constKey"
+                :label="item.contractNo"
+                :value="item.contractNo"
+              />
+            </ws-select>
           </ws-form-item>
         </ws-info-table>
       </div>
@@ -255,7 +273,13 @@
   </div>
 </template>
 <script>
-import { pullDown, addstorageputList, goodsname } from '@/model/warehouse/index'
+import {
+  pullDown,
+  addstorageputList,
+  goodsname,
+  xialaNo,
+  getstaff,
+} from '@/model/warehouse/index'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
 // import { dayjs, fmoney, EventBus } from 'base-core-lib'
@@ -299,11 +323,13 @@ export default {
       goodnameList: {},
       // 提交类型
       submitType: true,
-      storageType: [],
+      deliveryType: [],
+      outContractNo: [],
       appendixIdsAdd: '',
       uploadSuccess: {},
       onChange: {},
       gradeList: [],
+      agent: [],
       rules: {
         netWeight: [
           {
@@ -342,6 +368,7 @@ export default {
     this.deptBudgetList.positionId = this.$route.query.positionId
     this.deptBudgetList.warehouseName = this.$route.query.warehouseName
     this.deptBudgetList.binNumber = this.$route.query.binNumber
+    this.deptBudgetList.warehouseType = this.$route.query.warehouseType
     this.getList()
   },
   methods: {
@@ -350,15 +377,15 @@ export default {
       this.$router.push({ path: 'warehouseManagementList' })
     },
     temporaryStorage() {
-       if (!this.deptBudgetList.goodsName) {
+      if (!this.deptBudgetList.goodsName) {
         this.$message({
           message: '货名不能为空',
           type: 'warning',
         })
         return
       }
-      if(!this.deptBudgetList.grossWeight){
-         this.$message({
+      if (!this.deptBudgetList.grossWeight) {
+        this.$message({
           message: '毛重不能为空',
           type: 'warning',
         })
@@ -378,8 +405,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.tare){
-         this.$message({
+      if (!this.deptBudgetList.tare) {
+        this.$message({
           message: '皮重不能为空',
           type: 'warning',
         })
@@ -399,8 +426,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.agent){
-         this.$message({
+      if (!this.deptBudgetList.agent) {
+        this.$message({
           message: '经办人不能为空',
           type: 'warning',
         })
@@ -416,8 +443,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.carNo){
-         this.$message({
+      if (!this.deptBudgetList.carNo) {
+        this.$message({
           message: '车牌号不能为空',
           type: 'warning',
         })
@@ -430,8 +457,8 @@ export default {
         })
         return
       }
-       if(!this.deptBudgetList.contractNo){
-         this.$message({
+      if (!this.deptBudgetList.contractNo) {
+        this.$message({
           message: '合同编号不能为空',
           type: 'warning',
         })
@@ -447,7 +474,7 @@ export default {
         })
         return
       }
-       //自检员
+      //自检员
       if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
         if (
           this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
@@ -520,7 +547,7 @@ export default {
           return
         }
       }
-       //霉变
+      //霉变
       if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
           this.$message({
@@ -535,7 +562,8 @@ export default {
           (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
             '.'
           ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).length -
+            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.mildewGrain
               ).indexOf('.') +
@@ -550,7 +578,7 @@ export default {
         }
       }
 
-       //热损伤
+      //热损伤
       if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
           this.$message({
@@ -580,7 +608,7 @@ export default {
         }
       }
 
-        //不完整粒(%)
+      //不完整粒(%)
       if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
           this.$message({
@@ -592,10 +620,11 @@ export default {
         if (
           this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
           this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
-          (String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).indexOf(
-            '.'
-          ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).length -
+          (String(
+            this.deptBudgetList.warehouseInOutDetail.imperfectGrain
+          ).indexOf('.') != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.imperfectGrain
               ).indexOf('.') +
@@ -610,7 +639,7 @@ export default {
         }
       }
       //容重
-       if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
+      if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
           this.$message({
             message: '容重(克/升)非数字!',
@@ -624,7 +653,8 @@ export default {
           (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf(
             '.'
           ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).length -
+            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.bulkDensity
               ).indexOf('.') +
@@ -646,9 +676,8 @@ export default {
         .then(() => {
           this.$refs.deptBudgetList.validate((valid) => {
             if (valid) {
-              this.deptBudgetList.compId = sessionStorage.getItem(
-                'ws-pf_compId'
-              )
+              this.deptBudgetList.compId =
+                sessionStorage.getItem('ws-pf_compId')
               this.deptBudgetList.inOutFlag = 1
               this.deptBudgetList.statusFlag = 1
               addstorageputList(this.deptBudgetList)
@@ -704,7 +733,7 @@ export default {
         })
         return
       }
-     if (
+      if (
         this.deptBudgetList.tare < 0 ||
         this.deptBudgetList.tare > 10000 ||
         (String(this.deptBudgetList.tare).indexOf('.') != -1 &&
@@ -807,7 +836,7 @@ export default {
         })
         return
       }
-       //自检员
+      //自检员
       if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
         if (
           this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
@@ -880,7 +909,7 @@ export default {
           return
         }
       }
-       //霉变
+      //霉变
       if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
           this.$message({
@@ -895,7 +924,8 @@ export default {
           (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
             '.'
           ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).length -
+            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.mildewGrain
               ).indexOf('.') +
@@ -910,7 +940,7 @@ export default {
         }
       }
 
-       //热损伤
+      //热损伤
       if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
           this.$message({
@@ -940,7 +970,7 @@ export default {
         }
       }
 
-        //不完整粒(%)
+      //不完整粒(%)
       if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
           this.$message({
@@ -952,10 +982,11 @@ export default {
         if (
           this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
           this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
-          (String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).indexOf(
-            '.'
-          ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).length -
+          (String(
+            this.deptBudgetList.warehouseInOutDetail.imperfectGrain
+          ).indexOf('.') != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.imperfectGrain
               ).indexOf('.') +
@@ -970,7 +1001,7 @@ export default {
         }
       }
       //容重
-       if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
+      if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
           this.$message({
             message: '容重(克/升)非数字!',
@@ -984,7 +1015,8 @@ export default {
           (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf(
             '.'
           ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).length -
+            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.bulkDensity
               ).indexOf('.') +
@@ -998,29 +1030,28 @@ export default {
           return
         }
       }
-       this.$confirm(`确定提交出库信息`, {
+      this.$confirm(`确定提交出库信息`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
         type: 'warning',
+      }).then(() => {
+        this.$refs.deptBudgetList.validate((valid) => {
+          if (valid) {
+            this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
+            this.deptBudgetList.inOutFlag = 1
+            this.deptBudgetList.statusFlag = 3
+            addstorageputList(this.deptBudgetList)
+              .toPromise()
+              .then((response) => {
+                this.$message.success('添加成功')
+                this.$router.push({ path: 'warehouseManagementList' })
+              })
+          } else {
+            EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+            return false
+          }
+        })
       })
-        .then(() => {
-           this.$refs.deptBudgetList.validate((valid) => {
-        if (valid) {
-          this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
-          this.deptBudgetList.inOutFlag = 1
-          this.deptBudgetList.statusFlag = 3
-          addstorageputList(this.deptBudgetList)
-            .toPromise()
-            .then((response) => {
-              this.$message.success('添加成功')
-              this.$router.push({ path: 'warehouseManagementList' })
-            })
-        } else {
-          EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-          return false
-        }
-      })
-        })  
     },
     tarechange(e) {
       if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
@@ -1083,11 +1114,42 @@ export default {
         .then((response) => {
           this.gradeList = response
         })
+      // // 类型
+      // pullDown({ constId: 'CON6' })
+      //   .toPromise()
+      //   .then((response) => {
+      //     this.storageType = response
+      //   })
       // 类型
-      pullDown({ constId: 'CON6' })
+      if (this.deptBudgetList.warehouseType == 1) {
+        pullDown({ constId: 'CON6' })
+          .toPromise()
+          .then((response) => {
+            this.deliveryType = response
+          })
+      } else if (this.deptBudgetList.warehouseType == 2) {
+        // pullDown({ constId: 'WARE1' })
+        //   .toPromise()
+        //   .then((response) => {
+        //     this.storageType = response
+        //   })
+        pullDown({ constId: 'WARE2' })
+          .toPromise()
+          .then((response) => {
+            this.deliveryType = response
+          })
+      }
+      //合同编号
+      xialaNo({ compId: sessionStorage.getItem('ws-pf_compId') })
         .toPromise()
         .then((response) => {
-          this.storageType = response
+          this.outContractNo = response
+        })
+      //经办人
+      getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
+        .toPromise()
+        .then((response) => {
+          this.agent = response
         })
     },
     selecttaskType(e) {
@@ -1234,9 +1296,9 @@ export default {
   color: #8890b1;
   line-height: 16px;
 }
-.inspector{
+.inspector {
   width: 50%;
-} 
+}
 //质检员
 .inspector .el-form-item__content {
   text-align: left;

+ 156 - 40
src/views/warehouse/warehouseManagementEdit.vue

@@ -16,6 +16,10 @@
     </el-row>
     <div>
       <ws-form ref="deptBudgetList" :model="deptBudgetList">
+        <el-radio-group v-model="warehouseType" @change="warehouseTypechange">
+          <el-radio label="1">自有库</el-radio>
+          <el-radio label="2">临时库</el-radio>
+        </el-radio-group>
         <div class="small-title">基本信息</div>
         <!--基本信息-->
         <ws-info-table>
@@ -42,12 +46,20 @@
           </ws-form-item>
           <!--负责人-->
           <ws-form-item label="负责人" span="1" prop="personCharge">
-            <ws-input
+            <el-select
               v-model="deptBudgetList.personCharge"
-              placeholder="请输入负责人"
-              maxlength="100"
-              size="small"
-            />
+              placeholder="请选择负责人"
+              filterable
+              :filter-method="dataFilter"
+              @change="selectstaff"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.staffName"
+                :value="item.staffName"
+              />
+            </el-select>
           </ws-form-item>
           <!--负责人电话-->
           <ws-form-item
@@ -65,11 +77,20 @@
           </ws-form-item>
           <!--仓库所在地-->
           <ws-form-item label="仓库所在地" span="1" prop="warehouseCity">
-            <ws-input
+            <!-- <ws-input
               v-model="deptBudgetList.warehouseCity"
               placeholder="请输入仓库所在地"
               maxlength="120"
               size="small"
+            /> -->
+            <el-cascader
+              :options="options_"
+              v-model="selectedOptions"
+              clearable
+              size="large"
+              placeholder="请输入仓库所在地"
+              style="width: 200%"
+              @change="handleChange"
             />
           </ws-form-item>
           <!--详细地址-->
@@ -87,14 +108,19 @@
             />
           </ws-form-item>
           <!--总储量(吨)-->
-          <ws-form-item label="总储量(吨)" span="1" prop="totalStorage">
+          <ws-form-item
+            v-if="warehouseType == 1"
+            label="总储量(吨)"
+            span="1"
+            prop="totalStorage"
+          >
             <!-- <ws-input
               v-model="deptBudgetList.totalStorage"
               placeholder="请输入总储量(吨)"
               maxlength="20"
               size="small"
             /> -->
-            {{totalStorage}}
+            {{ totalStorage }}
           </ws-form-item>
         </ws-info-table>
         <div v-for="(item, index) in deptBudgetList.warehousePositionInfoList">
@@ -146,8 +172,9 @@
         </div>
       </ws-form>
       <ws-form ref="deptBudgetList" :model="deptBudgetList">
-        <div class="small-title">上传仓库照片</div>
+        <div v-if="warehouseType == 1" class="small-title">上传仓库照片</div>
         <ws-upload
+          v-if="warehouseType == 1"
           ref="upload"
           table-name="maintain_work_order"
           oss-key="mainPlan"
@@ -185,7 +212,9 @@ import {
   getLook,
   edit,
   delPosition,
+  getstaff,
 } from '@/model/warehouse/index'
+import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
@@ -227,18 +256,22 @@ export default {
       contractType: 2,
       startDate: null,
       endDate: null,
+      warehouseType: '1',
       unitList: [],
       baseId: '',
       // 提交类型
       submitType: true,
       size: 10,
-      compId: sessionStorage.getItem('ws-pf_compId'),
+      options_: regionData,
+      selectedOptions: [],
+      compId: sessionStorage.getItem('ws-pf_compId'),  
       deptCircularPage: {},
       packtypeList: [],
       date: {
         year: dayjs().format('YYYY'),
         month: dayjs().format('MM'),
       },
+      staffList: [],
       contractList: [],
       deptBudgetList: {},
       historyList: [],
@@ -248,29 +281,78 @@ export default {
           return time.getTime() > Date.now()
         },
       },
+
+      options: [],
+      value: '',
       accessoryTFs: false,
     }
   },
   activated() {
     this.loaddata()
+    getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
+      .toPromise()
+      .then((response) => {
+        this.options = response
+        this.staffList = response
+      })
     this.showType = this.isShow
   },
-computed : {
-   totalStorage :function() {
-     var sum  = 0
-     if(this.deptBudgetList.warehousePositionInfoList){
-       for(var i = 0;i < this.deptBudgetList.warehousePositionInfoList.length; i++ ){
-      sum += Number(this.deptBudgetList.warehousePositionInfoList[i].maxStorage)
-     }
-     }    
-     return sum
+  computed: {
+    totalStorage: function () {
+      var sum = 0
+      if (this.deptBudgetList.warehousePositionInfoList) {
+        for (
+          var i = 0;
+          i < this.deptBudgetList.warehousePositionInfoList.length;
+          i++
+        ) {
+          sum += Number(
+            this.deptBudgetList.warehousePositionInfoList[i].maxStorage
+          )
+        }
+      }
+      return sum
     },
-},
+  },
   methods: {
+    dataFilter(val) {
+      console.log(val)
+      this.deptBudgetList.personCharge = val
+      if (val) {
+        //val存在
+        this.options = this.staffList.filter((item) => {
+          if (
+            !!~item.staffName.indexOf(val) ||
+            !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
+          ) {
+            return true
+          }
+        })
+        console.log(this.options)
+      } else {
+        //val为空时,还原数组
+        this.options = this.staffList
+      }
+    },
+    selectstaff(e) {
+      for (var i = 0; i < this.staffList.length; i++) {
+        if (this.staffList[i].staffName == e) {
+          this.deptBudgetList.personChargeKey = this.staffList[i].staffId
+        }
+      }
+    },
     //返回按钮
     returnWarehouse() {
       this.deptBudgetList = {}
-      this.$router.push({ path: 'warehouseManagementList' })   
+      this.$router.push({ path: 'warehouseManagementList' })
+    },
+    handleChange(value) {
+      this.selectedOptions = value
+    },
+    warehouseTypechange() {
+      this.deptBudgetList = {}
+      this.selectedOptions = []
+      this.loaddata()
     },
     marker: function (item) {
       this.deptBudgetList.warehousePositioning =
@@ -351,7 +433,10 @@ computed : {
     },
     loaddata() {
       // 仓库名称
-      xiala({ compId: sessionStorage.getItem('ws-pf_compId') })
+      xiala({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        warehouseType: this.warehouseType,
+      })
         .toPromise()
         .then((response) => {
           this.packtypeList = response
@@ -385,27 +470,39 @@ computed : {
       })
         .toPromise()
         .then((response) => {
+          var tmp = []
+          tmp[0] = TextToCode[response.warehousePrivate].code
+          tmp[1] =
+            TextToCode[response.warehousePrivate][response.warehouseCity].code
+          tmp[2] =
+            TextToCode[response.warehousePrivate][response.warehouseCity][
+              response.warehouseArea
+            ].code
+          this.selectedOptions = tmp
           this.deptBudgetList = response
         })
     },
 
     //提交
     submit() {
-       if(!this.deptBudgetList.warehouseName){
+      if (!this.deptBudgetList.warehouseName) {
         this.$message({
           message: '仓库名称不能为空!',
           type: 'warning',
         })
         return
       }
-      if(this.deptBudgetList.warehouseName.length < 2 || this.deptBudgetList.warehouseName.length > 20){
+      if (
+        this.deptBudgetList.warehouseName.length < 2 ||
+        this.deptBudgetList.warehouseName.length > 20
+      ) {
         this.$message({
           message: '仓库名长度不符合要求!',
           type: 'warning',
         })
         return
       }
-       if(!this.deptBudgetList.personCharge){
+      if (!this.deptBudgetList.personCharge) {
         this.$message({
           message: '负责人不能为空!',
           type: 'warning',
@@ -422,35 +519,37 @@ computed : {
         })
         return
       }
-       if(!this.deptBudgetList.personPhone){
+      if (!this.deptBudgetList.personPhone) {
         this.$message({
           message: '负责人电话不能为空!',
           type: 'warning',
         })
         return
       }
-      if(this.deptBudgetList.personPhone.length != 11){
+      if (this.deptBudgetList.personPhone.length != 11) {
         this.$message({
           message: '手机号输入有误!',
           type: 'warning',
         })
         return
       }
-       if(!this.deptBudgetList.detailedAddress){
+      if (!this.deptBudgetList.detailedAddress) {
         this.$message({
           message: '详细地址不能为空!',
           type: 'warning',
         })
         return
       }
-      
-      if(this.totalStorage <= 0){
-        this.$message({
-          message: '仓位储量不能为空!',
-          type: 'warning',
-        })
-        return
+      if (this.warehouseType == 1) {
+        if (this.totalStorage <= 0) {
+          this.$message({
+            message: '仓位储量不能为空!',
+            type: 'warning',
+          })
+          return
+        }
       }
+
       if (
         this.deptBudgetList.detailedAddress.length < 2 ||
         this.deptBudgetList.detailedAddress.length > 20
@@ -461,14 +560,23 @@ computed : {
         })
         return
       }
-       for (var i = 0; i < this.deptBudgetList.warehousePositionInfoList.length; i++) {
-        for (var j = i + 1; j < this.deptBudgetList.warehousePositionInfoList.length; j++) {
+      for (
+        var i = 0;
+        i < this.deptBudgetList.warehousePositionInfoList.length;
+        i++
+      ) {
+        for (
+          var j = i + 1;
+          j < this.deptBudgetList.warehousePositionInfoList.length;
+          j++
+        ) {
           console.log(
             this.deptBudgetList.warehousePositionInfoList[i].binNumber,
             this.deptBudgetList.warehousePositionInfoList[j].binNumber
           )
           if (
-            this.deptBudgetList.warehousePositionInfoList[i].binNumber == this.deptBudgetList.warehousePositionInfoList[j].binNumber
+            this.deptBudgetList.warehousePositionInfoList[i].binNumber ==
+            this.deptBudgetList.warehousePositionInfoList[j].binNumber
           ) {
             this.$message({
               message: '仓位编号重复',
@@ -480,14 +588,22 @@ computed : {
       }
       this.$refs.deptBudgetList.validate((valid) => {
         if (valid) {
+          this.deptBudgetList.warehousePrivate =
+            CodeToText[this.selectedOptions[0]]
+          this.deptBudgetList.warehouseCity =
+            CodeToText[this.selectedOptions[1]]
+          this.deptBudgetList.warehouseArea =
+            CodeToText[this.selectedOptions[2]]
+          this.deptBudgetList.warehouseType = this.warehouseType
           this.deptBudgetList.baseId = this.baseId
           this.deptBudgetList.compId = this.compId
           this.deptBudgetList.contractType = 1
           edit(this.deptBudgetList)
             .toPromise()
             .then((response) => {
-              this.$message.success('编辑成功')     
-                            this.deptBudgetList = {}
+              this.$message.success('编辑成功')
+              this.deptBudgetList = {}
+              this.warehouseType = '1'
               this.$router.push({ path: 'warehouseManagementList' })
             })
         } else {

+ 37 - 31
src/views/warehouse/warehouseManagementList.vue

@@ -15,6 +15,7 @@
           />
           添加</ws-button
         >
+
         <ws-button
           @click="handleLook()"
           >查看</ws-button
@@ -29,17 +30,23 @@
           
           >删除</ws-button
         >
+        <ws-button @click="handleLook()">查看</ws-button>
+        <ws-button @click="handleEdit()">编辑</ws-button>
+        <ws-button @click="handleDelete()">删除</ws-button>
       </template>
       <template slot="left">
         <div style="margin-top: 2px">
-    <el-radio-group v-model="warehouseType" @change="changeradio"  size="small">
-      <el-radio-button label="1" >自有库</el-radio-button>
-      <el-radio-button label="2" >临时库</el-radio-button>
-      
-    </el-radio-group>
-  </div>
+          <el-radio-group
+            v-model="warehouseType"
+            @change="changeradio"
+            size="small"
+          >
+            <el-radio-button label="1">自有库</el-radio-button>
+            <el-radio-button label="2">临时库</el-radio-button>
+          </el-radio-group>
+        </div>
       </template>
-      <template slot="right" >
+      <template slot="right">
         <ws-input
           v-model="warehouseName"
           placeholder="请输入仓库名"
@@ -53,9 +60,7 @@
           class="find"
           type="primary"
           @click="find()"
-          v-hasPermission="
-            `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-          "
+         
           ><img
             width="16"
             height="16"
@@ -70,14 +75,14 @@
         /></ws-button>
       </template>
     </BaseHeaderLayout>
-    <div v-show="this.warehouseType == '1'"> 
+    <div v-show="this.warehouseType == '1'">
       <el-table
         class="wenzi"
         :data="warehouseList"
         style="width: 100%; margin-top: 20px"
         height="780"
       >
-        <el-table-column prop="warehouseName" label="库名" width="80">
+        <el-table-column prop="warehouseName" label="库名" width="80">
         </el-table-column>
         <el-table-column prop="binNumber" label="仓位编号" width="80">
         </el-table-column>
@@ -135,21 +140,20 @@
             <ws-button
               class="completed"
               @click="nocomplete(scope.row)"
-              
+
             >
               待完成({{ scope.row.number }})
             </ws-button>
             <ws-button
               class="putstorage"
               @click="warehousing(scope.row)"
-              
+
             >
               入库
             </ws-button>
             <ws-button
               class="deliverystorage"
               @click="delivery(scope.row)"
-              
             >
               出库
             </ws-button>
@@ -163,8 +167,8 @@
         </el-table-column>
       </el-table>
     </div>
-    
-      <div v-show="this.warehouseType == '2'">
+
+    <div v-show="this.warehouseType == '2'">
       <el-table
         class="wenzi"
         :data="warehouseList"
@@ -189,7 +193,7 @@
             </div>
           </template>
         </el-table-column>
-        
+
         <el-table-column label="入库量(吨)">
           <template slot-scope="scope">
             <div
@@ -216,7 +220,11 @@
               style="height: 24px"
               v-for="(item, i) in scope.row.warehouseNumViewList"
             >
+
            {{ item.inNetWeight - item.outNetWeight}}
+
+              {{ item.storage }}
+
             </div>
           </template>
         </el-table-column>
@@ -225,14 +233,12 @@
             <ws-button
               class="completed"
               @click="nocomplete(scope.row)"
-              
             >
               待完成({{ scope.row.number }})
             </ws-button>
             <ws-button
               class="putstorage"
-              @click="warehousing(scope.row)"
-              
+              @click="warehousing(scope.row)" 
             >
               入库
             </ws-button>
@@ -240,7 +246,6 @@
               class="deliverystorage"
               v-if="scope.row.clearStatusFlag != 3"
               @click="delivery(scope.row)"
-              
             >
               出库
             </ws-button>
@@ -304,7 +309,7 @@ export default {
       searchTypeText: '未完成',
       searchKeyWord: '',
       contractType: 2,
-      warehouseType: "1",
+      warehouseType: '1',
       // 提交类型
       submitType: true,
       size: 10,
@@ -325,16 +330,12 @@ export default {
     }
   },
   activated() {
-    //cg.viewBudget
-    //cg.viewSpareMoney
-    // this.getVesselData();
     this.getList()
     this.clearancee()
     this.showType = this.isShow
   },
 
   methods: {
-    
     //清仓
      clearance(row){
        
@@ -363,6 +364,8 @@ export default {
 
        },
       
+
+
     //出库
     delivery(item) {
       this.$router.push({
@@ -373,6 +376,7 @@ export default {
           warehouseName: item.warehouseName,
           binNumber: item.binNumber,
           capacity: item.capacity,
+          warehouseType: this.warehouseType
         },
       })
     },
@@ -392,6 +396,8 @@ export default {
           binNumber: item.binNumber,
           capacity: item.capacity - free,
           id: item.id,
+          warehouseType: this.warehouseType,
+          createType: item.createType
         },
       })
     },
@@ -466,8 +472,8 @@ export default {
         },
       })
     },
-    changeradio(e){
-    this.getList()
+    changeradio(e) {
+      this.getList()
     },
     //查看
     handleLook() {
@@ -520,7 +526,7 @@ export default {
       this.getList()
     },
     getList() {
-        getList({
+      getList({
         compId: sessionStorage.getItem('ws-pf_compId'),
         warehouseName: this.warehouseName,
         warehouseType: this.warehouseType,
@@ -700,7 +706,7 @@ export default {
   height: 12px;
   background: #e9ecf7;
 }
-/deep/.el-radio-button:first-child .el-radio-button__inner{
+/deep/.el-radio-button:first-child .el-radio-button__inner {
   margin-left: 10px;
 }
 </style>

+ 23 - 4
src/views/warehouse/warehouseManagementLook.vue

@@ -21,6 +21,10 @@
       </el-col>
     </el-row>
     <div class="center">
+      <el-radio-group v-model="warehouseType" @change="warehouseTypechange">
+        <el-radio label="1">自有库</el-radio>
+        <el-radio label="2">临时库</el-radio>
+      </el-radio-group>
       <ws-form ref="deptBudgetList" :model="deptBudgetList">
         <div class="small-title">基本信息</div>
         <!--基本信息-->
@@ -75,7 +79,12 @@
             {{ deptBudgetList.detailedAddress }}
           </ws-form-item>
           <!--总储量(吨)-->
-          <ws-form-item label="总储量(吨)" span="1" prop="totalStorage">
+          <ws-form-item
+            v-show="warehouseType == 1"
+            label="总储量(吨)"
+            span="1"
+            prop="totalStorage"
+          >
             {{ totalStorage }}
           </ws-form-item>
         </ws-info-table>
@@ -101,7 +110,11 @@
               {{ item.maxStorage }}
             </ws-form-item>
             <!--现有储量-->
-            <ws-form-item :label='"现有储量("+item.nowStorage+"吨)"' span="1" prop="detailStorage" >
+            <ws-form-item
+              :label="'现有储量(' + item.nowStorage + '吨)'"
+              span="1"
+              prop="detailStorage"
+            >
               {{ item.detailStorage }}
             </ws-form-item>
             <!--备注(选填)-->
@@ -143,7 +156,6 @@ export default {
     isShow(val) {
       this.showType = val
     },
- 
   },
   data() {
     return {
@@ -167,6 +179,7 @@ export default {
       startDate: null,
       endDate: null,
       unitList: [],
+      warehouseType: '1',
       // 提交类型
       submitType: true,
       size: 10,
@@ -217,6 +230,9 @@ export default {
       this.$router.push({ path: 'warehouseManagementList' })
       this.deptBudgetList = {}
     },
+    warehouseTypechange() {
+      this.loaddata()
+    },
     dateFormat(fmt, date) {
       let ret
       const opt = {
@@ -262,7 +278,10 @@ export default {
     },
     loaddata() {
       // 仓库名称
-      xiala({ compId: sessionStorage.getItem('ws-pf_compId') })
+      xiala({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        warehouseType: this.warehouseType,
+      })
         .toPromise()
         .then((response) => {
           this.packtypeList = response

+ 161 - 75
src/views/warehouse/warehouseManagementPut.vue

@@ -33,7 +33,10 @@
             alt=""
           />
           {{ deptBudgetList.warehouseName }}库
-          <span class="position"> {{ deptBudgetList.binNumber }}仓位 </span>
+          <span class="position" v-show="this.$route.query.warehouseType == 1">
+            {{ deptBudgetList.binNumber }}仓位
+          </span>
+          <span v-show="this.$route.query.warehouseType == 2">(临)</span>
         </h2>
         <ws-info-table>
           <!-- 货名 -->
@@ -108,12 +111,18 @@
 
           <!--经办人-->
           <ws-form-item label="经办人" span="1" prop="agent">
-            <ws-input
+            <ws-select
               v-model="deptBudgetList.agent"
-              placeholder="请输入出库经办人姓名"
-              maxlength="100"
-              size="small"
-            />
+              placeholder=""
+              class="typeselect"
+            >
+              <ws-option
+                v-for="item in agent"
+                :key="item.constKey"
+                :label="item.staffName"
+                :value="item.staffName"
+              />
+            </ws-select>
           </ws-form-item>
           <!--出库日期-->
           <ws-form-item
@@ -158,14 +167,57 @@
 
           <!--合同编号-->
           <ws-form-item label="合同编号" span="1" prop="contractNo">
-            <ws-input
+            <ws-select
               v-model="deptBudgetList.contractNo"
-              placeholder="请输入合同编号"
-              maxlength="100"
-              size="small"
-            />
+              placeholder="请选择合同编号或移库任务编号"
+              class="typeselect"
+            >
+              <ws-option
+                v-for="item in outContractNo"
+                :key="item.constKey"
+                :label="item.contractNo"
+                :value="item.contractNo"
+              />
+            </ws-select>
           </ws-form-item>
         </ws-info-table>
+        <div v-show="this.$route.query.warehouseType == 2">
+          <el-checkbox v-model="checked" checked>退库并出库</el-checkbox>
+          <ws-info-table
+            v-show="checked == true && this.deptBudgetList.createType == 2"
+          >
+            <!-- 出库类型 -->
+            <ws-form-item label="出库类型" span="1">
+              <ws-select
+                v-model="deptBudgetList.deliveryType"
+                placeholder=""
+                class="typeselect"
+              >
+                <ws-option
+                  v-for="item in deliveryType"
+                  :key="item.constKey"
+                  :label="item.constValue"
+                  :value="item.constValue"
+                />
+              </ws-select>
+            </ws-form-item>
+            <!-- 出库合同编号 -->
+            <ws-form-item label="出库合同编号" span="1">
+              <ws-select
+                v-model="deptBudgetList.outContractNo"
+                placeholder="请选择合同编号或移库任务编号"
+                class="typeselect"
+              >
+                <ws-option
+                  v-for="item in outContractNo"
+                  :key="item.constKey"
+                  :label="item.contractNo"
+                  :value="item.contractNo"
+                />
+              </ws-select>
+            </ws-form-item>
+          </ws-info-table>
+        </div>
       </div>
       <ws-upload
         ref="upload"
@@ -270,7 +322,12 @@
   </div>
 </template>
 <script>
-import { pullDown, addstorageputList } from '@/model/warehouse/index'
+import {
+  pullDown,
+  addstorageputList,
+  xialaNo,
+  getstaff,
+} from '@/model/warehouse/index'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
 // import { dayjs, fmoney, EventBus } from 'base-core-lib'
@@ -311,9 +368,15 @@ export default {
       startDate: null,
       endDate: null,
       goodnameList: {},
+      checked: true,
+      agent:[],
+
+      outContractNo: [],
+
       // 提交类型
       submitType: true,
       storageType: [],
+      deliveryType: [],
       readonly: true,
       appendixIdsAdd: '',
       uploadSuccess: {},
@@ -356,23 +419,20 @@ export default {
     this.deptBudgetList.positionId = this.$route.query.positionId
     this.deptBudgetList.warehouseName = this.$route.query.warehouseName
     this.deptBudgetList.binNumber = this.$route.query.binNumber
+    this.deptBudgetList.warehouseType = this.$route.query.warehouseType
+    this.deptBudgetList.createType = this.$route.query.createType
     this.getList()
     this.deptBudgetList.goodsName = '玉米'
     this.deptBudgetList.goodsNameKey = '1'
     this.deptBudgetList.grade = '一等品'
     this.deptBudgetList.gradeKey = '1'
-    this.deptBudgetList.inOutType = '采购入库'
-    this.deptBudgetList.inOutTypeKey = '1'
-  },
-  activated() {
-    //   //cg.viewBudget
-    //   //cg.viewSpareMoney
-    //   // this.getVesselData();
-    //   console.log(2222)
-    //   this.getList()
-    //   console.log(1111)
-    //   this.showType = this.isShow
-    // this.getList(this.$route.query.baseId,)
+    if (this.deptBudgetList.warehouseType == 1) {
+      this.deptBudgetList.inOutType = '采购入库'
+      this.deptBudgetList.inOutTypeKey = '1'
+    } else {
+      this.deptBudgetList.inOutType = '退库'
+      this.deptBudgetList.inOutTypeKey = '1'
+    }
   },
   methods: {
     //返回按钮
@@ -447,7 +507,7 @@ export default {
         })
         return
       }
-       if (!this.deptBudgetList.grade) {
+      if (!this.deptBudgetList.grade) {
         this.$message({
           message: '品级不能为空!',
           type: 'warning',
@@ -500,14 +560,14 @@ export default {
         return
       }
 
-      if (this.deptBudgetList.netWeight > this.$route.query.capacity) {
-        this.$message({
-          message: '入库量大于该仓库容量!',
-          type: 'warning',
-        })
-        return
-      }
-       //自检员
+      // if (this.deptBudgetList.netWeight > this.$route.query.capacity) {
+      //   this.$message({
+      //     message: '入库量大于该仓库容量!',
+      //     type: 'warning',
+      //   })
+      //   return
+      // }
+      //自检员
       if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
         if (
           this.deptBudgetList.warehouseInOutDetail.qualityInspector.length <
@@ -580,7 +640,7 @@ export default {
           return
         }
       }
-       //霉变
+      //霉变
       if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
           this.$message({
@@ -595,7 +655,8 @@ export default {
           (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
             '.'
           ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).length -
+            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.mildewGrain
               ).indexOf('.') +
@@ -610,7 +671,7 @@ export default {
         }
       }
 
-       //热损伤
+      //热损伤
       if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
           this.$message({
@@ -640,7 +701,7 @@ export default {
         }
       }
 
-        //不完整粒(%)
+      //不完整粒(%)
       if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
           this.$message({
@@ -652,10 +713,11 @@ export default {
         if (
           this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
           this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
-          (String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).indexOf(
-            '.'
-          ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).length -
+          (String(
+            this.deptBudgetList.warehouseInOutDetail.imperfectGrain
+          ).indexOf('.') != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.imperfectGrain
               ).indexOf('.') +
@@ -670,7 +732,7 @@ export default {
         }
       }
       //容重
-       if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
+      if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
           this.$message({
             message: '容重(克/升)非数字!',
@@ -684,7 +746,8 @@ export default {
           (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf(
             '.'
           ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).length -
+            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.bulkDensity
               ).indexOf('.') +
@@ -699,7 +762,7 @@ export default {
         }
       }
       this.deptBudgetList.id = this.$route.query.id
-        this.$confirm(`确定提交入库信息`, {
+      this.$confirm(`确定提交入库信息`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
         type: 'warning',
@@ -707,9 +770,8 @@ export default {
         .then(() => {
           this.$refs.deptBudgetList.validate((valid) => {
             if (valid) {
-              this.deptBudgetList.compId = sessionStorage.getItem(
-                'ws-pf_compId'
-              )
+              this.deptBudgetList.compId =
+                sessionStorage.getItem('ws-pf_compId')
               this.deptBudgetList.inOutFlag = 2
               this.deptBudgetList.statusFlag = 3
               addstorageputList(this.deptBudgetList)
@@ -727,8 +789,6 @@ export default {
         .catch(() => {
           return false
         })
-    
-      
     },
     temporaryStorage() {
       if (!this.deptBudgetList.goodsName) {
@@ -828,13 +888,13 @@ export default {
         })
         return
       }
-      if (this.deptBudgetList.netWeight > this.$route.query.capacity) {
-        this.$message({
-          message: '入库量大于该仓库容量!',
-          type: 'warning',
-        })
-        return
-      }
+      // if (this.deptBudgetList.netWeight > this.$route.query.capacity) {
+      //   this.$message({
+      //     message: '入库量大于该仓库容量!',
+      //     type: 'warning',
+      //   })
+      //   return
+      // }
       //自检员
       if (this.deptBudgetList.warehouseInOutDetail.qualityInspector) {
         if (
@@ -908,7 +968,7 @@ export default {
           return
         }
       }
-       //霉变
+      //霉变
       if (this.deptBudgetList.warehouseInOutDetail.mildewGrain) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.mildewGrain)) {
           this.$message({
@@ -923,7 +983,8 @@ export default {
           (String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).indexOf(
             '.'
           ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain).length -
+            String(this.deptBudgetList.warehouseInOutDetail.mildewGrain)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.mildewGrain
               ).indexOf('.') +
@@ -938,7 +999,7 @@ export default {
         }
       }
 
-       //热损伤
+      //热损伤
       if (this.deptBudgetList.warehouseInOutDetail.jiaorenli) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.jiaorenli)) {
           this.$message({
@@ -968,7 +1029,7 @@ export default {
         }
       }
 
-        //不完整粒(%)
+      //不完整粒(%)
       if (this.deptBudgetList.warehouseInOutDetail.imperfectGrain) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)) {
           this.$message({
@@ -980,10 +1041,11 @@ export default {
         if (
           this.deptBudgetList.warehouseInOutDetail.imperfectGrain < 1 ||
           this.deptBudgetList.warehouseInOutDetail.imperfectGrain > 40 ||
-          (String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).indexOf(
-            '.'
-          ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain).length -
+          (String(
+            this.deptBudgetList.warehouseInOutDetail.imperfectGrain
+          ).indexOf('.') != -1 &&
+            String(this.deptBudgetList.warehouseInOutDetail.imperfectGrain)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.imperfectGrain
               ).indexOf('.') +
@@ -998,7 +1060,7 @@ export default {
         }
       }
       //容重
-       if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
+      if (this.deptBudgetList.warehouseInOutDetail.bulkDensity) {
         if (isNaN(this.deptBudgetList.warehouseInOutDetail.bulkDensity)) {
           this.$message({
             message: '容重(克/升)非数字!',
@@ -1012,7 +1074,8 @@ export default {
           (String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).indexOf(
             '.'
           ) != -1 &&
-            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity).length -
+            String(this.deptBudgetList.warehouseInOutDetail.bulkDensity)
+              .length -
               (String(
                 this.deptBudgetList.warehouseInOutDetail.bulkDensity
               ).indexOf('.') +
@@ -1034,9 +1097,8 @@ export default {
         .then(() => {
           this.$refs.deptBudgetList.validate((valid) => {
             if (valid) {
-              this.deptBudgetList.compId = sessionStorage.getItem(
-                'ws-pf_compId'
-              )
+              this.deptBudgetList.compId =
+                sessionStorage.getItem('ws-pf_compId')
               this.deptBudgetList.inOutFlag = 2
               this.deptBudgetList.statusFlag = 1
               addstorageputList(this.deptBudgetList)
@@ -1117,10 +1179,36 @@ export default {
           this.gradeList = response
         })
       // 类型
-      pullDown({ constId: 'CON5' })
+      if (this.deptBudgetList.warehouseType == '1') {
+        pullDown({ constId: 'CON5' })
+          .toPromise()
+          .then((response) => {
+            this.storageType = response
+          })
+      } else if (this.deptBudgetList.warehouseType == '2') {
+        pullDown({ constId: 'WARE1' })
+          .toPromise()
+          .then((response) => {
+            this.storageType = response
+          })
+
+        pullDown({ constId: 'WARE2' })
+          .toPromise()
+          .then((response) => {
+            this.deliveryType = response
+          })
+      }
+      //合同编号
+      xialaNo({ compId: sessionStorage.getItem('ws-pf_compId') })
+        .toPromise()
+        .then((response) => {
+          this.outContractNo = response
+        })
+      //经办人
+      getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
         .toPromise()
         .then((response) => {
-          this.storageType = response
+          this.agent = response
         })
     },
     selecttaskType(e) {
@@ -1261,9 +1349,9 @@ export default {
   color: #8890b1;
   line-height: 16px;
 }
-.inspector{
+.inspector {
   width: 50%;
-} 
+}
 //质检员
 .inspector .el-form-item__content {
   text-align: left;
@@ -1302,6 +1390,4 @@ export default {
 /deep/.neifor .el-input--small .el-input__inner {
   width: 100%;
 }
-
-
 </style>

+ 1 - 1
vue.config.js

@@ -144,7 +144,7 @@ module.exports = {
         // target: 'http://standard-dev.winsea.com/', //目标地址
         // target: 'http://localhost:8090/',
         // target: 'http://192.168.1.121:8090/',
-        target: 'http://192.168.1.119:8090/',
+        target: 'http://192.168.1.124:8090/',
         // target: 'http://192.168.1.119:8090/',
         // target: 'http://192.168.24.5:8098',//目标地址
         // target: 'http://product-server.winsea.com/',