浏览代码

前端质检管理 sdy

zhongtianhaoyuan 3 年之前
父节点
当前提交
c2d548be22

+ 9 - 0
src/api/V2/houseSelfCollect/index.js

@@ -22,4 +22,13 @@ export const API_POST_PURCHASEPRICE_DEL = '/purchasePrice/purchasePriceDel'
 export const API_POST_PURCHASEPRICE_ALLOWEDIT = '/purchasePrice/purchasePriceAllowEdit'
 //查询仓库列表
 export const API_GET_WAREHOUSESELF = '/warehouseBaseInfo/selectWarehouseSelf'
+//客户修改
+export const API_POST_CUSTOMER_EDIT = '/identityAuthenticationInfo/api/editIdentityAuthenticationInfo'
+//质检添加
+export const API_POST_INSPECT_ADD = '/qualityInspectionManagement/api/addQualityInspection'
+//质检仓位下拉
+export const API_GET_INSPECT_GETBINNUMBER = '/warehouseBaseInfo/getWarehouse'
+//客户下拉
+export const API_GET_INSPECT_GETCUSTOMER = '/identityAuthenticationInfo/identityAuthenticationInfoCustomer'
+
 

+ 13 - 2
src/model/houseSelfCollect/index.js

@@ -13,7 +13,11 @@ import {
   API_POST_PURCHASEPRICE_EDIT,
   API_POST_PURCHASEPRICE_DEL,
   API_POST_PURCHASEPRICE_ALLOWEDIT,
-  API_GET_WAREHOUSESELF
+  API_GET_WAREHOUSESELF,
+  API_POST_CUSTOMER_EDIT,
+  API_POST_INSPECT_ADD,
+  API_GET_INSPECT_GETBINNUMBER,
+  API_GET_INSPECT_GETCUSTOMER,
 
 } from '@/api/V2/houseSelfCollect'
 //客户管理列表
