瀏覽代碼

前端sdy

zhongtianhaoyuan 4 年之前
父節點
當前提交
b4f1a43a02

+ 8 - 1
src/api/V2/warehouse/index.js

@@ -6,9 +6,16 @@ export const API_GET_WAREHOUSE_LOOK = '/warehouseBaseInfo/getWarehouse'
 export const API_GET_WAREHOUSE_CUSTOMDROPDOWN = '/warehouseBaseInfo/selectWarehouse'
 export const API_GET_WAREHOUSE_CUSTOMDROPDOWN = '/warehouseBaseInfo/selectWarehouse'
 
 
 export const API_GET_WAREHOUSE_DELETE = '/warehouseBaseInfo/api/deleteWarehouse'
 export const API_GET_WAREHOUSE_DELETE = '/warehouseBaseInfo/api/deleteWarehouse'
+
 //仓库编辑
 //仓库编辑
 export const API_POST_WAREHOUSE_EDIT = '/warehouseBaseInfo/api/editWarehouse'
 export const API_POST_WAREHOUSE_EDIT = '/warehouseBaseInfo/api/editWarehouse'
 //盘损
 //盘损
 export const API_POST_WAREHOUSE_IOSS = '/warehouseInventoryCountInfo/getInfo'
 export const API_POST_WAREHOUSE_IOSS = '/warehouseInventoryCountInfo/getInfo'
 //货名下拉
 //货名下拉
-export const API_POST_WAREHOUSE_NAME = '/warehousePositionStorageInfo/selectGoodsName'
+export const API_POST_WAREHOUSE_NAME = '/warehousePositionStorageInfo/selectGoodsName'
+
+// 货名等下拉
+export const API_GET_CUSTOMDROPDOWN_CUSTOMDROPDOWN = `/commonSysParameter/getInfo`
+// 入库添加
+export const API_POST_STORAGE_PUT = `/warehouseInOutInfo/InOutWarehouse `
+

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

@@ -9,6 +9,9 @@ import {
     API_POST_WAREHOUSE_EDIT,
     API_POST_WAREHOUSE_EDIT,
     API_POST_WAREHOUSE_IOSS,
     API_POST_WAREHOUSE_IOSS,
     API_POST_WAREHOUSE_NAME,
     API_POST_WAREHOUSE_NAME,
+    API_GET_CUSTOMDROPDOWN_CUSTOMDROPDOWN,
+    API_POST_STORAGE_PUT
+
 } from '@/api/V2/warehouse'
 } from '@/api/V2/warehouse'
 // 列表
 // 列表
 export const getList = appRx.get(API_GET_WAREHOUSE_BASEINFO, errorCatcher, errorHandle, filter)
 export const getList = appRx.get(API_GET_WAREHOUSE_BASEINFO, errorCatcher, errorHandle, filter)