@@ -41,6 +45,13 @@ export const purchasePriceDel = appRx.post(API_POST_PURCHASEPRICE_DEL, errorCatc
 export const purchasePriceAllowEdit = appRx.post(API_POST_PURCHASEPRICE_ALLOWEDIT, errorCatcher, errorHandle, filter)
 //查看仓库
 export const selectWarehouseSelf = appRx.get(API_GET_WAREHOUSESELF, errorCatcher, errorHandle, filter)
-
+//客户查看
+export const CustomerEdit = appRx.post(API_POST_CUSTOMER_EDIT, errorCatcher, errorHandle, filter)
+//质检添加
+export const inspectAdd = appRx.post(API_POST_INSPECT_ADD, errorCatcher, errorHandle, filter)
+//仓位下拉
+export const getbinNumber = appRx.get(API_GET_INSPECT_GETBINNUMBER, errorCatcher, errorHandle, filter)
+//客户下拉
+export const getcustomer = appRx.get(API_GET_INSPECT_GETCUSTOMER, errorCatcher, errorHandle, filter)
 
 

+ 28 - 14
src/views/houseSelfCollect/customerManagement.vue

@@ -16,7 +16,7 @@
           :value="searchType"
         >
           <ws-option
-            v-for="item in taskTypeList"
+            v-for="item in warehouseList"
             :key="item.value"
             :label="item.value"
             :value="item.value"
@@ -82,7 +82,7 @@
     <el-table
       :data="customertList"
       style="width: 100%; margin-top: 20px"
-      ref="warehouseList"
+      ref="customertList"
       border
       height="780"
     >
@@ -108,7 +108,7 @@
             height="16"
             style="vertical-align: text-top; margin: 0 6px"
             src="../../../public/img/chakan.png"
-            @click="createCustomer(scope.row,2)"
+            @click="createCustomer(scope.row, 2)"
             v-hasPermission="
               `contractManagement.buyContract.buyContractInfo.view`
             "
@@ -119,7 +119,7 @@
             height="16"
             style="vertical-align: text-top; margin: 0 6px"
             src="../../../public/img/bianji.png"
-            @click="createCustomer(scope.row,3)"
+            @click="createCustomer(scope.row, 3)"
             v-hasPermission="
               `contractManagement.buyContract.buyContractInfo.edit`
             "
@@ -161,6 +161,7 @@
 import {
   getCustomerManage,
   getCustomerDelete,
+  selectWarehouseSelf,
 } from '@/model/houseSelfCollect/index'
 import QRCode from 'qrcodejs2'
 import customerManagementAdd from './customerManagementAdd.vue'
@@ -179,7 +180,7 @@ export default {
       pageSize: 10,
       deptBudgetTotal: 0,
       deptCircularPage: {},
-      taskTypeList: [], //选择仓库数组
+      warehouseList: [], //选择仓库数组
       searchTypeText: '', //仓库
       searchType: '',
     }
@@ -208,11 +209,11 @@ export default {
     //选择仓库改变事件
     selecttaskType() {},
     //创建客户
-    createCustomer(row,num) {
+    createCustomer(row, num) {
       let type = num
       this.$router.push({
         name: 'customerManagementAdd',
-        query: { types: type ,id:row.id},
+        query: { types: type, id: row.id },
       })
     },
     handleSizeChange(val) {
@@ -225,7 +226,7 @@ export default {
       console.log(`当前页: ${val}`)
       this.getList()
     },
-    
+
     handleEdit(row) {
       this.$router.push({
         name: 'customerManagementEdit',
@@ -243,12 +244,12 @@ export default {
         .then(() => {
           getCustomerDelete({
             compId: sessionStorage.getItem('ws-pf_compId'),
-            id:row.id
+            id: row.id,
           })
             .toPromise()
             .then((response) => {
-             this.$message.success('删除成功')
-             this.getList()
+              this.$message.success('删除成功')
+              this.getList()
             })
         })
         .catch(() => {
@@ -256,17 +257,30 @@ export default {
         })
     },
     getList() {
+      selectWarehouseSelf({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        personCharge: sessionStorage.getItem('ws-pf_staffName'),
+      })
+        .toPromise()
+        .then((response) => {
+          for (let i = 0; i < response.length; i++) {
+            this.warehouseList.push({
+              value: response[i].warehouseName,
+            })
+          }
+        })
+
       getCustomerManage({
         compId: sessionStorage.getItem('ws-pf_compId'),
         currentPage: this.currentPage,
         pageSize: this.pageSize,
-        searchKeyWord: this.searchKeyWord
+        searchKeyWord: this.searchKeyWord,
+        searchTypeText:this.searchTypeText
       })
         .toPromise()
         .then((response) => {
-          console.log(response)
           this.customertList = response.records
-           this.deptBudgetTotal = response.total
+          this.deptBudgetTotal = response.total
         })
     },
   },

+ 181 - 94
src/views/houseSelfCollect/customerManagementAdd.vue

@@ -17,16 +17,12 @@
         >
       </el-col>
     </el-row>
-    <!-- <div>
-
-    </div> -->
-    <!-- <div class="title">新增粮商</div> -->
     <div class="unload">
       <ws-form ref="customerList" :model="customerList" label-width="120px">
         <ws-info-table>
           <div style="display: flex; width: 100%; text-align: center">
-            <div v-if="switchType==1" style="width: 50%; margin: 0 auto">
-               上传身份证正面
+            <div v-if="switchType == 1" style="width: 50%; margin: 0 auto">
+              上传身份证正面
               <el-upload
                 action="https://www.zthymaoyi.com/upload/admin"
                 :limit="1"
@@ -40,14 +36,22 @@
                 <i class="el-icon-plus"></i>
               </el-upload>
             </div>
-            <div style="width: 50%; margin: 0 auto" :class="identityUp" v-if="switchType==2||switchType==3">
+            <div
+              style="width: 50%; margin: 0 auto"
+              :class="identityUp"
+              v-if="switchType == 2 || switchType == 3"
+            >
               上传身份证正面
               <el-upload
                 action="https://www.zthymaoyi.com/upload/admin"
                 :limit="1"
                 list-type="picture-card"
                 :on-preview="handlePictureCardPreview"
-                :on-remove="(file) => {handleRemove(file,identityUp)}"
+                :on-remove="
+                  (file) => {
+                    handleRemove(file, 1)
+                  }
+                "
                 :auto-upload="true"
                 :on-success="upLoadSuccess1"
                 :disabled="disabled"
@@ -56,8 +60,8 @@
                 <i class="el-icon-plus"></i>
               </el-upload>
             </div>
-            <div v-if="switchType==1" style="width: 50%; margin: 0 auto">
-               上传身份证反面
+            <div v-if="switchType == 1" style="width: 50%; margin: 0 auto">
+              上传身份证反面
               <el-upload
                 action="https://www.zthymaoyi.com/upload/admin"
                 :limit="1"
@@ -66,20 +70,27 @@
                 :on-remove="handleRemove"
                 :auto-upload="true"
                 :on-success="upLoadSuccess2"
-                :disabled = "disabled"
+                :disabled="disabled"
               >
                 <i class="el-icon-plus"></i>
               </el-upload>
-
             </div>
-            <div style="width: 50%; margin: 0 auto" v-if="switchType==2||switchType==3" class="low">
+            <div
+              style="width: 50%; margin: 0 auto"
+              v-if="switchType == 2 || switchType == 3"
+              :class="identityLow"
+            >
               上传身份证反面
               <el-upload
                 action="https://www.zthymaoyi.com/upload/admin"
                 :limit="1"
                 list-type="picture-card"
                 :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove"
+                :on-remove="
+                  (file) => {
+                    handleRemove(file, 2)
+                  }
+                "
                 :auto-upload="true"
                 :on-success="upLoadSuccess2"
                 :disabled="disabled"
@@ -109,8 +120,8 @@
             />
           </ws-form-item>
           <div style="display: flex; width: 100%; text-align: center">
-            <div style="width: 50%; margin: 0 auto" v-if="switchType==1" >
-               上传银行卡正面
+            <div style="width: 50%; margin: 0 auto" v-if="switchType == 1">
+              上传银行卡正面
               <el-upload
                 action="https://www.zthymaoyi.com/upload/admin"
                 :limit="1"
@@ -124,14 +135,22 @@
                 <i class="el-icon-plus"></i>
               </el-upload>
             </div>
-            <div style="width: 50%; margin: 0 auto" v-if="switchType==2||switchType==3" class="bankUp">
+            <div
+              style="width: 50%; margin: 0 auto"
+              v-if="switchType == 2 || switchType == 3"
+              :class="bankUps"
+            >
               上传银行卡正面
               <el-upload
                 action="https://www.zthymaoyi.com/upload/admin"
                 :limit="1"
                 list-type="picture-card"
                 :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove1"
+                :on-remove="
+                  (file) => {
+                    handleRemove1(file, 1)
+                  }
+                "
                 :auto-upload="true"
                 :on-success="bankSuccess1"
                 :disabled="disabled"
@@ -140,7 +159,7 @@
                 <i class="el-icon-plus"></i>
               </el-upload>
             </div>
-            <div style="width: 50%; margin: 0 auto" v-if="switchType==1">
+            <div style="width: 50%; margin: 0 auto" v-if="switchType == 1">
               上传银行卡反面
               <el-upload
                 action="https://www.zthymaoyi.com/upload/admin"
@@ -155,14 +174,22 @@
                 <i class="el-icon-plus"></i>
               </el-upload>
             </div>
-            <div style="width: 50%; margin: 0 auto" v-if="switchType==2||switchType==3" class="bankLow">
+            <div
+              style="width: 50%; margin: 0 auto"
+              v-if="switchType == 2 || switchType == 3"
+              :class="bankLows"
+            >
               上传银行卡反面
               <el-upload
                 action="https://www.zthymaoyi.com/upload/admin"
                 :limit="1"
                 list-type="picture-card"
                 :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove1"
+                :on-remove="
+                  (file) => {
+                    handleRemove1(file, 2)
+                  }
+                "
                 :auto-upload="true"
                 :on-success="bankSuccess2"
                 :disabled="disabled"
@@ -260,8 +287,15 @@
           </ws-form-item>
         </ws-info-table>
         <div class="but">
-          <el-button type="primary" @click="commit" v-if="switchType==1 || switchType==3">提交</el-button>
-          <el-button type="primary" @click = "cancel" v-if="switchType==2">关闭</el-button>
+          <el-button
+            type="primary"
+            @click="commit"
+            v-if="switchType == 1 || switchType == 3"
+            >提交</el-button
+          >
+          <el-button type="primary" @click="cancel" v-if="switchType == 2"
+            >关闭</el-button
+          >
         </div>
       </ws-form>
     </div>
@@ -272,6 +306,7 @@ import {
   customerAdd,
   customerIdentity,
   getCustomerLook,
+  CustomerEdit,
 } from '@/model/houseSelfCollect/index'
 
 export default {
@@ -287,37 +322,40 @@ export default {
       identity: [],
       bank: [],
       trader: '新增',
-      switchType:"",
-      identityImgUp:[
+      switchType: '',
+      identityImgUp: [
         {
-          url:"",
-        }
+          url: '',
+        },
       ],
-      identityImgLow:[
+      identityImgLow: [
         {
-          url:"",
-        }
+          url: '',
+        },
       ],
-      bankImgUp:[
+      bankImgUp: [
         {
-          url:"",
-        }
+          url: '',
+        },
       ],
-      bankImgLow:[
+      bankImgLow: [
         {
-          url:""
-        }
+          url: '',
+        },
       ],
-      identityUp:"up",
+      identityUp: 'up',
+      identityLow: 'low',
+      bankUps: 'bankUp',
+      bankLows: 'bankLow',
     }
   },
   activated() {
-   this.switchType = this.$route.query.types
-    if(this.$route.query.types == null){
-       this.switchType = 1
-    } 
+    this.switchType = this.$route.query.types
+    if (this.$route.query.types == null) {
+      this.switchType = 1
+    }
     let id = this.$route.query.id
-    if ( this.switchType == 2) {
+    if (this.switchType == 2) {
       this.disabled = true
       this.trader = '查看'
       this.getList(id)
@@ -326,24 +364,52 @@ export default {
       this.trader = '编辑'
       this.getList(id)
     }
-    console.log( this.switchType)
+    console.log(this.switchType)
   },
   methods: {
-    handleRemove(file,a) {
-      console.log(file)
-      console.log(a)
-      for (let i = 0; i < this.identity.length; i++) {
-        if (file.response.url == this.identity[i]) {
-          this.identity.splice(i, 1, '')
+    handleRemove(file, index) {
+      if (index == 1) {
+        this.identityUp = ''
+      } else if (index == 2) {
+        this.identityLow = ''
+      }
+
+      if (this.switchType == 3) {
+        for (let i = 0; i < this.identity.length; i++) {
+          if (file.url == this.identity[i]) {
+            this.identity.splice(i, 1, '')
+          }
         }
+        console.log(this.identity)
+      } else if (this.switchType == 1) {
+        for (let i = 0; i < this.identity.length; i++) {
+          if (file.response.url == this.identity[i]) {
+            this.identity.splice(i, 1, '')
+          }
+        }
+        console.log(this.identity)
       }
     },
-    handleRemove1(file) {
-      for (let i = 0; i < this.bank.length; i++) {
-        if (file.response.url == this.bank[i]) {
-          this.bank.splice(i, 1, '')
+    handleRemove1(file, index) {
+      if (index == 1) {
+        this.bankUps = ''
+      } else if (index == 2) {
+        this.bankLows = ''
+      }
+      if (this.switchType == 3) {
+        for (let i = 0; i < this.bank.length; i++) {
+          if (file.url == this.bank[i]) {
+            this.bank.splice(i, 1, '')
+          }
+        }
+      } else if (this.switchType == 1) {
+        for (let i = 0; i < this.bank.length; i++) {
+          if (file.response.url == this.bank[i]) {
+            this.bank.splice(i, 1, '')
+          }
         }
       }
+
       console.log(this.bank)
     },
     handlePictureCardPreview(file) {
@@ -392,70 +458,91 @@ export default {
       this.$router.push({ path: 'customerManagement' })
     },
     upLoadSuccess1(e) {
+      this.identityUp = 'up'
       this.identity[0] = e.url
     },
     upLoadSuccess2(e) {
+      this.identityLow = 'low'
       this.identity[1] = e.url
     },
     bankSuccess1(e) {
+      this.bankUps = 'bankUp'
       this.bank[0] = e.url
     },
     bankSuccess2(e) {
+      this.bankLows = 'bankLow'
       this.bank[1] = e.url
     },
     commit() {
-      this.$confirm('确定提交客户信息?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-      })
-        .then(() => {
-          this.customerList.compId = sessionStorage.getItem('ws-pf_compId')
-          this.customerList.cardAddressUrl = this.identity.toString()
-          this.customerList.payeeAddressUrl = this.bank.toString()
-          this.customerList.customerTypeFlag = 1
-          this.customerList.customerType = '个人'
-          customerAdd(this.customerList)
-            .toPromise()
-            .then((response) => {
-              this.customerList.id = response
-              customerIdentity(this.customerList)
-                .toPromise()
-                .then((response) => {
-                  console.log(response.code)
-                  this.$message.success('添加成功')
-                  this.$router.push({ path: 'customerManagement' })
-                })
-
-              // this.$message.success('添加成功')
-              // this.$router.push({ path: 'customerManagement' })
-            })
+      this.customerList.compId = sessionStorage.getItem('ws-pf_compId')
+      this.customerList.cardAddressUrl = this.identity.toString()
+      this.customerList.payeeAddressUrl = this.bank.toString()
+      this.customerList.customerTypeFlag = 1
+      this.customerList.customerType = '个人'
+      if (this.switchType == 1) {
+        this.$confirm('确定提交客户信息?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
         })
-        .catch(() => {
-          return false
+          .then(() => {
+            // this.customerList.compId = sessionStorage.getItem('ws-pf_compId')
+            // this.customerList.cardAddressUrl = this.identity.toString()
+            // this.customerList.payeeAddressUrl = this.bank.toString()
+            // this.customerList.customerTypeFlag = 1
+            // this.customerList.customerType = '个人'
+            customerAdd(this.customerList)
+              .toPromise()
+              .then((response) => {
+                this.customerList.id = response
+                customerIdentity(this.customerList)
+                  .toPromise()
+                  .then((response) => {
+                    console.log(response.code)
+                    this.$message.success('添加成功')
+                    this.$router.push({ path: 'customerManagement' })
+                  })
+              })
+          })
+          .catch(() => {
+            return false
+          })
+      } else if (this.switchType == 3) {
+        this.$confirm('确定修改客户信息?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
         })
+          .then(() => {
+            CustomerEdit(this.customerList)
+              .toPromise()
+              .then((response) => {
+                  this.$message.success('修改成功')
+                    this.$router.push({ path: 'customerManagement' })
+              })
+          })
+          .catch(() => {
+            return false
+          })
+      }
     },
     getList(ids) {
-       getCustomerLook({id:ids})
+      getCustomerLook({ id: ids })
         .toPromise()
         .then((response) => {
           this.customerList = response
-          this.identity = this.customerList.cardAddressUrl.split(",")
+          this.identity = this.customerList.cardAddressUrl.split(',')
           this.identityImgUp[0].url = this.identity[0]
           this.identityImgLow[0].url = this.identity[1]
-          this.bank = this.customerList.payeeAddressUrl.split(",")
-             this.bankImgUp[0].url = this.bank[0] 
-             this.bankImgLow[0].url = this.bank[1]
-          
+          this.bank = this.customerList.payeeAddressUrl.split(',')
+          this.bankImgUp[0].url = this.bank[0]
+          this.bankImgLow[0].url = this.bank[1]
         })
     },
   },
 }
 </script>
 <style lang="scss" scoped>
-// /deep/.el-form-item {
-//   margin-bottom: 0;
-// }
 .center {
   background: #f6f7fc;
 }
@@ -522,16 +609,16 @@ export default {
   text-align: center;
   margin: 20px auto;
 }
-/deep/.up .el-upload--picture-card{
+/deep/.up .el-upload--picture-card {
   display: none;
 }
-/deep/.low .el-upload--picture-card{
+/deep/.low .el-upload--picture-card {
   display: none;
 }
-/deep/.bankUp .el-upload--picture-card{
+/deep/.bankUp .el-upload--picture-card {
   display: none;
 }
-/deep/.bankLow .el-upload--picture-card{
+/deep/.bankLow .el-upload--picture-card {
   display: none;
 }
 </style>

+ 144 - 56
src/views/houseSelfCollect/inspectInfo.vue

@@ -30,72 +30,74 @@
                 size="small"
               />
             </ws-form-item>
-            <ws-form-item label="仓位号" span="1" prop="waterContent">
+            <ws-form-item label="仓位号" span="1" prop="binNumber">
               <ws-select
-                v-model="warehouseList.a"
+                v-model="inspect.binNumber"
                 placeholder="请输入仓位号"
                 class="typeselect"
                 @change="selectpackingMethod"
                 :disabled="disabled"
               >
                 <ws-option
-                  v-for="item in goodnameList"
-                  :key="item.constKey"
-                  :label="item.constValue"
-                  :value="item.constValue"
+                  v-for="item in getbinNumberList"
+                  :key="item.value"
+                  :label="item.value"
+                  :value="item.value"
                 />
               </ws-select>
             </ws-form-item>
-            <ws-form-item label="客户" span="1" prop="waterContent">
+            <ws-form-item label="客户" span="1" prop="customerName">
               <ws-select
-                v-model="warehouseList.a"
-                placeholder="请输入货名"
+                v-model="inspect.customerName"
+                placeholder="请输入客户"
                 class="typeselect"
                 @change="selectpackingMethod"
                 :disabled="disabled"
               >
                 <ws-option
-                  v-for="item in goodnameList"
-                  :key="item.constKey"
-                  :label="item.constValue"
-                  :value="item.constValue"
+                  v-for="item in customerList"
+                  :key="item.valueKey"
+                  :label="item.value"
+                  :value="item.value"
                 />
               </ws-select>
             </ws-form-item>
-            <ws-form-item label="囤位号" span="1" prop="waterContent">
+            <ws-form-item label="囤位号" span="1" prop="storageTagNo">
               <ws-input
-                placeholder="请输入客户"
+                v-model="inspect.storageTagNo"
+                placeholder="请输入囤位号"
                 maxlength="100"
                 size="small"
                 :disabled="disabled"
               />
             </ws-form-item>
-            <ws-form-item label="车牌号" span="1" prop="waterContent">
+            <ws-form-item label="车牌号" span="1" prop="carNumber">
               <ws-input
-                placeholder="请输入客户"
+                v-model="inspect.carNumber"
+                placeholder="请输入车牌号"
                 maxlength="100"
                 size="small"
                 :disabled="disabled"
               />
             </ws-form-item>
-            <ws-form-item label="货名" span="1" prop="waterContent">
+            <ws-form-item label="货名" span="1" prop="goodsName">
               <ws-select
-                v-model="warehouseList.a"
-                placeholder="请输入货名"
-                class="typeselect"
-                @change="selectpackingMethod"
-                :disabled="disabled"
-              >
-                <ws-option
-                  v-for="item in goodnameList"
-                  :key="item.constKey"
-                  :label="item.constValue"
-                  :value="item.constValue"
-                />
-              </ws-select>
+              v-model="inspect.goodsName"
+              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="waterContent">
+            <ws-form-item label="扣重比" span="1" prop="buckleWeightRatio">
               <ws-input
+                v-model="inspect.buckleWeightRatio"
                 placeholder="请输入扣重比"
                 maxlength="100"
                 size="small"
@@ -106,16 +108,25 @@
 
           <div class="title">质检数据</div>
           <ws-info-table>
-            <ws-form-item label="等级" span="1" prop="waterContent">
-              <ws-input
-                placeholder="请输入编号"
-                maxlength="100"
-                size="small"
+            <ws-form-item label="等级" span="1" prop="grade">
+              <ws-select
+                v-model="inspect.grade"
+                placeholder="请输入等级"
+                class="typeselect"
+                @change="selectpackingMethod"
                 :disabled="disabled"
-              />
+              >
+                <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="waterContent">
+            <ws-form-item label="杂质(%)" span="1" prop="impurity">
               <ws-input
+                v-model="inspect.impurity"
                 placeholder="请输入杂质占比"
                 maxlength="100"
                 size="small"
@@ -124,47 +135,53 @@
             </ws-form-item>
             <ws-form-item label="水分(%)" span="1" prop="waterContent">
               <ws-input
+                v-model="inspect.waterContent"
                 placeholder="请输入水分占比"
                 maxlength="100"
                 size="small"
                 :disabled="disabled"
               />
             </ws-form-item>
-            <ws-form-item label="霉变粒(%)" span="1" prop="waterContent">
+            <ws-form-item label="霉变粒(%)" span="1" prop="mildewGrain">
               <ws-input
+                v-model="inspect.mildewGrain"
                 placeholder="请输入霉变粒占比"
                 maxlength="100"
                 size="small"
                 :disabled="disabled"
               />
             </ws-form-item>
-            <ws-form-item label="容重(克/升)" span="1" prop="waterContent">
+            <ws-form-item label="容重(克/升)" span="1" prop="bulkDensity">
               <ws-input
+                v-model="inspect.bulkDensity"
                 placeholder="请输入容重"
                 maxlength="100"
                 size="small"
                 :disabled="disabled"
               />
             </ws-form-item>
-            <ws-form-item label="热损伤(%)" span="1" prop="waterContent">
+            <ws-form-item label="热损伤(%)" span="1" prop="jiaorenli">
               <ws-input
+                v-model="inspect.jiaorenli"
                 placeholder="请输入热损伤占比"
                 maxlength="100"
                 size="small"
                 :disabled="disabled"
               />
             </ws-form-item>
-            <ws-form-item label="不完整粒(%)" span="1" prop="waterContent">
+            <ws-form-item label="不完整粒(%)" span="1" prop="imperfectGrain">
               <ws-input
+                v-model="inspect.imperfectGrain"
                 placeholder="请输入不完整粒占比"
                 maxlength="100"
                 size="small"
                 :disabled="disabled"
               />
             </ws-form-item>
-            
           </ws-info-table>
-          <div style="text-align:right;color:#323233;">潮粮单价(元/公斤):000000000</div>
+          <div style="text-align: right; color: #323233">
+            潮粮单价(元/公斤):000000000{{ inspect.tidalGrainPrice }}
+          </div>
           <div class="but">
             <el-button @click="cancel" v-if="this.types != 2" type="primary"
               >取消</el-button
@@ -183,7 +200,10 @@
   </div>
 </template>
 <script>
-import {} from '@/model/houseSelfCollect/index'
+import { inspectAdd,getCustomerManage,getbinNumber,getcustomer } from '@/model/houseSelfCollect/index'
+import {
+  packList,
+} from '@/model/contarct/index'
 import houseSelfCollectPrint from './houseSelfCollectPrint.vue'
 export default {
   components: {
@@ -192,14 +212,21 @@ export default {
   watch: {},
   data() {
     return {
-      warehouseList: {},
+      // warehouseList: {},
+      inspect: {},
       disabled: false,
       types: '',
       information: '添加',
+      goodnameList:[],
+      gradeList:[],
+      customerList:[],
+      getbinNumberList:[],
+      id:"",
     }
   },
   activated() {
     this.types = this.$route.query.type
+    this.id = this.$route.query.id
     if (this.types == 2) {
       this.disabled = true
       this.information = '查看'
@@ -207,7 +234,7 @@ export default {
       this.disabled = false
       this.information = '编辑'
     }
-    console.log(this.information)
+    this.getList()
   },
   methods: {
     print() {
@@ -217,14 +244,27 @@ export default {
         type: 'warning',
       })
         .then(() => {
-          // this.xx = true;
-          let newstr = document.getElementById('print').innerHTML
-          let oldstr = document.body.innerHTML
-          document.body.innerHTML = newstr
-          window.print()
-          document.body.innerHTML = oldstr
-          // window.location.reload()
-          this.$router.push({ path: 'paymentManagement' })
+          inspectAdd(this.inspect)
+            .toPromise()
+            .then((response) => {
+              // this.customerList.id = response
+              // customerIdentity(this.customerList)
+              //   .toPromise()
+              //   .then((response) => {
+                  // console.log(response.code)
+                  this.$message.success('保存成功')
+                  // this.$router.push({ path: 'customerManagement' })
+
+                  // this.xx = true;
+                  let newstr = document.getElementById('print').innerHTML
+                  let oldstr = document.body.innerHTML
+                  document.body.innerHTML = newstr
+                  window.print()
+                  document.body.innerHTML = oldstr
+                  // window.location.reload()
+                  this.$router.push({ path: 'paymentManagement' })
+                // })
+            })
         })
         .catch(() => {
           return false
@@ -233,6 +273,54 @@ export default {
     cancel() {
       this.$router.push({ path: 'inspectionManagement' })
     },
+    //货名改变事件
+    selectpackingMethod(){
+
+    },
+    getList(){
+        // 货名
+      packList({ constId: 'CON2' })
+        .toPromise()
+        .then((response) => {
+          this.goodnameList = response
+        })
+      // 品级
+      packList({ constId: 'CON3' })
+        .toPromise()
+        .then((response) => {
+          this.gradeList = response
+        })
+        //客户
+        getcustomer({ compId: sessionStorage.getItem('ws-pf_compId') })
+        .toPromise()
+        .then((response) => {
+          // this.gradeList = response
+           let customer = response
+          for(let i = 0 ; i < response.length ; i++ ){
+            customer = response[i].customerName +"(" + response[i].customerPhone + ")"
+            this.customerList.push({
+              valueKey:i,
+              value:customer
+            })
+
+
+          }
+         
+          console.log( this.customerList)
+        })
+        // 仓位
+      getbinNumber({ id:this.id })
+        .toPromise()
+        .then((response) => {
+          for(let i = 0 ; i < response.warehousePositionInfoList.length;i++ ){
+             this.getbinNumberList.push({
+               value:response.warehousePositionInfoList[i].binNumber
+             })
+          }
+          // this.getbinNumberList = response.warehousePositionInfoList
+        })
+
+    }
   },
 }
 </script>

+ 33 - 21
src/views/houseSelfCollect/inspectionManagement.vue

@@ -13,7 +13,7 @@
           :value="searchType"
         >
           <ws-option
-            v-for="item in taskTypeList"
+            v-for="item in warehouseList"
             :key="item.value"
             :label="item.value"
             :value="item.value"
@@ -44,9 +44,9 @@
       </template>
     </BaseHeaderLayout>
     <el-table
-      :data="warehouseList"
+      :data="warehouseList1"
       style="width: 100%; margin-top: 20px"
-      ref="warehouseList"
+      ref="warehouseList1"
       border
       height="780"
     >
@@ -95,7 +95,7 @@
 </template>
 <script>
 import{
-
+selectWarehouseSelf
 } from '@/model/houseSelfCollect/index'
 
 export default {
@@ -111,22 +111,28 @@ export default {
 
       searchKeyWord: '',
       taskTypeList: [],
-      searchType: '',
+      searchType: 0,
       searchTypeText: '',
-      warehouseList: [
+      warehouseList1: [
         {
           contractNo: '快付款',
         },
       ],
+      warehouseList:[],
+      id:"",//仓库id
     }
   },
-  activated() {},
+  activated() {
+    this.getList()
+  },
   methods: {
     inspectInfo(index) {
       //添加,编辑,查看
-      this.$router.push({ path: 'inspectInfo', query: { type: index } })
+      this.$router.push({ path: 'inspectInfo', query: { type: index,id:this.id } })
+    },
+    selecttaskType(e) {
+      console.log(e)
     },
-    selecttaskType() {},
     del() {
       //删除
       this.$confirm('确定删除质检信息?', '提示', {
@@ -139,18 +145,6 @@ export default {
           return false
         })
     },
-    // commit() {
-    //   //保存
-    //   this.$confirm('确定保存质检信息?', '提示', {
-    //     confirmButtonText: '确定',
-    //     cancelButtonText: '取消',
-    //     type: 'warning',
-    //   })
-    //     .then(() => {})
-    //     .catch(() => {
-    //       return false
-    //     })
-    // },
     handleSizeChange(val) {
       console.log(`每页 ${val} 条`)
       this.pageSize = val
@@ -161,6 +155,24 @@ export default {
       console.log(`当前页: ${val}`)
       this.getList()
     },
+    getList(){
+      selectWarehouseSelf({
+        compId: sessionStorage.getItem('ws-pf_compId'),
+        personCharge: sessionStorage.getItem('ws-pf_staffName'),
+      })
+        .toPromise()
+        .then((response) => {
+          for (let i = 0; i < response.length; i++) {
+            this.warehouseList.push({
+              valueKey: i,
+              value: response[i].warehouseName,
+              id:response[i].id
+            })
+          }
+          this.searchTypeText = response[0].warehouseName
+          this.id = response[0].id
+        })
+    }
   },
 }
 </script>