@@ -25,4 +28,10 @@ export const edit = appRx.post(API_POST_WAREHOUSE_EDIT, errorCatcher, errorHandl
 //盘损
 //盘损
 export const ioss = appRx.post(API_POST_WAREHOUSE_IOSS, errorCatcher, errorHandle, filter)
 export const ioss = appRx.post(API_POST_WAREHOUSE_IOSS, errorCatcher, errorHandle, filter)
 //货名下拉
 //货名下拉
-export const goodsname = appRx.get(API_POST_WAREHOUSE_NAME, errorCatcher, errorHandle, filter)
+export const goodsname = appRx.get(API_POST_WAREHOUSE_NAME, errorCatcher, errorHandle, filter)
+
+// 货名等下拉
+export const pullDown = appRx.get(API_GET_CUSTOMDROPDOWN_CUSTOMDROPDOWN, errorCatcher, errorHandle, filter)
+// 入库添加
+export const addstorageputList = appRx.post(API_POST_STORAGE_PUT, errorCatcher, errorHandle, filter)
+

+ 2 - 5
src/views/contractManagement/salesContract.vue

@@ -620,12 +620,9 @@ export default {
 
 
     handleDelete(row) {
     handleDelete(row) {
       var handleDelete = ' '
       var handleDelete = ' '
-      if (row.handleDelete == '待执行' || row.handleDelete == '已完成') {
-        handleDelete = '执行中'
-      } else if (row.handleDelete == '执行中') {
-        handleDelete = '已完成'
+      if (row.handleDelete =='') {
       }
       }
-      this.$confirm(`合同删除后不可恢复,是否继续删除?`, '提示', {
+      this.$confirm(`此操作永久删除该仓库全部信息,是否确认删除`, {
         cancelButtonText: '取消',
         cancelButtonText: '取消',
         confirmButtonText: '确定',
         confirmButtonText: '确定',
         type: 'warning',
         type: 'warning',

+ 3 - 3
src/views/warehouse/warehouseManagementDelete.vue

@@ -1,6 +1,6 @@
+//删除仓库
 <template>
 <template>
-  <div >
-      
+  <div > 
      <el-row>
      <el-row>
       <el-col :span="20">
       <el-col :span="20">
         <h2 class="bg-left title">删除仓库</h2>
         <h2 class="bg-left title">删除仓库</h2>
@@ -388,7 +388,7 @@ export default {
               this.getList()
               this.getList()
             })
             })
             .catch((response) => {
             .catch((response) => {
-              // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+              
             })
             })
         })
         })
         .catch(() => {
         .catch(() => {

+ 359 - 271
src/views/warehouse/warehouseManagementDelivery.vue

@@ -1,9 +1,9 @@
-// 库登记
+// 库登记
 <template>
 <template>
   <div class="container">
   <div class="container">
     <el-row>
     <el-row>
       <el-col :span="20">
       <el-col :span="20">
-        <h2 class="bg-left title">库登记</h2>
+        <h2 class="bg-left title">库登记</h2>
       </el-col>
       </el-col>
       <el-col :span="4" class="bg-right">
       <el-col :span="4" class="bg-right">
         <el-button
         <el-button
@@ -15,223 +15,224 @@
         >
         >
       </el-col>
       </el-col>
     </el-row>
     </el-row>
-    <div class="center">
-      <h2>鲅鱼圈一号库 102仓位</h2>
-      <ws-form ref="deptBudgetList" :model="deptBudgetList">
-        <!-- 货名 -->
-        <ws-form-item label="货名" span="1" class="readonly">
-          <ws-select
-            placeholder=""
-            class="typeselect"
-            @change="selectpackingMethod"
+
+    <ws-form ref="deptBudgetList" :model="deptBudgetList" :rules="rules">
+      <div class="basicInformation">
+        <h2>
+          {{ deptBudgetList.warehouseName }}库
+          {{ deptBudgetList.binNumber }}仓位
+        </h2>
+        <ws-info-table>
+          <!-- 货名 -->
+          <ws-form-item label="货名" span="1">
+            <ws-select
+              v-model="deptBudgetList.goodsName"
+              placeholder=""
+              class="typeselect"
+              @change="selectgoodsName"
+            >
+              <ws-option
+                v-for="item in goodnameList"
+                :key="item.constKey"
+                :label="item.constValue"
+                :value="item.constValue"
+              />
+            </ws-select>
+          </ws-form-item>
+          <!--毛重(吨)-->
+          <ws-form-item label="毛重(吨)" span="1" prop="grossWeight">
+            <ws-input
+              @input="grossWeightchange"
+              v-model="deptBudgetList.grossWeight"
+              placeholder="请输入毛重"
+              maxlength="20"
+              size="small"
+            />
+          </ws-form-item>
+
+          <!--皮重(吨)-->
+          <ws-form-item
+            label="皮重(吨)"
+            span="1"
+            prop="tare"
+            class="readonly"
           >
           >
-            <ws-option
-              v-for="item in goodnameList"
-              :key="item.constKey"
-              :label="item.constValue"
-              :value="item.constValue"
+            <ws-input
+              @input="tarechange"
+              v-model="deptBudgetList.tare"
+              placeholder="请输入皮重"
+              maxlength="100"
+              size="small"
             />
             />
-          </ws-select>
-        </ws-form-item>
-        <!--毛重(吨)-->
-        <ws-form-item label="毛重(吨)" span="1" prop="shippingType">
+          </ws-form-item>
+
+          <!--净重(吨)-->
+          <ws-form-item label="净重(吨)" span="1" prop="netWeight">
+            <ws-input
+              v-model.number="deptBudgetList.netWeight"
+              placeholder="不可编辑,自动计算"
+              type="number"
+              maxlength="120"
+              size="small"
+            />
+          </ws-form-item>
+          <!-- 品级 -->
+          <ws-form-item label="品级" span="1" class="readonly">
+            <ws-select
+              v-model="deptBudgetList.grade"
+              placeholder=""
+              class="typeselect"
+              @change="selectpackingMethod"
+            >
+              <ws-option
+                v-for="item in gradeList"
+                :key="item.constKey"
+                :label="item.constValue"
+                :value="item.constValue"
+              />
+            </ws-select>
+          </ws-form-item>
+
+          <!--经办人-->
+          <ws-form-item label="经办人" span="1" prop="agent">
+            <ws-input
+              v-model="deptBudgetList.agent"
+              placeholder="请输入出库经办人姓名"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <!--出库日期-->
+          <ws-form-item
+            label="出库日期"
+            span="1"
+            prop="inOutDate"
+            class="deliverydate"
+          >
+            <ws-date-picker
+              v-model="deptBudgetList.inOutDate"
+              type="date"
+              placeholder="请选择出库日期"
+              value-format="yyyy-MM-dd"
+            />
+          </ws-form-item>
+          <!-- 入库类型 -->
+          <ws-form-item label="出库类型" span="1">
+            <ws-select
+              v-model="deptBudgetList.inOutType"
+              placeholder=""
+              class="typeselect"
+              @change="selectstorageType"
+            >
+              <ws-option
+                v-for="item in storageType"
+                :key="item.constKey"
+                :label="item.constValue"
+                :value="item.constValue"
+              />
+            </ws-select>
+          </ws-form-item>
+
+          <!--车牌号-->
+          <ws-form-item label="车牌号" span="1" prop="sourceGoods">
+            <ws-input
+              v-model="deptBudgetList.carNo"
+              placeholder="请输入车牌号"
+              maxlength="20"
+              size="small"
+            />
+          </ws-form-item>
+
+          <!--合同编号-->
+          <ws-form-item label="合同编号" span="1" prop="contractNo">
+            <ws-input
+              v-model="deptBudgetList.contractNo"
+              placeholder="请输入合同编号"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+        </ws-info-table>
+      </div>
+      <ws-upload
+        ref="upload"
+        table-name="maintain_work_order"
+        oss-key="mainPlan"
+        :comp-id="compId"
+        :appendix-ids="appendixIdsAdd"
+        :vesselId="deptBudgetList.addressUrl"
+        :size-limit="size"
+        @uploadSuccess="uploadSuccess"
+        @onChange="onChange"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
+      <h2>化验数据(选填)</h2>
+      <ws-info-table>
+        <!--自检员-->
+        <ws-form-item label="质检员" span="1" prop="qualityInspector">
           <ws-input
           <ws-input
-            v-model="deptBudgetList.shippingType"
-            placeholder="请输入毛重"
-            maxlength="20"
+            v-model="deptBudgetList.warehouseInOutDetail.qualityInspector"
+            placeholder="请输入质检员姓名"
+            maxlength="120"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
 
 
-        <!--皮重(吨)-->
-        <ws-form-item label="皮重(吨)" span="1" prop="buyer" class="readonly">
+        <!--水分(%)<=-->
+        <ws-form-item label="水分(%)<=" span="1" prop="waterContent">
           <ws-input
           <ws-input
-            v-model="deptBudgetList.buyer"
-            placeholder="请输入皮重"
-            maxlength="100"
+            v-model="deptBudgetList.warehouseInOutDetail.waterContent"
+            placeholder="请输入水分占比"
+            maxlength="120"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-
-        <!--净重(吨)-->
-        <ws-form-item label="净重(吨)" span="1" prop="settlementMethod">
+        <!--杂质(%)<=-->
+        <ws-form-item label="杂质(%)<=" span="1" prop="impurity">
           <ws-input
           <ws-input
-            v-model="deptBudgetList.settlementMethod"
-            placeholder="不可编辑,自动计算"
+            v-model="deptBudgetList.warehouseInOutDetail.impurity"
+            placeholder="请输入杂质占比"
             maxlength="120"
             maxlength="120"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-        <!-- 品级 -->
-        <ws-form-item label="品级" span="1" class="readonly">
-          <ws-select
-            placeholder=""
-            class="typeselect"
-            @change="selectpackingMethod"
-          >
-            <ws-option
-              v-for="item in goodnameList"
-              :key="item.constKey"
-              :label="item.constValue"
-              :value="item.constValue"
-            />
-          </ws-select>
-        </ws-form-item>
-
-        <!--经办人-->
-        <ws-form-item label="经办人" span="1" prop="seller" class="readonly">
+        <!--容重(克/升)>=-->
+        <ws-form-item label="容重(克/升)>=" span="1" prop="bulkDensity">
           <ws-input
           <ws-input
-            v-model="deptBudgetList.seller"
-            placeholder="请输入出库经办人姓名"
-            maxlength="100"
+            v-model="deptBudgetList.warehouseInOutDetail.bulkDensity"
+            placeholder="请输入容重"
+            maxlength="120"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-        <!--出库日期-->
-        <ws-form-item label="出库日期" span="1" prop="signingDate">
-          <ws-date-picker 
-            v-model="deptBudgetList.signingDate"
-            type="date"
-            placeholder="请选择出库日期"
-            value-format="yyyy-MM-dd"
+        <!--霉变粒(%)<=-->
+        <ws-form-item label="霉变粒(%)<=" span="1" prop="mildewGrain">
+          <ws-input
+            v-model="deptBudgetList.warehouseInOutDetail.mildewGrain"
+            placeholder="请输入霉变粒占比"
+            maxlength="120"
+            size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-        <!-- 出库类型 -->
-        <ws-form-item label="入库信息" span="1" class="readonly">
-          <ws-select
-            placeholder=""
-            class="typeselect"
-            @change="selectpackingMethod"
-          >
-            <ws-option
-              v-for="item in goodnameList"
-              :key="item.constKey"
-              :label="item.constValue"
-              :value="item.constValue"
-            />
-          </ws-select>
-        </ws-form-item>
-
-        <!--车牌号-->
-        <ws-form-item label="车牌号" span="1" prop="sourceGoods">
+        <!--热损伤(%)<=-->
+        <ws-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
           <ws-input
           <ws-input
-            v-model="deptBudgetList.sourceGoods"
-            placeholder="请输入车牌号"
-            maxlength="20"
+            v-model="deptBudgetList.warehouseInOutDetail.jiaorenli"
+            placeholder="请输入热损伤占比"
+            maxlength="120"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-
-        <!--合同编号-->
-        <ws-form-item label="合同编号" span="1" prop="contractNo">
+        <!--不完整粒(%)<=-->
+        <ws-form-item label="不完整粒(%)<=" span="1" prop="imperfectGrain">
           <ws-input
           <ws-input
-            v-model.number="deptBudgetList.buyerPhone"
-            placeholder="请输入合同编号"
-            maxlength="100"
+            v-model="deptBudgetList.warehouseInOutDetail.imperfectGrain"
+            placeholder="请输入不完整粒占比"
+            maxlength="120"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-
-        <ws-upload
-          ref="upload"
-          table-name="maintain_work_order"
-          oss-key="mainPlan"
-          :comp-id="compId"
-          :appendix-ids="appendixIdsAdd"
-          :vesselId="deptBudgetList.addressUrl"
-          :size-limit="size"
-          @uploadSuccess="uploadSuccess"
-          @onChange="onChange"
-          accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
-        />
-       
-        <div class="choice">
-          <h2>化验数据(选填)</h2>
-          <ws-info-table>
-            <!--自检员-->
-            <ws-form-item label="自检员" span="1" prop="settlementMethod">
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入自检员姓名"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-
-            <!--水分(%)<=-->
-            <ws-form-item label="水分(%)<=" span="1" prop="settlementMethod">
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入水分占比"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-            <!--杂质(%)<=-->
-            <ws-form-item label="杂质(%)<=" span="1" prop="settlementMethod">
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入杂质占比"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-            <!--容重(克/升)>=-->
-            <ws-form-item
-              label="容重(克/升)>="
-              span="1"
-              prop="settlementMethod"
-            >
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入容重"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-            <!--霉变粒(%)<=-->
-            <ws-form-item
-              label="霉变粒(%)<="
-              span="1"
-              prop="settlementMethod"
-            >
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入霉变粒占比"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-            <!--热损伤(%)<=-->
-            <ws-form-item
-              label="热损伤(%)<="
-              span="1"
-              prop="settlementMethod"
-            >
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入热损伤占比"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-            <!--不完整粒(%)<=-->
-            <ws-form-item
-              label="不完整粒(%)<="
-              span="1"
-              prop="settlementMethod"
-            >
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入不完整粒占比"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-          </ws-info-table>
-        </div>
-      
-
+      </ws-info-table>
       <div style="text-align: right; padding: 10px">
       <div style="text-align: right; padding: 10px">
         <el-button
         <el-button
           class="bg-bottom-up"
           class="bg-bottom-up"
@@ -241,12 +242,11 @@
           >提交</el-button
           >提交</el-button
         >
         >
       </div>
       </div>
-      </ws-form>
-    </div> 
+    </ws-form>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import { getList, export1, billoperatehis } from '@/model/contarct/index'
+import { pullDown, addstorageputList } from '@/model/warehouse/index'
 import { downloadFile } from '@/utils/batchDown'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
 import WsUpload from '@/components/WsUpload'
@@ -259,9 +259,9 @@ export default {
     Pagination,
     Pagination,
   },
   },
   watch: {
   watch: {
-    vesselId(val) {
-      this.getList()
-    },
+    // vesselId(val) {
+    //   this.getList()
+    // },
     isShow(val) {
     isShow(val) {
       this.showType = val
       this.showType = val
     },
     },
@@ -287,15 +287,24 @@ export default {
       contractType: 2,
       contractType: 2,
       startDate: null,
       startDate: null,
       endDate: null,
       endDate: null,
-      goodnameList:{},
+      goodnameList: {},
       // 提交类型
       // 提交类型
       submitType: true,
       submitType: true,
-      selectpackingMethod:{},
-
-      appendixIdsAdd:{},
-      uploadSuccess:{},
-      onChange:{},
-
+      storageType: [],
+      appendixIdsAdd: '',
+      uploadSuccess: {},
+      onChange: {},
+      gradeList: [],
+      rules: {
+        netWeight: [
+          {
+            required: true,
+            type: 'number',
+            message: '请输入活动名称',
+            trigger: 'blur',
+          },
+        ],
+      },
       size: 10,
       size: 10,
       compId: sessionStorage.getItem('ws-pf_compId'),
       compId: sessionStorage.getItem('ws-pf_compId'),
       deptCircularPage: {},
       deptCircularPage: {},
@@ -305,7 +314,9 @@ export default {
         month: dayjs().format('MM'),
         month: dayjs().format('MM'),
       },
       },
       contractList: [],
       contractList: [],
-      deptBudgetList: {},
+      deptBudgetList: {
+        warehouseInOutDetail: {},
+      },
       historyList: [],
       historyList: [],
 
 
       pickerBeginDateBefore: {
       pickerBeginDateBefore: {
@@ -316,13 +327,23 @@ export default {
       accessoryTFs: false,
       accessoryTFs: false,
     }
     }
   },
   },
-  activated() {
-    //cg.viewBudget
-    //cg.viewSpareMoney
-    // this.getVesselData();
+  mounted() {
+    console.log(this.$route.query)
+    this.deptBudgetList.baseId = this.$route.query.baseId
+    this.deptBudgetList.positionId = this.$route.query.positionId
+    this.deptBudgetList.warehouseName = this.$route.query.warehouseName
+    this.deptBudgetList.binNumber = this.$route.query.binNumber
     this.getList()
     this.getList()
-    this.showType = this.isShow
   },
   },
+  // activated() {
+  //   //cg.viewBudget
+  //   //cg.viewSpareMoney
+  //   // this.getVesselData();
+  //   console.log(2222)
+  //   this.getList()
+  //   console.log(1111)
+  //   this.showType = this.isShow
+  // },
   methods: {
   methods: {
     //返回按钮
     //返回按钮
     returnWarehouse() {
     returnWarehouse() {
@@ -330,29 +351,56 @@ export default {
     },
     },
     //提交按钮
     //提交按钮
     submit() {
     submit() {
-      this.$router.push({ path: 'warehouseManagementList' })
+      this.$refs.deptBudgetList.validate((valid) => {
+        if (valid) {
+          this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
+          this.deptBudgetList.inOutFlag = 1
+          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) {
+        this.deptBudgetList.netWeight = Number(
+          this.deptBudgetList.grossWeight - this.deptBudgetList.tare
+        )
+      }
+    },
+    grossWeightchange(e) {
+      if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
+        this.deptBudgetList.netWeight = Number(
+          this.deptBudgetList.grossWeight - this.deptBudgetList.tare
+        )
+      }
+    },
+    selectgoodsName(e) {
+      for (var i = 0; i < this.goodnameList.length; i++) {
+        if (this.goodnameList[i].constValue == e) {
+          this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
+        }
+      }
     },
     },
-    dateFormat(fmt, date) {
-      let ret
-      const opt = {
-        'Y+': date.getFullYear().toString(), // 年
-        'm+': (date.getMonth() + 1).toString(), // 月
-        'd+': date.getDate().toString(), // 日
-        'H+': date.getHours().toString(), // 时
-        // "M+": date.getMinutes().toString(),         // 分
-        // "S+": date.getSeconds().toString()          // 秒
-        // 有其他格式化字符需求可以继续添加,必须转化成字符串
+    selectpackingMethod(e) {
+      for (var i = 0; i < this.packtypeList.length; i++) {
+        if (this.packtypeList[i].constValue == e) {
+          this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
+        }
       }
       }
-      for (let k in opt) {
-        ret = new RegExp('(' + k + ')').exec(fmt)
-        if (ret) {
-          fmt = fmt.replace(
-            ret[1],
-            ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
-          )
+    },
+    selectstorageType(e) {
+      for (var i = 0; i < this.storageType.length; i++) {
+        if (this.storageType[i].constValue == e) {
+          this.deptBudgetList.inOutTypeKey = this.storageType[i].constKey
         }
         }
       }
       }
-      return fmt
     },
     },
     handleClose() {
     handleClose() {
       this.accessoryTFs = false
       this.accessoryTFs = false
@@ -368,32 +416,23 @@ export default {
       this.getList()
       this.getList()
     },
     },
     getList() {
     getList() {
-      getList({
-        compId: sessionStorage.getItem('ws-pf_compId'),
-        contractType: this.contractType,
-        currentPage: this.currentPage,
-        pageSize: this.pageSize,
-        searchType: this.searchType,
-        searchKeyWord: this.searchKeyWord,
-        startDate: this.startDate,
-        endDate: this.endDate,
-        contrPage: this.contrPage,
-      })
+      // 货名
+      pullDown({ constId: 'CON2' })
+        .toPromise()
+        .then((response) => {
+          this.goodnameList = response
+        })
+      // 品级
+      pullDown({ constId: 'CON3' })
+        .toPromise()
+        .then((response) => {
+          this.gradeList = response
+        })
+      // 类型
+      pullDown({ constId: 'CON5' })
         .toPromise()
         .toPromise()
         .then((response) => {
         .then((response) => {
-          for (var i = 0; i < response.records.length; i++) {
-            if (response.records[i].addressUrl != null) {
-              response.records[i].addressUrlArray = response.records[
-                i
-              ].addressUrl.split(',')
-            } else {
-              response.records[i].addressUrlArray = []
-            }
-          }
-          this.deptCircularPage.currentPage = response.current
-          this.deptCircularPage.pageSize = response.size
-          this.deptBudgetTotal = response.total
-          this.contractList = response
+          this.storageType = response
         })
         })
     },
     },
     selecttaskType(e) {
     selecttaskType(e) {
@@ -436,8 +475,30 @@ export default {
           this.historyList = response
           this.historyList = response
         })
         })
     },
     },
-  
-   
+
+    async exportlist() {
+      const { data } = await export1(
+        {
+          compId: sessionStorage.getItem('ws-pf_compId'),
+          contractType: this.contractType,
+          currentPage: this.currentPage,
+          pageSize: this.pageSize,
+          searchType: this.searchType,
+          searchKeyWord: this.searchKeyWord,
+          startDate: this.startDate,
+          endDate: this.endDate,
+        },
+        {},
+        { responseType: 'blob' }
+      ).toPromise()
+      downloadFile({
+        res: data,
+        fileName: `${
+          this.date.year + (this.date.month ? `-${this.date.month}` : '')
+        }_采购合同`,
+        type: 'xls',
+      })
+    },
     // deletecontract(){},
     // deletecontract(){},
     //删除
     //删除
     approve() {},
     approve() {},
@@ -449,50 +510,77 @@ export default {
 }
 }
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-.container .bg-left {
-  margin-left: 40px;
+/deep/.basicInformation {
+  .ws-info-table {
+    border: none;
+  }
+  .el-form-item {
+    width: 33.3333%;
+    border: none;
+    .el-form-item__label {
+      background: transparent;
+      border: none;
+    }
+    .el-form-item__content {
+      border: none;
+    }
+  }
+}
+.title {
+  position: relative;
+  padding-left: 10px;
 }
 }
-.container .bg-bottom {
+.title::before {
+  content: '';
+  display: inline-block;
+  width: 5px;
+  height: 30px;
+  background: #5473e8;
   position: absolute;
   position: absolute;
-  float: right;
-  top: 15px;
-  right: 20px;
+  left: 0;
+}
+.el-form {
+  padding: 0 10%;
+}
+.el-button--primary {
+  background-color: #5878e8;
+  border-color: #5878e8;
+}
+.el-col {
+  background: #f6f7fc;
+}
+.bg-right {
+  text-align: right;
+  padding: 16px 20px;
 }
 }
 .center {
 .center {
   position: relative;
   position: relative;
   top: 50px;
   top: 50px;
-  width: 50%;
+  width: 40%;
   height: 2000px;
   height: 2000px;
   margin: 0 auto;
   margin: 0 auto;
 }
 }
-
 /deep/.el-form-item__label {
 /deep/.el-form-item__label {
   width: 160px;
   width: 160px;
 }
 }
 /deep/.el-input--small {
 /deep/.el-input--small {
   width: 70%;
   width: 70%;
 }
 }
-.container .bg-bottom {
-  position: absolute;
-  float: right;
-  top: 15px;
-  right: 20px;
-}
 //选填
 //选填
-/deep/.el-form-item{
+/deep/.el-form-item {
   width: 50%;
   width: 50%;
 }
 }
 .container {
 .container {
   overflow: scroll;
   overflow: scroll;
   height: 120vh;
   height: 120vh;
 }
 }
-/deep/.ws-info-table .el-form-item .el-form-item__label{
+/deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
   text-align: center;
   text-align: center;
 }
 }
-.deliverydate{
+.deliverydate {
   width: 35%;
   width: 35%;
 }
 }
-.center{
+.center[data-v-32a9842f] {
   margin-top: -60px;
   margin-top: -60px;
 }
 }
 </style>
 </style>

+ 121 - 36
src/views/warehouse/warehouseManagementList.vue

@@ -78,40 +78,73 @@
         </el-table-column>
         </el-table-column>
         <el-table-column prop="binNumber" label="仓位编号" width="80">
         <el-table-column prop="binNumber" label="仓位编号" width="80">
         </el-table-column>
         </el-table-column>
-        <el-table-column prop="capacity" label="容量(吨)"> </el-table-column>
-        <el-table-column prop="inNetWeight" label="入库量(吨)">
+        <el-table-column prop="capacity" label="容量(吨)">
+          <template slot-scope="scope">
+            <div
+              v-if="scope.row.capacity != 'null' && scope.row.capacity != null"
+            >
+              {{ scope.row.capacity }}
+            </div>
+          </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column prop="outNetWeight" label="出库量(吨)">
+        <el-table-column label="品种">
+          <template slot-scope="scope">
+            <div v-for="(item, i) in scope.row.warehouseNumViewList">
+              {{ item.goodsName }}
+            </div>
+          </template>
         </el-table-column>
         </el-table-column>
-        <el-table-column prop="storage" label="应余量(吨)"> </el-table-column>
-        <el-table-column prop="seller" label="出入库" width="160">
-          <button
-            type="primary"
-            @click="nocomplete()"
-            v-hasPermission="
-              `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-            "
-          >
-            待完成
-          </button>
-          <button
-            type="primary"
-            @click="delivery()"
-            v-hasPermission="
-              `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-            "
-          >
-            出库
-          </button>
-          <button
-            type="primary"
-            @click="warehousing()"
-            v-hasPermission="
-              `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
-            "
-          >
-            入库
-          </button>
+        <el-table-column label="入库量(吨)">
+          <template slot-scope="scope">
+            <div v-for="(item, i) in scope.row.warehouseNumViewList">
+              {{ item.inNetWeight }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="出库量(吨)">
+          <template slot-scope="scope">
+            <div v-for="(item, i) in scope.row.warehouseNumViewList">
+              {{ item.outNetWeight }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column label="应余量(吨)">
+          <template slot-scope="scope">
+            <div v-for="(item, i) in scope.row.warehouseNumViewList">
+              {{ item.storage }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="seller" label="出入库" width="300">
+          <template slot-scope="scope">
+            <ws-button
+              type="primary"
+              @click="nocomplete()"
+              v-hasPermission="
+                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+              "
+            >
+              待完成({{ scope.row.number }})
+            </ws-button>
+            <ws-button
+              type="primary"
+              @click="warehousing(scope.row)"
+              v-hasPermission="
+                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+              "
+            >
+              入库
+            </ws-button>
+            <ws-button
+              type="primary"
+              @click="delivery(scope.row)"
+              v-hasPermission="
+                `${$permission('PERMISSIONS.PURSPAPPLINFO_CREATEINSTORE')}`
+              "
+            >
+              出库
+            </ws-button>
+          </template>
         </el-table-column>
         </el-table-column>
         <el-table-column prop="address" label="操作" width="200">
         <el-table-column prop="address" label="操作" width="200">
           <!-- <template slot-scope="scope"> -->
           <!-- <template slot-scope="scope"> -->
@@ -188,6 +221,7 @@ export default {
       // 提交类型
       // 提交类型
       submitType: true,
       submitType: true,
       size: 10,
       size: 10,
+      spanArr: [],
       compId: sessionStorage.getItem('ws-pf_compId'),
       compId: sessionStorage.getItem('ws-pf_compId'),
       deptCircularPage: {},
       deptCircularPage: {},
       date: {
       date: {
@@ -214,12 +248,62 @@ export default {
   },
   },
   methods: {
   methods: {
     //出库
     //出库
-    delivery() {
-      this.$router.push({ path: 'warehouseManagementDelivery' })
+    delivery(item) {
+      this.$router.push({
+        path: 'warehouseManagementDelivery',
+        query: {
+          baseId: item.warehouseId,
+          positionId: item.binNumberId,
+          warehouseName: item.warehouseName,
+          binNumber: item.binNumber,
+        },
+      })
     },
     },
     //入库
     //入库
-    warehousing() {
-      this.$router.push({ path: 'warehouseManagementPut' })
+    warehousing(item) {
+      this.$router.push({
+        path: 'warehouseManagementPut',
+        query: {
+          baseId: item.warehouseId,
+          positionId: item.binNumberId,
+          warehouseName: item.warehouseName,
+          binNumber: item.binNumber,
+        },
+      })
+    },
+    getSpanArr(data) {
+      let that = this
+
+      //页面展示的数据,不一定是全部的数据,所以每次都清空之前存储的 保证遍历的数据是最新的数据。以免造成数据渲染混乱
+
+      that.spanArr = []
+
+      that.pos = 0
+
+      //遍历数据
+
+      data.forEach((item, index) => {
+        //判断是否是第一项
+
+        // if (index === 0) {
+        //   this.spanArr.push(1)
+        //   this.pos = 0
+        // } else {
+        //不是第一项时,就根据标识去存储
+        console.log(data[index].warehouseNumViewList.length)
+        if (data[index].warehouseNumViewList.length > 1) {
+          // 查找到符合条件的数据时每次要把之前存储的数据+1
+          this.spanArr[this.pos] = data[index].warehouseNumViewList.length
+          this.spanArr.push(0)
+        } else {
+          // 没有符合的数据时,要记住当前的index
+
+          this.spanArr.push(1)
+
+          this.pos = index
+        }
+        // }
+      })
     },
     },
     //待完成
     //待完成
     nocomplete() {
     nocomplete() {
@@ -294,6 +378,7 @@ export default {
       })
       })
         .toPromise()
         .toPromise()
         .then((response) => {
         .then((response) => {
+          this.getSpanArr(response)
           // for (var i = 0; i < response.records.length; i++) {
           // for (var i = 0; i < response.records.length; i++) {
           //   if (response.records[i].addressUrl != null) {
           //   if (response.records[i].addressUrl != null) {
           //     response.records[i].addressUrlArray = response.records[
           //     response.records[i].addressUrlArray = response.records[

+ 26 - 23
src/views/warehouse/warehouseManagementPerfectput.vue

@@ -88,7 +88,12 @@
           />
           />
         </ws-form-item>
         </ws-form-item>
         <!--出库日期-->
         <!--出库日期-->
-        <ws-form-item label="出库日期" span="1" prop="signingDate" class="deliverydate">
+        <ws-form-item
+          label="出库日期"
+          span="1"
+          prop="signingDate"
+          class="deliverydate"
+        >
           <ws-date-picker
           <ws-date-picker
             v-model="deptBudgetList.signingDate"
             v-model="deptBudgetList.signingDate"
             type="date"
             type="date"
@@ -144,7 +149,7 @@
           @onChange="onChange"
           @onChange="onChange"
           accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
           accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
         />
         />
-      
+
         <div class="choice">
         <div class="choice">
           <h2>化验数据(选填)</h2>
           <h2>化验数据(选填)</h2>
           <ws-info-table>
           <ws-info-table>
@@ -230,20 +235,18 @@
             </ws-form-item>
             </ws-form-item>
           </ws-info-table>
           </ws-info-table>
         </div>
         </div>
-      
 
 
-      <div style="text-align: right; padding: 10px">
-        <el-button
-          class="bg-bottom-up"
-          type="primary"
-          size="small"
-          @click="submit()"
-          >提交</el-button
-        >
-      </div>
-      
+        <div style="text-align: right; padding: 10px">
+          <el-button
+            class="bg-bottom-up"
+            type="primary"
+            size="small"
+            @click="submit()"
+            >提交</el-button
+          >
+        </div>
       </ws-form>
       </ws-form>
-    </div> 
+    </div>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
@@ -288,14 +291,14 @@ export default {
       contractType: 2,
       contractType: 2,
       startDate: null,
       startDate: null,
       endDate: null,
       endDate: null,
-      goodnameList:{},
+      goodnameList: {},
       // 提交类型
       // 提交类型
       submitType: true,
       submitType: true,
-      selectpackingMethod:{},
+      selectpackingMethod: {},
 
 
-      appendixIdsAdd:{},
-      uploadSuccess:{},
-      onChange:{},
+      appendixIdsAdd: {},
+      uploadSuccess: {},
+      onChange: {},
 
 
       size: 10,
       size: 10,
       compId: sessionStorage.getItem('ws-pf_compId'),
       compId: sessionStorage.getItem('ws-pf_compId'),
@@ -497,20 +500,20 @@ export default {
   right: 20px;
   right: 20px;
 }
 }
 //选填
 //选填
-/deep/.el-form-item{
+/deep/.el-form-item {
   width: 50%;
   width: 50%;
 }
 }
 .container {
 .container {
   overflow: scroll;
   overflow: scroll;
   height: 120vh;
   height: 120vh;
 }
 }
-/deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label{
+/deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
   text-align: center;
   text-align: center;
 }
 }
-.deliverydate{
+.deliverydate {
   width: 35%;
   width: 35%;
 }
 }
-.center[data-v-32a9842f]{
+.center[data-v-32a9842f] {
   margin-top: -60px;
   margin-top: -60px;
 }
 }
 </style>
 </style>

+ 335 - 292
src/views/warehouse/warehouseManagementPut.vue

@@ -15,223 +15,224 @@
         >
         >
       </el-col>
       </el-col>
     </el-row>
     </el-row>
-    <div class="center">
-      <h2>鲅鱼圈一号库 102仓位</h2>
-      <ws-form ref="deptBudgetList" :model="deptBudgetList">
-        <!-- 货名 -->
-        <ws-form-item label="货名" span="1" class="readonly">
-          <ws-select
-            placeholder=""
-            class="typeselect"
-            @change="selectpackingMethod"
+
+    <ws-form ref="deptBudgetList" :model="deptBudgetList" :rules="rules">
+      <div class="basicInformation">
+        <h2>
+          {{ deptBudgetList.warehouseName }}库
+          {{ deptBudgetList.binNumber }}仓位
+        </h2>
+        <ws-info-table>
+          <!-- 货名 -->
+          <ws-form-item label="货名" span="1">
+            <ws-select
+              v-model="deptBudgetList.goodsName"
+              placeholder=""
+              class="typeselect"
+              @change="selectgoodsName"
+            >
+              <ws-option
+                v-for="item in goodnameList"
+                :key="item.constKey"
+                :label="item.constValue"
+                :value="item.constValue"
+              />
+            </ws-select>
+          </ws-form-item>
+          <!--毛重(吨)-->
+          <ws-form-item label="毛重(吨)" span="1" prop="grossWeight">
+            <ws-input
+              @input="grossWeightchange"
+              v-model="deptBudgetList.grossWeight"
+              placeholder="请输入毛重"
+              maxlength="20"
+              size="small"
+            />
+          </ws-form-item>
+
+          <!--皮重(吨)-->
+          <ws-form-item
+            label="皮重(吨)"
+            span="1"
+            prop="tare"
+            class="readonly"
           >
           >
-            <ws-option
-              v-for="item in goodnameList"
-              :key="item.constKey"
-              :label="item.constValue"
-              :value="item.constValue"
+            <ws-input
+              @input="tarechange"
+              v-model="deptBudgetList.tare"
+              placeholder="请输入皮重"
+              maxlength="100"
+              size="small"
             />
             />
-          </ws-select>
-        </ws-form-item>
-        <!--毛重(吨)-->
-        <ws-form-item label="毛重(吨)" span="1" prop="shippingType">
+          </ws-form-item>
+
+          <!--净重(吨)-->
+          <ws-form-item label="净重(吨)" span="1" prop="netWeight">
+            <ws-input
+              v-model.number="deptBudgetList.netWeight"
+              placeholder="不可编辑,自动计算"
+              type="number"
+              maxlength="120"
+              size="small"
+            />
+          </ws-form-item>
+          <!-- 品级 -->
+          <ws-form-item label="品级" span="1" class="readonly">
+            <ws-select
+              v-model="deptBudgetList.grade"
+              placeholder=""
+              class="typeselect"
+              @change="selectpackingMethod"
+            >
+              <ws-option
+                v-for="item in gradeList"
+                :key="item.constKey"
+                :label="item.constValue"
+                :value="item.constValue"
+              />
+            </ws-select>
+          </ws-form-item>
+
+          <!--经办人-->
+          <ws-form-item label="经办人" span="1" prop="agent">
+            <ws-input
+              v-model="deptBudgetList.agent"
+              placeholder="请输入出库经办人姓名"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+          <!--出库日期-->
+          <ws-form-item
+            label="入库日期"
+            span="1"
+            prop="inOutDate"
+            class="deliverydate"
+          >
+            <ws-date-picker
+              v-model="deptBudgetList.inOutDate"
+              type="date"
+              placeholder="请选择入库日期"
+              value-format="yyyy-MM-dd"
+            />
+          </ws-form-item>
+          <!-- 入库类型 -->
+          <ws-form-item label="入库类型" span="1">
+            <ws-select
+              v-model="deptBudgetList.inOutType"
+              placeholder=""
+              class="typeselect"
+              @change="selectstorageType"
+            >
+              <ws-option
+                v-for="item in storageType"
+                :key="item.constKey"
+                :label="item.constValue"
+                :value="item.constValue"
+              />
+            </ws-select>
+          </ws-form-item>
+
+          <!--车牌号-->
+          <ws-form-item label="车牌号" span="1" prop="sourceGoods">
+            <ws-input
+              v-model="deptBudgetList.carNo"
+              placeholder="请输入车牌号"
+              maxlength="20"
+              size="small"
+            />
+          </ws-form-item>
+
+          <!--合同编号-->
+          <ws-form-item label="合同编号" span="1" prop="contractNo">
+            <ws-input
+              v-model="deptBudgetList.contractNo"
+              placeholder="请输入合同编号"
+              maxlength="100"
+              size="small"
+            />
+          </ws-form-item>
+        </ws-info-table>
+      </div>
+      <ws-upload
+        ref="upload"
+        table-name="maintain_work_order"
+        oss-key="mainPlan"
+        :comp-id="compId"
+        :appendix-ids="appendixIdsAdd"
+        :vesselId="deptBudgetList.addressUrl"
+        :size-limit="size"
+        @uploadSuccess="uploadSuccess"
+        @onChange="onChange"
+        accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
+      />
+      <h2>化验数据(选填)</h2>
+      <ws-info-table>
+        <!--自检员-->
+        <ws-form-item label="质检员" span="1" prop="qualityInspector">
           <ws-input
           <ws-input
-            v-model="deptBudgetList.shippingType"
-            placeholder="请输入毛重"
-            maxlength="20"
+            v-model="deptBudgetList.warehouseInOutDetail.qualityInspector"
+            placeholder="请输入质检员姓名"
+            maxlength="120"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
 
 
-        <!--皮重(吨)-->
-        <ws-form-item label="皮重(吨)" span="1" prop="buyer" class="readonly">
+        <!--水分(%)<=-->
+        <ws-form-item label="水分(%)<=" span="1" prop="waterContent">
           <ws-input
           <ws-input
-            v-model="deptBudgetList.buyer"
-            placeholder="请输入皮重"
-            maxlength="100"
+            v-model="deptBudgetList.warehouseInOutDetail.waterContent"
+            placeholder="请输入水分占比"
+            maxlength="120"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-
-        <!--净重(吨)-->
-        <ws-form-item label="净重(吨)" span="1" prop="settlementMethod">
+        <!--杂质(%)<=-->
+        <ws-form-item label="杂质(%)<=" span="1" prop="impurity">
           <ws-input
           <ws-input
-            v-model="deptBudgetList.settlementMethod"
-            placeholder="不可编辑,自动计算"
+            v-model="deptBudgetList.warehouseInOutDetail.impurity"
+            placeholder="请输入杂质占比"
             maxlength="120"
             maxlength="120"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-        <!-- 品级 -->
-        <ws-form-item label="品级" span="1" class="readonly">
-          <ws-select
-            placeholder=""
-            class="typeselect"
-            @change="selectpackingMethod"
-          >
-            <ws-option
-              v-for="item in goodnameList"
-              :key="item.constKey"
-              :label="item.constValue"
-              :value="item.constValue"
-            />
-          </ws-select>
-        </ws-form-item>
-
-        <!--经办人-->
-        <ws-form-item label="经办人" span="1" prop="seller" class="readonly">
+        <!--容重(克/升)>=-->
+        <ws-form-item label="容重(克/升)>=" span="1" prop="bulkDensity">
           <ws-input
           <ws-input
-            v-model="deptBudgetList.seller"
-            placeholder="请输入出库经办人姓名"
-            maxlength="100"
+            v-model="deptBudgetList.warehouseInOutDetail.bulkDensity"
+            placeholder="请输入容重"
+            maxlength="120"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-        <!--出库日期-->
-        <ws-form-item label="出库日期" span="1" prop="signingDate" class="deliverydate">
-          <ws-date-picker
-            v-model="deptBudgetList.signingDate"
-            type="date"
-            placeholder="请选择出库日期"
-            value-format="yyyy-MM-dd"
+        <!--霉变粒(%)<=-->
+        <ws-form-item label="霉变粒(%)<=" span="1" prop="mildewGrain">
+          <ws-input
+            v-model="deptBudgetList.warehouseInOutDetail.mildewGrain"
+            placeholder="请输入霉变粒占比"
+            maxlength="120"
+            size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-        <!-- 入库类型 -->
-        <ws-form-item label="入库类型" span="1" class="readonly">
-          <ws-select
-            placeholder=""
-            class="typeselect"
-            @change="selectpackingMethod"
-          >
-            <ws-option
-              v-for="item in goodnameList"
-              :key="item.constKey"
-              :label="item.constValue"
-              :value="item.constValue"
-            />
-          </ws-select>
-        </ws-form-item>
-
-        <!--车牌号-->
-        <ws-form-item label="车牌号" span="1" prop="sourceGoods">
+        <!--热损伤(%)<=-->
+        <ws-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
           <ws-input
           <ws-input
-            v-model="deptBudgetList.sourceGoods"
-            placeholder="请输入车牌号"
-            maxlength="20"
+            v-model="deptBudgetList.warehouseInOutDetail.jiaorenli"
+            placeholder="请输入热损伤占比"
+            maxlength="120"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-
-        <!--合同编号-->
-        <ws-form-item label="合同编号" span="1" prop="contractNo">
+        <!--不完整粒(%)<=-->
+        <ws-form-item label="不完整粒(%)<=" span="1" prop="imperfectGrain">
           <ws-input
           <ws-input
-            v-model.number="deptBudgetList.buyerPhone"
-            placeholder="请输入合同编号"
-            maxlength="100"
+            v-model="deptBudgetList.warehouseInOutDetail.imperfectGrain"
+            placeholder="请输入不完整粒占比"
+            maxlength="120"
             size="small"
             size="small"
           />
           />
         </ws-form-item>
         </ws-form-item>
-
-        <ws-upload
-          ref="upload"
-          table-name="maintain_work_order"
-          oss-key="mainPlan"
-          :comp-id="compId"
-          :appendix-ids="appendixIdsAdd"
-          :vesselId="deptBudgetList.addressUrl"
-          :size-limit="size"
-          @uploadSuccess="uploadSuccess"
-          @onChange="onChange"
-          accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
-        />
-      
-        <div class="choice">
-          <h2>化验数据(选填)</h2>
-          <ws-info-table>
-            <!--自检员-->
-            <ws-form-item label="自检员" span="1" prop="settlementMethod">
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入自检员姓名"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-
-            <!--水分(%)<=-->
-            <ws-form-item label="水分(%)<=" span="1" prop="settlementMethod">
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入水分占比"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-            <!--杂质(%)<=-->
-            <ws-form-item label="杂质(%)<=" span="1" prop="settlementMethod">
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入杂质占比"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-            <!--容重(克/升)>=-->
-            <ws-form-item
-              label="容重(克/升)>="
-              span="1"
-              prop="settlementMethod"
-            >
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入容重"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-            <!--霉变粒(%)<=-->
-            <ws-form-item
-              label="霉变粒(%)<="
-              span="1"
-              prop="settlementMethod"
-            >
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入霉变粒占比"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-            <!--热损伤(%)<=-->
-            <ws-form-item
-              label="热损伤(%)<="
-              span="1"
-              prop="settlementMethod"
-            >
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入热损伤占比"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-            <!--不完整粒(%)<=-->
-            <ws-form-item
-              label="不完整粒(%)<="
-              span="1"
-              prop="settlementMethod"
-            >
-              <ws-input
-                v-model="deptBudgetList.settlementMethod"
-                placeholder="请输入不完整粒占比"
-                maxlength="120"
-                size="small"
-              />
-            </ws-form-item>
-          </ws-info-table>
-        </div>
-      
-
+      </ws-info-table>
       <div style="text-align: right; padding: 10px">
       <div style="text-align: right; padding: 10px">
         <el-button
         <el-button
           class="bg-bottom-up"
           class="bg-bottom-up"
@@ -241,13 +242,11 @@
           >提交</el-button
           >提交</el-button
         >
         >
       </div>
       </div>
-      
-      </ws-form>
-    </div> 
+    </ws-form>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import { getList, export1, billoperatehis } from '@/model/contarct/index'
+import { pullDown, addstorageputList } from '@/model/warehouse/index'
 import { downloadFile } from '@/utils/batchDown'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
 import WsUpload from '@/components/WsUpload'
@@ -260,9 +259,9 @@ export default {
     Pagination,
     Pagination,
   },
   },
   watch: {
   watch: {
-    vesselId(val) {
-      this.getList()
-    },
+    // vesselId(val) {
+    //   this.getList()
+    // },
     isShow(val) {
     isShow(val) {
       this.showType = val
       this.showType = val
     },
     },
@@ -288,15 +287,24 @@ export default {
       contractType: 2,
       contractType: 2,
       startDate: null,
       startDate: null,
       endDate: null,
       endDate: null,
-      goodnameList:{},
+      goodnameList: {},
       // 提交类型
       // 提交类型
       submitType: true,
       submitType: true,
-      selectpackingMethod:{},
-
-      appendixIdsAdd:{},
-      uploadSuccess:{},
-      onChange:{},
-
+      storageType: [],
+      appendixIdsAdd: '',
+      uploadSuccess: {},
+      onChange: {},
+      gradeList: [],
+      rules: {
+        netWeight: [
+          {
+            required: true,
+            type: 'number',
+            message: '请输入活动名称',
+            trigger: 'blur',
+          },
+        ],
+      },
       size: 10,
       size: 10,
       compId: sessionStorage.getItem('ws-pf_compId'),
       compId: sessionStorage.getItem('ws-pf_compId'),
       deptCircularPage: {},
       deptCircularPage: {},
@@ -306,7 +314,9 @@ export default {
         month: dayjs().format('MM'),
         month: dayjs().format('MM'),
       },
       },
       contractList: [],
       contractList: [],
-      deptBudgetList: {},
+      deptBudgetList: {
+        warehouseInOutDetail: {},
+      },
       historyList: [],
       historyList: [],
 
 
       pickerBeginDateBefore: {
       pickerBeginDateBefore: {
@@ -317,13 +327,23 @@ export default {
       accessoryTFs: false,
       accessoryTFs: false,
     }
     }
   },
   },
-  activated() {
-    //cg.viewBudget
-    //cg.viewSpareMoney
-    // this.getVesselData();
+  mounted() {
+    console.log(this.$route.query)
+    this.deptBudgetList.baseId = this.$route.query.baseId
+    this.deptBudgetList.positionId = this.$route.query.positionId
+    this.deptBudgetList.warehouseName = this.$route.query.warehouseName
+    this.deptBudgetList.binNumber = this.$route.query.binNumber
     this.getList()
     this.getList()
-    this.showType = this.isShow
   },
   },
+  // activated() {
+  //   //cg.viewBudget
+  //   //cg.viewSpareMoney
+  //   // this.getVesselData();
+  //   console.log(2222)
+  //   this.getList()
+  //   console.log(1111)
+  //   this.showType = this.isShow
+  // },
   methods: {
   methods: {
     //返回按钮
     //返回按钮
     returnWarehouse() {
     returnWarehouse() {
@@ -331,29 +351,56 @@ export default {
     },
     },
     //提交按钮
     //提交按钮
     submit() {
     submit() {
-      this.$router.push({ path: 'warehouseManagementList' })
+      this.$refs.deptBudgetList.validate((valid) => {
+        if (valid) {
+          this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
+          this.deptBudgetList.inOutFlag = 2
+          addstorageputList(this.deptBudgetList)
+            .toPromise()
+            .then((response) => {
+              this.$message.success('添加成功')
+              this.$router.push({ path: 'warehouseManagementList' })
+            })
+        } else {
+          EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+          return false
+        }
+      })
     },
     },
-    dateFormat(fmt, date) {
-      let ret
-      const opt = {
-        'Y+': date.getFullYear().toString(), // 年
-        'm+': (date.getMonth() + 1).toString(), // 月
-        'd+': date.getDate().toString(), // 日
-        'H+': date.getHours().toString(), // 时
-        // "M+": date.getMinutes().toString(),         // 分
-        // "S+": date.getSeconds().toString()          // 秒
-        // 有其他格式化字符需求可以继续添加,必须转化成字符串
+    tarechange(e) {
+      if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
+        this.deptBudgetList.netWeight = Number(
+          this.deptBudgetList.grossWeight - this.deptBudgetList.tare
+        )
+      }
+    },
+    grossWeightchange(e) {
+      if (this.deptBudgetList.grossWeight && this.deptBudgetList.tare) {
+        this.deptBudgetList.netWeight = Number(
+          this.deptBudgetList.grossWeight - this.deptBudgetList.tare
+        )
+      }
+    },
+    selectgoodsName(e) {
+      for (var i = 0; i < this.goodnameList.length; i++) {
+        if (this.goodnameList[i].constValue == e) {
+          this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
+        }
+      }
+    },
+    selectpackingMethod(e) {
+      for (var i = 0; i < this.packtypeList.length; i++) {
+        if (this.packtypeList[i].constValue == e) {
+          this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
+        }
       }
       }
-      for (let k in opt) {
-        ret = new RegExp('(' + k + ')').exec(fmt)
-        if (ret) {
-          fmt = fmt.replace(
-            ret[1],
-            ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
-          )
+    },
+    selectstorageType(e) {
+      for (var i = 0; i < this.storageType.length; i++) {
+        if (this.storageType[i].constValue == e) {
+          this.deptBudgetList.inOutTypeKey = this.storageType[i].constKey
         }
         }
       }
       }
-      return fmt
     },
     },
     handleClose() {
     handleClose() {
       this.accessoryTFs = false
       this.accessoryTFs = false
@@ -369,32 +416,23 @@ export default {
       this.getList()
       this.getList()
     },
     },
     getList() {
     getList() {
-      getList({
-        compId: sessionStorage.getItem('ws-pf_compId'),
-        contractType: this.contractType,
-        currentPage: this.currentPage,
-        pageSize: this.pageSize,
-        searchType: this.searchType,
-        searchKeyWord: this.searchKeyWord,
-        startDate: this.startDate,
-        endDate: this.endDate,
-        contrPage: this.contrPage,
-      })
+      // 货名
+      pullDown({ constId: 'CON2' })
         .toPromise()
         .toPromise()
         .then((response) => {
         .then((response) => {
-          for (var i = 0; i < response.records.length; i++) {
-            if (response.records[i].addressUrl != null) {
-              response.records[i].addressUrlArray = response.records[
-                i
-              ].addressUrl.split(',')
-            } else {
-              response.records[i].addressUrlArray = []
-            }
-          }
-          this.deptCircularPage.currentPage = response.current
-          this.deptCircularPage.pageSize = response.size
-          this.deptBudgetTotal = response.total
-          this.contractList = response
+          this.goodnameList = response
+        })
+      // 品级
+      pullDown({ constId: 'CON3' })
+        .toPromise()
+        .then((response) => {
+          this.gradeList = response
+        })
+      // 类型
+      pullDown({ constId: 'CON5' })
+        .toPromise()
+        .then((response) => {
+          this.storageType = response
         })
         })
     },
     },
     selecttaskType(e) {
     selecttaskType(e) {
@@ -437,46 +475,57 @@ export default {
           this.historyList = response
           this.historyList = response
         })
         })
     },
     },
-    find() {
-      this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
-      this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
-      this.currentPage = 1
-      this.getList()
-    },
-    async exportlist() {
-      const { data } = await export1(
-        {
-          compId: sessionStorage.getItem('ws-pf_compId'),
-          contractType: this.contractType,
-          currentPage: this.currentPage,
-          pageSize: this.pageSize,
-          searchType: this.searchType,
-          searchKeyWord: this.searchKeyWord,
-          startDate: this.startDate,
-          endDate: this.endDate,
-        },
-        {},
-        { responseType: 'blob' }
-      ).toPromise()
-      downloadFile({
-        res: data,
-        fileName: `${
-          this.date.year + (this.date.month ? `-${this.date.month}` : '')
-        }_采购合同`,
-        type: 'xls',
-      })
-    },
     // deletecontract(){},
     // deletecontract(){},
     //删除
     //删除
     approve() {},
     approve() {},
     listQuery() {},
     listQuery() {},
-    total() {},
-    clearfiltQuery() {},
-    selectCrtDuty() {},
   },
   },
 }
 }
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>
+/deep/.basicInformation {
+  .ws-info-table {
+    border: none;
+  }
+  .el-form-item {
+    width: 33.3333%;
+    border: none;
+    .el-form-item__label {
+      background: transparent;
+      border: none;
+    }
+    .el-form-item__content {
+      border: none;
+    }
+  }
+}
+.title {
+  position: relative;
+  padding-left: 10px;
+}
+.title::before {
+  content: '';
+  display: inline-block;
+  width: 5px;
+  height: 30px;
+  background: #5473e8;
+  position: absolute;
+  left: 0;
+}
+.el-form {
+  padding: 0 10%;
+}
+.el-button--primary {
+  background-color: #5878e8;
+  border-color: #5878e8;
+}
+.el-col {
+  background: #f6f7fc;
+}
+.bg-right {
+  text-align: right;
+  padding: 16px 20px;
+}
 .center {
 .center {
   position: relative;
   position: relative;
   top: 50px;
   top: 50px;
@@ -490,27 +539,21 @@ export default {
 /deep/.el-input--small {
 /deep/.el-input--small {
   width: 70%;
   width: 70%;
 }
 }
-.container .bg-bottom {
-  position: absolute;
-  float: right;
-  top: 15px;
-  right: 20px;
-}
 //选填
 //选填
-/deep/.el-form-item{
+/deep/.el-form-item {
   width: 50%;
   width: 50%;
 }
 }
 .container {
 .container {
   overflow: scroll;
   overflow: scroll;
   height: 120vh;
   height: 120vh;
 }
 }
-/deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label{
+/deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
   text-align: center;
   text-align: center;
 }
 }
-.deliverydate{
+.deliverydate {
   width: 35%;
   width: 35%;
 }
 }
-.center[data-v-32a9842f]{
+.center[data-v-32a9842f] {
   margin-top: -60px;
   margin-top: -60px;
 }
 }
 </style>
 </style>

+ 3 - 3
src/winseaUi/WsFormItem/src/index.vue

@@ -7,7 +7,7 @@ Rising * @Last Modified time: 2020-01-03 16:36:23 * @Description: WsForm辅助
     :label="label"
     :label="label"
     :rules="rules"
     :rules="rules"
     :prop="prop"
     :prop="prop"
-    :required="JSON.stringify(rules) == '{}' ? false : requireFlag"
+    :required="JSON.stringify(rules) == '[]' ? false : requireFlag"
     :class="{
     :class="{
       showInputToopTip: showInputToopTip,
       showInputToopTip: showInputToopTip,
       showLableToopTip: showLableToopTip,
       showLableToopTip: showLableToopTip,
@@ -41,9 +41,9 @@ export default {
       default: null,
       default: null,
     },
     },
     rules: {
     rules: {
-      type: Object,
+      type: Array,
       default() {
       default() {
-        return {}
+        return []
       },
       },
     },
     },
     // 检验索引key
     // 检验索引key