浏览代码

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-pc

ccj 3 年之前
父节点
当前提交
d9833100b2

+ 1 - 0
package.json

@@ -53,6 +53,7 @@
     "element-china-area-data": "^5.0.2",
     "element-china-area-data": "^5.0.2",
     "element-ui": "^2.13.2",
     "element-ui": "^2.13.2",
     "form-making-advanced": "^1.2.6",
     "form-making-advanced": "^1.2.6",
+    "html2canvas": "^1.3.2",
     "js-cookie": "2.2.0",
     "js-cookie": "2.2.0",
     "lodash": "^4.17.20",
     "lodash": "^4.17.20",
     "node-gyp": "^5.0.6",
     "node-gyp": "^5.0.6",

二进制
public/img/banklow.png


二进制
public/img/bankup.png


二进制
public/img/identitylow.png


二进制
public/img/identityup.png


+ 1 - 15
src/views/houseSelfCollect/component/inspectInfoPrint.vue

@@ -61,11 +61,6 @@
         <div class="">客户签名:</div>
         <div class="">客户签名:</div>
       </div>
       </div>
       <div class="bottom-row3">扫一扫</div>
       <div class="bottom-row3">扫一扫</div>
-      <div class="bottom-row4">
-        <el-button type="primary">关闭</el-button>
-        <el-button type="primary" @click="printSmall">打印小票</el-button>
-        <el-button type="primary" @click="printBig">打印单据</el-button>
-      </div>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
@@ -86,16 +81,7 @@
 
 
     },
     },
     methods: {
     methods: {
-    printSmall() {
-      window.location.href =
-        '../../../../static/inspection.html?type=1&dataList=' +
-        JSON.stringify(this.printData)
-    },
-    printBig() {
-      window.location.href =
-        '../../../../static/inspection.html?type=2&dataList=' +
-        JSON.stringify(this.printData)
-    },
+
     },
     },
   }
   }
 </script>
 </script>

+ 155 - 218
src/views/houseSelfCollect/customerManagement.vue

@@ -4,61 +4,32 @@
     <BaseHeaderLayout :leftSpan="12">
     <BaseHeaderLayout :leftSpan="12">
       <template slot="left">
       <template slot="left">
         <ws-button type="primary" @click="getCustomer()">获取客户</ws-button>
         <ws-button type="primary" @click="getCustomer()">获取客户</ws-button>
-        <ws-button type="primary" @click="createCustomer(1)"
-          >创建新客户</ws-button
-        >
+        <ws-button type="primary" @click="createCustomer(1)">创建新客户</ws-button>
       </template>
       </template>
       <template slot="right">
       <template slot="right">
-        <ws-input
-          v-model="searchKeyWord"
-          placeholder="可按姓名、手机号查找"
-          clearable
-          maxlength="500"
-          type="input"
-        ></ws-input>
-        <ws-button class="find" type="primary" @click="find()"
-          ><img
-            width="16"
-            height="16"
-            style="
+        <ws-input v-model="searchKeyWord" placeholder="可按姓名、手机号查找" clearable maxlength="500" type="input"></ws-input>
+        <ws-button class="find" type="primary" @click="find()"><img width="16" height="16" style="
               vertical-align: text-top;
               vertical-align: text-top;
               position: relative;
               position: relative;
               top: 0px;
               top: 0px;
               left: -8px;
               left: -8px;
-            "
-            src="../../../public/img/sousuo.png"
-            alt=""
-        /></ws-button>
+            " src="../../../public/img/sousuo.png" alt="" /></ws-button>
       </template>
       </template>
     </BaseHeaderLayout>
     </BaseHeaderLayout>
     <div class="seach">
     <div class="seach">
       <div class="search-right">
       <div class="search-right">
         <!-- <ws-button @click="getCustomer()">获取客户</ws-button> -->
         <!-- <ws-button @click="getCustomer()">获取客户</ws-button> -->
-        <el-dialog
-          title="客户扫码"
-          :visible.sync="customerDialogVisible"
-          width="30%"
-        >
+        <el-dialog title="客户扫码" :visible.sync="customerDialogVisible" width="30%">
           <div id="qrcode"></div>
           <div id="qrcode"></div>
         </el-dialog>
         </el-dialog>
         <!-- <ws-button @click="createCustomer()">创建新客户</ws-button> -->
         <!-- <ws-button @click="createCustomer()">创建新客户</ws-button> -->
-        <el-dialog
-          title="创建新客户"
-          :visible.sync="creatNewCustomerDialogVisible"
-          width="50%"
-        >
+        <el-dialog title="创建新客户" :visible.sync="creatNewCustomerDialogVisible" width="50%">
           <customerManagementAdd></customerManagementAdd>
           <customerManagementAdd></customerManagementAdd>
         </el-dialog>
         </el-dialog>
       </div>
       </div>
     </div>
     </div>
 
 
-    <el-table
-      :data="customertList"
-      style="width: 100%; margin-top: 20px"
-      ref="customertList"
-      border
-      height="780"
-    >
+    <el-table :data="customertList" style="width: 100%; margin-top: 20px" ref="customertList" border height="780">
       <el-table-column type="index" label="序号">
       <el-table-column type="index" label="序号">
         <template scope="scope">
         <template scope="scope">
           <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
           <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
@@ -70,211 +41,177 @@
       <el-table-column prop="bankCard" label="银行卡号"></el-table-column>
       <el-table-column prop="bankCard" label="银行卡号"></el-table-column>
       <el-table-column prop="bankDeposit" label="开户行"></el-table-column>
       <el-table-column prop="bankDeposit" label="开户行"></el-table-column>
       <el-table-column prop="payeeName" label="收款人"></el-table-column>
       <el-table-column prop="payeeName" label="收款人"></el-table-column>
-      <el-table-column
-        prop="authenticationStatus"
-        label="状态"
-      ></el-table-column>
-      <el-table-column prop="address" label="操作">
+      <el-table-column prop="authenticationStatus" label="状态"></el-table-column>
+      <el-table-column prop="address" label="操作" width="300">
         <template slot-scope="scope">
         <template slot-scope="scope">
-          <img
-            width="16"
-            height="16"
-            style="vertical-align: text-top; margin: 0 6px"
-            src="../../../public/img/chakan.png"
-            @click="createCustomer(scope.row, 2)"
-            v-hasPermission="
-              `contractManagement.buyContract.buyContractInfo.view`
-            "
-            alt
-          />
-          <img
-            width="17"
-            height="16"
-            style="vertical-align: text-top; margin: 0 6px"
-            src="../../../public/img/bianji.png"
-            @click="createCustomer(scope.row, 3)"
-            v-hasPermission="
-              `contractManagement.buyContract.buyContractInfo.edit`
-            "
-            alt
-          />
-          <img
-            width="16"
-            height="17"
-            style="
-              vertical-align: text-top;
-              position: relative;
-              top: -1px;
-              margin: 0 6px;
-            "
-            src="../../../public/img/shanchu.png"
-            v-hasPermission="
-              `contractManagement.buyContract.buyContractInfo.delete`
-            "
-            @click="handleDelete(scope.row)"
-            alt
-          />
+          <el-button size="mini" @click="createCustomer(scope.row, 2)">查看</el-button>
+          <el-button size="mini" @click="createCustomer(scope.row, 3)">编辑</el-button>
+          <el-button size="mini" type="danger" @click="handleDelete(scope.row, '')">删除</el-button>
         </template>
         </template>
       </el-table-column>
       </el-table-column>
     </el-table>
     </el-table>
     <div style="text-align: center">
     <div style="text-align: center">
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-size="deptCircularPage.pageSize"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="deptBudgetTotal"
-      >
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+        :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper"
+        :total="deptBudgetTotal">
       </el-pagination>
       </el-pagination>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import {
-  getCustomerManage,
-  getCustomerDelete,
-} from '@/model/houseSelfCollect/index'
-import QRCode from 'qrcodejs2'
-import customerManagementAdd from './customerManagementAdd.vue'
-export default {
-  components: {
-    customerManagementAdd,
-  },
-  watch: {},
-  data() {
-    return {
-      searchKeyWord: '',
-      customerDialogVisible: false,
-      creatNewCustomerDialogVisible: false,
-      customertList: [],
-      currentPage: 1,
-      pageSize: 10,
-      deptBudgetTotal: 0,
-      deptCircularPage: {},
-    }
-  },
-  activated() {
-    this.getList()
-  },
-  methods: {
-    find() {
-      this.getList()
-    },
-    //获取客户
-    getCustomer() {
-      this.customerDialogVisible = true
-      this.$nextTick(function () {
-        document.getElementById('qrcode').innerHTML = ''
-        let qrcode = new QRCode('qrcode', {
-          width: 150,
-          height: 150,
-          text: 'https://www.baidu.com',
-          colorDark: '#109dff',
-          colorLight: '#d9d9d9',
-        })
-      })
-    },
-    //创建客户
-    createCustomer(row, num) {
-      let type = num
-      this.$router.push({
-        name: 'customerManagementAdd',
-        query: { types: type, id: row.id },
-      })
+  import {
+    getCustomerManage,
+    getCustomerDelete,
+  } from '@/model/houseSelfCollect/index'
+  import QRCode from 'qrcodejs2'
+  import customerManagementAdd from './customerManagementAdd.vue'
+  export default {
+    components: {
+      customerManagementAdd,
     },
     },
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`)
-      this.pageSize = val
-      this.getList()
+    watch: {},
+    data() {
+      return {
+        searchKeyWord: '',
+        customerDialogVisible: false,
+        creatNewCustomerDialogVisible: false,
+        customertList: [],
+        currentPage: 1,
+        pageSize: 10,
+        deptBudgetTotal: 0,
+        deptCircularPage: {},
+      }
     },
     },
-    handleCurrentChange(val) {
-      this.currentPage = val
-      console.log(`当前页: ${val}`)
+    activated() {
       this.getList()
       this.getList()
     },
     },
-
-    handleEdit(row) {
-      this.$router.push({
-        name: 'customerManagementEdit',
-        query: {
-          id: row.id,
-        },
-      })
-    },
-    handleDelete(row) {
-      this.$confirm('确定删除该客户?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning',
-      })
-        .then(() => {
-          getCustomerDelete({
-            compId: sessionStorage.getItem('ws-pf_compId'),
-            id: row.id,
+    methods: {
+      find() {
+        this.getList()
+      },
+      //获取客户
+      getCustomer() {
+        this.customerDialogVisible = true
+        this.$nextTick(function() {
+          document.getElementById('qrcode').innerHTML = ''
+          let qrcode = new QRCode('qrcode', {
+            width: 150,
+            height: 150,
+            text: 'https://www.baidu.com',
+            colorDark: '#109dff',
+            colorLight: '#d9d9d9',
           })
           })
-            .toPromise()
-            .then((response) => {
-              this.$message.success('删除成功')
-              this.getList()
-            })
         })
         })
-        .catch(() => {
-          return false
+      },
+      //创建客户
+      createCustomer(row, num) {
+        let type = num
+        this.$router.push({
+          name: 'customerManagementAdd',
+          query: {
+            types: type,
+            id: row.id
+          },
         })
         })
-    },
-    getList() {
-      getCustomerManage({
-        compId: sessionStorage.getItem('ws-pf_compId'),
-        currentPage: this.currentPage,
-        pageSize: this.pageSize,
-        searchKeyWord: this.searchKeyWord,
-        warehouseName:this.warehouseName
-      })
-        .toPromise()
-        .then((response) => {
-          this.customertList = response.records
-          this.deptBudgetTotal = response.total
+      },
+      handleSizeChange(val) {
+        console.log(`每页 ${val} 条`)
+        this.pageSize = val
+        this.getList()
+      },
+      handleCurrentChange(val) {
+        this.currentPage = val
+        console.log(`当前页: ${val}`)
+        this.getList()
+      },
+
+      handleEdit(row) {
+        this.$router.push({
+          name: 'customerManagementEdit',
+          query: {
+            id: row.id,
+          },
         })
         })
+      },
+      handleDelete(row) {
+        this.$confirm('确定删除该客户?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning',
+          })
+          .then(() => {
+            getCustomerDelete({
+                compId: sessionStorage.getItem('ws-pf_compId'),
+                id: row.id,
+              })
+              .toPromise()
+              .then((response) => {
+                this.$message.success('删除成功')
+                this.getList()
+              })
+          })
+          .catch(() => {
+            return false
+          })
+      },
+      getList() {
+        getCustomerManage({
+            compId: sessionStorage.getItem('ws-pf_compId'),
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            searchKeyWord: this.searchKeyWord,
+            warehouseName: this.warehouseName
+          })
+          .toPromise()
+          .then((response) => {
+            this.customertList = response.records
+            this.deptBudgetTotal = response.total
+          })
+      },
     },
     },
-  },
-}
+  }
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-.seach {
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
+  .seach {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
 
 
-  .find {
-    width: 32px;
+    .find {
+      width: 32px;
+    }
+
+    .search-left {
+      display: flex;
+    }
   }
   }
 
 
-  .search-left {
-    display: flex;
+  .ws-info-table {
+    border: none;
+  }
+
+  .ws-info-table .el-form-item {
+    width: 50%;
+    border: none;
+  }
+
+  /deep/.ws-info-table .el-form-item .el-form-item__label {
+    width: 30%;
+    text-align: center;
+    background: #ffffff;
+    color: #8890b1;
+  }
+
+  /deep/.ws-info-table .el-form-item .el-form-item__content {
+    border: none;
+  }
+
+  /deep/.el-table .el-table__header .cell,
+  .el-table .el-table__body .cell {
+    text-align: center;
+  }
+
+  /deep/.el-table--enable-row-transition .el-table__body td {
+    text-align: center;
   }
   }
-}
-.ws-info-table {
-  border: none;
-}
-.ws-info-table .el-form-item {
-  width: 50%;
-  border: none;
-}
-/deep/.ws-info-table .el-form-item .el-form-item__label {
-  width: 30%;
-  text-align: center;
-  background: #ffffff;
-  color: #8890b1;
-}
-/deep/.ws-info-table .el-form-item .el-form-item__content {
-  border: none;
-}
-/deep/.el-table .el-table__header .cell,
-.el-table .el-table__body .cell {
-  text-align: center;
-}
-/deep/.el-table--enable-row-transition .el-table__body td {
-  text-align: center;
-}
 </style>
 </style>

+ 469 - 557
src/views/houseSelfCollect/customerManagementAdd.vue

@@ -6,252 +6,84 @@
         <h2 class="bg-left titleup">{{ trader }}粮商</h2>
         <h2 class="bg-left titleup">{{ trader }}粮商</h2>
       </el-col>
       </el-col>
       <el-col :span="12" class="bg-right">
       <el-col :span="12" class="bg-right">
-        <el-button class="bg-bottom" type="primary" size="small" @click="cancel"
-          ><img
-            width="6"
-            height="10"
-            style="vertical-align: bottom; margin-right: 3px"
-            src="../../../public/img/lujing.png"
-            alt=""
-          />返回</el-button
-        >
+        <el-button class="bg-bottom" type="primary" size="small" @click="cancel"><img width="6" height="10"
+            style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
+        </el-button>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
     <div class="unload">
     <div class="unload">
       <ws-form ref="customerList" :model="customerList" label-width="120px">
       <ws-form ref="customerList" :model="customerList" label-width="120px">
         <ws-info-table>
         <ws-info-table>
           <div style="display: flex; width: 100%; text-align: center">
           <div style="display: flex; width: 100%; text-align: center">
-            <div v-if="switchType == 1" style="width: 50%; margin: 0 auto">
-              上传身份证正面
-              <el-upload
-                action="https://www.zthymaoyi.com/upload/admin"
-                :limit="1"
-                list-type="picture-card"
-                :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove"
-                :auto-upload="true"
-                :on-success="upLoadSuccess1"
-                :disabled="disabled"
-              >
-                <i class="el-icon-plus"></i>
+            <div style="width: 330px; margin: 0 auto">
+              <div class="unload-img">上传身份证正面</div>
+              <el-upload class="avatar-uploader avatar-uploader1" action="https://www.zthymaoyi.com/upload/admin"
+                :show-file-list="false" :on-success="upLoadSuccess1" :disabled="disabled">
+                <img v-if="imageUrl1" :src="imageUrl1" class="avatar">
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
               </el-upload>
               </el-upload>
             </div>
             </div>
-            <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, 1)
-                  }
-                "
-                :auto-upload="true"
-                :on-success="upLoadSuccess1"
-                :disabled="disabled"
-                :file-list="identityImgUp"
-              >
-                <i class="el-icon-plus"></i>
+            <div style="width: 330px; margin: 0 auto">
+
+              <div class="unload-img">上传身份证反面</div>
+              <el-upload class="avatar-uploader avatar-uploader2" action="https://www.zthymaoyi.com/upload/admin"
+                :show-file-list="false" :on-success="upLoadSuccess2" :disabled="disabled">
+                <img v-if="imageUrl2" :src="imageUrl2" class="avatar">
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
               </el-upload>
               </el-upload>
             </div>
             </div>
-            <div v-if="switchType == 1" style="width: 50%; margin: 0 auto">
-              上传身份证反面
-              <el-upload
-                action="https://www.zthymaoyi.com/upload/admin"
-                :limit="1"
-                list-type="picture-card"
-                :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove"
-                :auto-upload="true"
-                :on-success="upLoadSuccess2"
-                :disabled="disabled"
-              >
-                <i class="el-icon-plus"></i>
+          </div>
+
+          <div style="display: flex; width: 100%; text-align: center">
+            <div style="width:330px; margin: 0 auto">
+              <div class="unload-img">上传银行卡正面</div>
+              <el-upload class="avatar-uploader avatar-uploader3" action="https://www.zthymaoyi.com/upload/admin"
+                :show-file-list="false" :on-success="bankSuccess1" :disabled="disabled">
+                <img v-if="imageUrl3" :src="imageUrl3" class="avatar">
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
               </el-upload>
               </el-upload>
             </div>
             </div>
-            <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="
-                  (file) => {
-                    handleRemove(file, 2)
-                  }
-                "
-                :auto-upload="true"
-                :on-success="upLoadSuccess2"
-                :disabled="disabled"
-                :file-list="identityImgLow"
-              >
-                <i class="el-icon-plus"></i>
+            <div style="width:330px; margin: 0 auto">
+              <div class="unload-img">上传银行卡反面</div>
+              <el-upload class="avatar-uploader avatar-uploader4" action="https://www.zthymaoyi.com/upload/admin"
+                :show-file-list="false" :on-success="bankSuccess2" :disabled="disabled">
+                <img v-if="imageUrl4" :src="imageUrl4" class="avatar">
+                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
               </el-upload>
               </el-upload>
             </div>
             </div>
           </div>
           </div>
 
 
-          <ws-form-item label="姓名" span="1" prop="customerName">
-            <ws-input
-              v-model="customerList.customerName"
-              placeholder="请输入姓名"
-              maxlength="100"
-              size="small"
-              :disabled="disabled"
-            />
+          <ws-form-item label="姓名" span="1" prop="customerName" label-width="80px">
+            <ws-input v-model="customerList.customerName" placeholder="请输入姓名" maxlength="100" size="small"
+              :disabled="disabled" />
           </ws-form-item>
           </ws-form-item>
           <ws-form-item label="身份证号" span="1" prop="customerNumberCard">
           <ws-form-item label="身份证号" span="1" prop="customerNumberCard">
-            <ws-input
-              v-model="customerList.customerNumberCard"
-              placeholder="请输入身份证号"
-              maxlength="100"
-              size="small"
-              :disabled="disabled"
-            />
+            <ws-input v-model="customerList.customerNumberCard" placeholder="请输入身份证号" maxlength="100" size="small"
+              :disabled="disabled" />
           </ws-form-item>
           </ws-form-item>
-          <div style="display: flex; width: 100%; text-align: center">
-            <div style="width: 50%; margin: 0 auto" v-if="switchType == 1">
-              上传银行卡正面
-              <el-upload
-                action="https://www.zthymaoyi.com/upload/admin"
-                :limit="1"
-                list-type="picture-card"
-                :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove1"
-                :auto-upload="true"
-                :on-success="bankSuccess1"
-                :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="bankUps"
-            >
-              上传银行卡正面
-              <el-upload
-                action="https://www.zthymaoyi.com/upload/admin"
-                :limit="1"
-                list-type="picture-card"
-                :on-preview="handlePictureCardPreview"
-                :on-remove="
-                  (file) => {
-                    handleRemove1(file, 1)
-                  }
-                "
-                :auto-upload="true"
-                :on-success="bankSuccess1"
-                :disabled="disabled"
-                :file-list="bankImgUp"
-              >
-                <i class="el-icon-plus"></i>
-              </el-upload>
-            </div>
-            <div style="width: 50%; margin: 0 auto" v-if="switchType == 1">
-              上传银行卡反面
-              <el-upload
-                action="https://www.zthymaoyi.com/upload/admin"
-                :limit="1"
-                list-type="picture-card"
-                :on-preview="handlePictureCardPreview"
-                :on-remove="handleRemove1"
-                :auto-upload="true"
-                :on-success="bankSuccess2"
-                :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="bankLows"
-            >
-              上传银行卡反面
-              <el-upload
-                action="https://www.zthymaoyi.com/upload/admin"
-                :limit="1"
-                list-type="picture-card"
-                :on-preview="handlePictureCardPreview"
-                :on-remove="
-                  (file) => {
-                    handleRemove1(file, 2)
-                  }
-                "
-                :auto-upload="true"
-                :on-success="bankSuccess2"
-                :disabled="disabled"
-                :file-list="bankImgLow"
-              >
-                <i class="el-icon-plus"></i>
-              </el-upload>
-            </div>
-          </div>
           <ws-form-item label="银行卡号" span="1" prop="bankCard">
           <ws-form-item label="银行卡号" span="1" prop="bankCard">
-            <ws-input
-              v-model="customerList.bankCard"
-              placeholder="请输入银行卡号"
-              maxlength="100"
-              size="small"
-              :disabled="disabled"
-            />
+            <ws-input v-model="customerList.bankCard" placeholder="请输入银行卡号" maxlength="100" size="small"
+              :disabled="disabled" />
           </ws-form-item>
           </ws-form-item>
           <ws-form-item label="开户行" span="1" prop="bankDeposit">
           <ws-form-item label="开户行" span="1" prop="bankDeposit">
-            <ws-input
-              v-model="customerList.bankDeposit"
-              placeholder="请输入开户行"
-              maxlength="100"
-              size="small"
-              :disabled="disabled"
-            />
+            <ws-input v-model="customerList.bankDeposit" placeholder="请输入开户行" maxlength="100" size="small"
+              :disabled="disabled" />
           </ws-form-item>
           </ws-form-item>
           <ws-form-item label="开户支行" span="1" prop="bankDepositBranch">
           <ws-form-item label="开户支行" span="1" prop="bankDepositBranch">
-            <ws-input
-              v-model="customerList.bankDepositBranch"
-              placeholder="请输入开户支行"
-              maxlength="100"
-              size="small"
-              :disabled="disabled"
-            />
+            <ws-input v-model="customerList.bankDepositBranch" placeholder="请输入开户支行" maxlength="100" size="small"
+              :disabled="disabled" />
           </ws-form-item>
           </ws-form-item>
           <ws-form-item label="收款人姓名" span="1" prop="payeeName">
           <ws-form-item label="收款人姓名" span="1" prop="payeeName">
-            <ws-input
-              v-model="customerList.payeeName"
-              placeholder="请输入收款人姓名"
-              maxlength="100"
-              size="small"
-              :disabled="disabled"
-            />
+            <ws-input v-model="customerList.payeeName" placeholder="请输入收款人姓名" maxlength="100" size="small"
+              :disabled="disabled" />
           </ws-form-item>
           </ws-form-item>
           <ws-form-item label="收款人身份证号" span="1" prop="payeeNumberCard">
           <ws-form-item label="收款人身份证号" span="1" prop="payeeNumberCard">
-            <ws-input
-              v-model="customerList.payeeNumberCard"
-              placeholder="请输入收款人身份证号"
-              maxlength="100"
-              size="small"
-              :disabled="disabled"
-            />
+            <ws-input v-model="customerList.payeeNumberCard" placeholder="请输入收款人身份证号" maxlength="100" size="small"
+              :disabled="disabled" />
           </ws-form-item>
           </ws-form-item>
           <ws-form-item label="手机号" span="1" prop="customerPhone">
           <ws-form-item label="手机号" span="1" prop="customerPhone">
-            <ws-input
-              v-model="customerList.customerPhone"
-              placeholder="请输入手机号"
-              maxlength="100"
-              size="small"
-              :disabled="disabled"
-            />
+            <ws-input v-model="customerList.customerPhone" placeholder="请输入手机号" maxlength="100" size="small"
+              :disabled="disabled" />
           </ws-form-item>
           </ws-form-item>
           <!-- 验证码 -->
           <!-- 验证码 -->
           <!-- <el-form-item prop="veriCode" :label="$t('login.register08')">
           <!-- <el-form-item prop="veriCode" :label="$t('login.register08')">
@@ -274,389 +106,469 @@
                 >{{ $t('login.retry') }}({{ count }})s</ws-button
                 >{{ $t('login.retry') }}({{ count }})s</ws-button
               >
               >
             </div>
             </div>
-          </div> 
+          </div>
         </el-form-item> -->
         </el-form-item> -->
           <ws-form-item label="联系地址" span="1" prop="compAddress">
           <ws-form-item label="联系地址" span="1" prop="compAddress">
-            <ws-input
-              v-model="customerList.compAddress"
-              placeholder="请输入联系地址"
-              maxlength="100"
-              size="small"
-              :disabled="disabled"
-            />
+            <ws-input v-model="customerList.compAddress" placeholder="请输入联系地址" maxlength="100" size="small"
+              :disabled="disabled" />
           </ws-form-item>
           </ws-form-item>
         </ws-info-table>
         </ws-info-table>
         <div class="but">
         <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>
         </div>
       </ws-form>
       </ws-form>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import {
-  customerAdd,
-  customerIdentity,
-  getCustomerLook,
-  CustomerEdit,
-  getIdentity,
-  getBank
-} from '@/model/houseSelfCollect/index'
-
-export default {
-  components: {},
-  watch: {},
-  data() {
-    return {
-      dialogImageUrl: '',
-      dialogVisible: false,
-      customerList: {
-        customerName:"",
-        customerNumberCard:"",
-        bankCard:"",
-        bankDeposit:"",
-      },
-      disabledFlag: true,
-      disabled: false,
-      identity: [],
-      bank: [],
-      trader: '新增',
-      switchType: '',
-      identityImgUp: [
-        {
-          url: '',
+  import {
+    customerAdd,
+    customerIdentity,
+    getCustomerLook,
+    CustomerEdit,
+    getIdentity,
+    getBank
+  } from '@/model/houseSelfCollect/index'
+
+  export default {
+    components: {},
+    watch: {},
+    data() {
+      return {
+        imageUrl1: "",
+        imageUrl2: "",
+        imageUrl3: "",
+        imageUrl4: "",
+        dialogImageUrl: '',
+        dialogVisible: false,
+        customerList: {
+          customerName: "",
+          customerNumberCard: "",
+          bankCard: "",
+          bankDeposit: "",
         },
         },
-      ],
-      identityImgLow: [
-        {
+        disabledFlag: true,
+        disabled: false,
+        identity: [],
+        bank: [],
+        trader: '新增',
+        switchType: '',
+        identityImgUp: [{
           url: '',
           url: '',
-        },
-      ],
-      bankImgUp: [
-        {
+        }, ],
+        identityImgLow: [{
           url: '',
           url: '',
-        },
-      ],
-      bankImgLow: [
-        {
+        }, ],
+        bankImgUp: [{
           url: '',
           url: '',
-        },
-      ],
-      identityUp: 'up',
-      identityLow: 'low',
-      bankUps: 'bankUp',
-      bankLows: 'bankLow',
-    }
-  },
-  activated() {
-    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) {
-      this.disabled = true
-      this.trader = '查看'
-      this.getList(id)
-    } else if (this.switchType == 3) {
-      this.disabled = false
-      this.trader = '编辑'
-      this.getList(id)
-    }
-  },
-  methods: {
-    handleRemove(file, index) {
-      if (index == 1) {
-        this.identityUp = ''
-      } else if (index == 2) {
-        this.identityLow = ''
+        }, ],
+        bankImgLow: [{
+          url: '',
+        }, ],
+        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.imageUrl1=""
+        this.imageUrl2=""
+        this.imageUrl3=""
+        this.imageUrl4=""
+        this.customerList={}
+      }
+      let id = this.$route.query.id
+      if (this.switchType == 2) {
+        this.disabled = true
+        this.trader = '查看'
+        this.getList(id)
+      } else if (this.switchType == 3) {
+        this.disabled = false
+        this.trader = '编辑'
+        this.getList(id)
       }
       }
+    },
+    methods: {
+      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, '')
+        if (this.switchType == 3) {
+          for (let i = 0; i < this.identity.length; i++) {
+            if (file.url == this.identity[i]) {
+              this.identity.splice(i, 1, '')
+            }
           }
           }
-        }
-      } 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, '')
+        } 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, '')
+            }
           }
           }
         }
         }
-      }
-    },
-    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, '')
-          }
+      },
+      handleRemove1(file, index) {
+        if (index == 1) {
+          this.bankUps = ''
+        } else if (index == 2) {
+          this.bankLows = ''
         }
         }
-      } 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, '')
+        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, '')
+            }
           }
           }
         }
         }
-      }
-    },
-    handlePictureCardPreview(file) {
-      this.dialogImageUrl = file.url
-      this.dialogVisible = true
-    },
-    // 发送验证码
-    toSend() {
-      if (this.registerForm.linkmanPhone) {
-        if (validUserCellPhone(this.registerForm.linkmanPhone)) {
-          this.disabledFlag = false
-          clearInterval(this.timer)
-          this.timer = null
-          const TIME_COUNT = 60
-          if (!this.timer) {
-            this.count = TIME_COUNT
-            this.verification = false
-            let data = {
-              mobilePhone: this.registerForm.linkmanPhone,
+      },
+      handlePictureCardPreview(file) {
+        this.dialogImageUrl = file.url
+        this.dialogVisible = true
+      },
+      // 发送验证码
+      toSend() {
+        if (this.registerForm.linkmanPhone) {
+          if (validUserCellPhone(this.registerForm.linkmanPhone)) {
+            this.disabledFlag = false
+            clearInterval(this.timer)
+            this.timer = null
+            const TIME_COUNT = 60
+            if (!this.timer) {
+              this.count = TIME_COUNT
+              this.verification = false
+              let data = {
+                mobilePhone: this.registerForm.linkmanPhone,
+              }
+              sendRegisterCode(data)
+                .toPromise()
+                .then((res) => {
+                  this.timer = setInterval(() => {
+                    if (this.count > 0 && this.count <= TIME_COUNT) {
+                      this.count--
+                    } else {
+                      this.verification = true
+                      clearInterval(this.timer)
+                      this.timer = null
+                    }
+                  }, 1000)
+                })
+                .catch((err) => {
+                  this.verification = true
+                })
             }
             }
-            sendRegisterCode(data)
-              .toPromise()
-              .then((res) => {
-                this.timer = setInterval(() => {
-                  if (this.count > 0 && this.count <= TIME_COUNT) {
-                    this.count--
-                  } else {
-                    this.verification = true
-                    clearInterval(this.timer)
-                    this.timer = null
-                  }
-                }, 1000)
-              })
-              .catch((err) => {
-                this.verification = true
-              })
+          } else {
+            EventBus.$emit('error', this.$t('login.registerVerif09'))
           }
           }
         } else {
         } else {
-          EventBus.$emit('error', this.$t('login.registerVerif09'))
+          EventBus.$emit('error', this.$t('login.registerVerif05'))
         }
         }
-      } else {
-        EventBus.$emit('error', this.$t('login.registerVerif05'))
-      }
-    },
-    cancel() {
-      this.$router.push({ path: 'customerManagement' })
-    },
-    upLoadSuccess1(e) {
-      this.identityUp = 'up'
-      this.identity[0] = e.url
-      getIdentity({personImg:e.url})
-        .toPromise()
-        .then((response) => {
-          if(response.recPerson != "" ){
-             this.customerList.customerName = response.recPerson
-          }
-          if(response.recPersonNo != ""){
-             this.customerList.customerNumberCard = response.recPersonNo
-          }
+      },
+      cancel() {
+        this.$router.push({
+          path: 'customerManagement'
         })
         })
-    },
-    upLoadSuccess2(e) {
-      this.identityLow = 'low'
-      this.identity[1] = e.url
-      getIdentity({personImg:e.url})
-        .toPromise()
-        .then((response) => {
-          if(response.recPerson != "" ){
-             this.customerList.customerName = response.recPerson
-          }
-          if(response.recPersonNo != ""){
-             this.customerList.customerNumberCard = response.recPersonNo
+      },
+      upLoadSuccess1(e) {
+        debugger
+        this.identityUp = 'up'
+        this.identity[0] = e.url
+        this.imageUrl1 = e.url
+        getIdentity({
+            personImg: e.url
+          })
+          .toPromise()
+          .then((response) => {
+            if (response.recPerson != "") {
+              this.customerList.customerName = response.recPerson
+            }
+            if (response.recPersonNo != "") {
+              this.customerList.customerNumberCard = response.recPersonNo
+            }
+          })
+      },
+      upLoadSuccess2(e) {
+        this.identityLow = 'low'
+        this.identity[1] = e.url
+        this.imageUrl2 = e.url
+        getIdentity({
+            personImg: e.url
+          })
+          .toPromise()
+          .then((response) => {
+            if (response.recPerson != "") {
+              this.customerList.customerName = response.recPerson
+            }
+            if (response.recPersonNo != "") {
+              this.customerList.customerNumberCard = response.recPersonNo
 
 
-          }
-        })
-    },
-    bankSuccess1(e) {
-      this.bankUps = 'bankUp'
-      this.bank[0] = e.url
-        getBank({bankImg:e.url})
-        .toPromise()
-        .then((response) => {
-          if(response.bankNo  ){
-             this.customerList.bankCard = response.bankNo
-          }
-          if(response.bankName ){
-             this.customerList.bankDeposit = response.bankName
-          }
-        })
-    },
-    bankSuccess2(e) {
-      this.bankLows = 'bankLow'
-      this.bank[1] = e.url
-       getBank({bankImg:e.url})
-        .toPromise()
-        .then((response) => {
-          if(response.bankNo  ){
-             this.customerList.bankCard = response.bankNo
-          }
-          if(response.bankName ){
-             this.customerList.bankDeposit = response.bankName
-          }
-        })
-    },
-    commit() {
-      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',
-        })
-          .then(() => {
-            customerAdd(this.customerList)
-              .toPromise()
-              .then((response) => {
-                // this.customerList.id = response
-                // customerIdentity(this.customerList)
-                //   .toPromise()
-                //   .then((response) => {
-                //     this.$message.success('添加成功')
-                //     this.$router.push({ path: 'customerManagement' })
-                //   })
-                this.$router.go(-1)
-              })
+            }
           })
           })
-          .catch(() => {
-            return false
+      },
+      bankSuccess1(e) {
+        this.bankUps = 'bankUp'
+        this.bank[0] = e.url
+        this.imageUrl3 = e.url
+        getBank({
+            bankImg: e.url
           })
           })
-      } 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' })
-              })
+          .toPromise()
+          .then((response) => {
+            if (response.bankNo) {
+              this.customerList.bankCard = response.bankNo
+            }
+            if (response.bankName) {
+              this.customerList.bankDeposit = response.bankName
+            }
           })
           })
-          .catch(() => {
-            return false
+      },
+      bankSuccess2(e) {
+        this.bankLows = 'bankLow'
+        this.bank[1] = e.url
+        this.imageUrl4 = e.url
+        getBank({
+            bankImg: e.url
           })
           })
-      }
-    },
-    getList(ids) {
-      getCustomerLook({ id: ids,authenticationStatusKey: 7 })
-        .toPromise()
-        .then((response) => {
-          this.customerList = response
-          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]
-        })
+          .toPromise()
+          .then((response) => {
+            if (response.bankNo) {
+              this.customerList.bankCard = response.bankNo
+            }
+            if (response.bankName) {
+              this.customerList.bankDeposit = response.bankName
+            }
+          })
+      },
+      commit() {
+        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',
+            })
+            .then(() => {
+              customerAdd(this.customerList)
+                .toPromise()
+                .then((response) => {
+                  // this.customerList.id = response
+                  // customerIdentity(this.customerList)
+                  //   .toPromise()
+                  //   .then((response) => {
+                  //     this.$message.success('添加成功')
+                  //     this.$router.push({ path: 'customerManagement' })
+                  //   })
+                  this.$router.go(-1)
+                })
+            })
+            .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,
+            authenticationStatusKey: 7
+          })
+          .toPromise()
+          .then((response) => {
+            this.customerList = response
+            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.imageUrl1=this.identity[0]
+                this.imageUrl2=this.identity[1]
+                    this.imageUrl3=this.bank[0]
+                        this.imageUrl4=this.bank[1]
+          })
+      },
     },
     },
-  },
-}
+  }
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-.center {
-  background: #f6f7fc;
+  .avatar-uploader1 {
+    background: url('../../../public/img/identityup.png');
+  }
+
+  .avatar-uploader2 {
+    background: url('../../../public/img/identitylow.png');
+  }
+
+  .avatar-uploader3 {
+    background: url('../../../public/img/bankup.png');
+  }
+
+  .avatar-uploader4 {
+    background: url('../../../public/img/banklow.png');
+  }
+/deep/.el-upload{
+  height: 200px;
 }
 }
+  .avatar-uploader {
+    background-size: 100% 100%;
+  }
+
+  .avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+  }
+
+  .avatar-uploader .el-upload:hover {
+    border-color: #409EFF;
+  }
+
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 178px;
+    height: 178px;
+    line-height: 178px;
+    text-align: center;
+  }
 
 
-.seach {
-  display: flex;
-  align-items: center;
+  .avatar {
+      width: 330px;
+      height: 103%;
+    display: block;
+  }
 
 
-  .find {
-    width: 32px;
+  .center {
+    background: #f6f7fc;
   }
   }
 
 
-  .search-left {
+  .seach {
     display: flex;
     display: flex;
+    align-items: center;
+
+    .find {
+      width: 32px;
+    }
+
+    .search-left {
+      display: flex;
+    }
   }
   }
-}
 
 
-.ws-info-table {
-  border: none;
-  width: 50%;
-  margin: 0 auto;
-}
-.ws-info-table .el-form-item {
-  width: 50%;
-  border: none;
-}
-/deep/.ws-info-table .el-form-item .el-form-item__label {
-  width: 30%;
-  text-align: center;
-  background: #ffffff;
-  font-size: 14px;
-  color: #8890b1;
-}
-/deep/.ws-info-table .el-form-item .el-form-item__content {
-  border: none;
-}
-.bg-left {
-  padding-left: 30px;
-}
-.bg-right {
-  padding-right: 10px;
-  text-align: right;
-}
-.bg-bottom {
-  margin: 15px 0px;
-}
-.titleup {
-  position: relative;
-}
-.titleup::before {
-  content: '';
-  display: inline-block;
-  width: 5px;
-  height: 30px;
-  background: #5473e8;
-  position: absolute;
-  left: 0;
-}
-.unload {
-  background: #ffffff;
-  padding-top: 20px;
-}
-.but {
-  text-align: center;
-  margin: 20px auto;
-}
-/deep/.up .el-upload--picture-card {
-  display: none;
-}
-/deep/.low .el-upload--picture-card {
-  display: none;
-}
-/deep/.bankUp .el-upload--picture-card {
-  display: none;
-}
-/deep/.bankLow .el-upload--picture-card {
-  display: none;
-}
+  .ws-info-table {
+    border: none;
+    width: 80%;
+    margin: 0 auto;
+  }
+
+  .ws-info-table .el-form-item {
+    width: 50%;
+    border: none;
+  }
+
+  /deep/.ws-info-table .el-form-item .el-form-item__label {
+    width: 30%;
+    text-align: center;
+    background: #ffffff;
+    font-size: 14px;
+    color: #8890b1;
+  }
+
+  /deep/.ws-info-table .el-form-item .el-form-item__content {
+    border: none;
+  }
+
+  .bg-left {
+    padding-left: 30px;
+  }
+
+  .bg-right {
+    padding-right: 10px;
+    text-align: right;
+  }
+
+  .bg-bottom {
+    margin: 15px 0px;
+  }
+
+  .titleup {
+    position: relative;
+  }
+
+  .titleup::before {
+    content: '';
+    display: inline-block;
+    width: 5px;
+    height: 30px;
+    background: #5473e8;
+    position: absolute;
+    left: 0;
+  }
+
+  .unload {
+    background: #ffffff;
+    padding-top: 20px;
+  }
+
+  .but {
+    text-align: center;
+    margin: 20px auto;
+  }
+
+  /deep/.up .el-upload--picture-card {
+    display: none;
+  }
+
+  /deep/.low .el-upload--picture-card {
+    display: none;
+  }
+
+  /deep/.bankUp .el-upload--picture-card {
+    display: none;
+  }
+
+  /deep/.bankLow .el-upload--picture-card {
+    display: none;
+  }
+
+  .unload-img {
+    margin: 20px 0;
+  }
 </style>
 </style>

+ 623 - 688
src/views/houseSelfCollect/inspectInfo.vue

@@ -6,15 +6,9 @@
         <h2 class="bg-left titleup">{{ information }}质检信息</h2>
         <h2 class="bg-left titleup">{{ information }}质检信息</h2>
       </el-col>
       </el-col>
       <el-col :span="12" class="bg-right">
       <el-col :span="12" class="bg-right">
-        <el-button class="bg-bottom" type="primary" size="small" @click="cancel"
-          ><img
-            width="6"
-            height="10"
-            style="vertical-align: bottom; margin-right: 3px"
-            src="../../../public/img/lujing.png"
-            alt=""
-          />返回</el-button
-        >
+        <el-button class="bg-bottom" type="primary" size="small" @click="cancel"><img width="6" height="10"
+            style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
+        </el-button>
       </el-col>
       </el-col>
     </el-row>
     </el-row>
     <div class="substance">
     <div class="substance">
@@ -23,759 +17,700 @@
           <div class="title">基本信息</div>
           <div class="title">基本信息</div>
           <ws-info-table>
           <ws-info-table>
             <ws-form-item label="仓库" span="1" prop="warehouseName">
             <ws-form-item label="仓库" span="1" prop="warehouseName">
-              <ws-input
-                v-model="warehouseName"
-                placeholder="请输入仓库"
-                maxlength="100"
-                disabled
-                size="small"
-              />
+              <ws-input v-model="warehouseName" placeholder="请输入仓库" maxlength="100" disabled size="small" />
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="编号" span="1" prop="qualityNo">
             <ws-form-item label="编号" span="1" prop="qualityNo">
-              <ws-input
-                v-model="inspect.qualityNo"
-                placeholder="请输入编号"
-                maxlength="100"
-                disabled
-                size="small"
-              />
+              <ws-input v-model="inspect.qualityNo" placeholder="请输入编号" maxlength="100" disabled size="small" />
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="仓位号" span="1" prop="binNumber">
             <ws-form-item label="仓位号" span="1" prop="binNumber">
-              <ws-select
-                v-model="inspect.binNumber"
-                placeholder="请输入仓位号"
-                class="typeselect"
-                :disabled="disabled"
-              >
-                <ws-option
-                  v-for="item in getbinNumberList"
-                  :key="item.value"
-                  :label="item.value"
-                  :value="item.value"
-                />
+              <ws-select v-model="inspect.binNumber" placeholder="请输入仓位号" class="typeselect" :disabled="disabled">
+                <ws-option v-for="item in getbinNumberList" :key="item.value" :label="item.value" :value="item.value" />
               </ws-select>
               </ws-select>
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="客户" span="1" prop="customerName">
             <ws-form-item label="客户" span="1" prop="customerName">
-              <ws-select
-                v-model="inspect.customerName"
-                placeholder=""
-                class="typeselect"
-                @change="customerChange"
-                :disabled="disabled1"
-              >
-                <ws-option
-                  v-for="item in customerList"
-                  :key="item.valueKey"
-                  :label="item.value"
-                  :value="item.value"
-                />
+              <ws-select v-model="inspect.customerName" placeholder="" class="typeselect" @change="customerChange"
+                :disabled="disabled1">
+                <ws-option v-for="item in customerList" :key="item.valueKey" :label="item.value" :value="item.value" />
               </ws-select>
               </ws-select>
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="囤位号" span="1" prop="storageTagNo">
             <ws-form-item label="囤位号" span="1" prop="storageTagNo">
-              <ws-input
-                v-model="inspect.storageTagNo"
-                placeholder="请输入囤位号"
-                maxlength="100"
-                size="small"
-                :disabled="disabled"
-              />
+              <ws-input v-model="inspect.storageTagNo" placeholder="请输入囤位号" maxlength="100" size="small"
+                :disabled="disabled" />
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="车牌号" span="1" prop="carNumber">
             <ws-form-item label="车牌号" span="1" prop="carNumber">
-              <ws-input
-                v-model="inspect.carNumber"
-                placeholder="请输入车牌号"
-                maxlength="100"
-                size="small"
-                :disabled="disabled"
-              />
+              <ws-input v-model="inspect.carNumber" placeholder="请输入车牌号" maxlength="100" size="small"
+                :disabled="disabled" />
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="货名" span="1" prop="goodsName">
             <ws-form-item label="货名" span="1" prop="goodsName">
-              <ws-select
-                v-model="inspect.goodsName"
-                placeholder=""
-                class="typeselect"
-                :disabled="disabled1"
-                @change="waterContentChange"
-              >
-                <ws-option
-                  v-for="item in goodNameList"
-                  :key="item.goodsName"
-                  :label="item.goodsName"
-                  :value="item.goodsName"
-                />
+              <ws-select v-model="inspect.goodsName" placeholder="" class="typeselect" :disabled="disabled1"
+                @change="waterContentChange">
+                <ws-option v-for="item in goodNameList" :key="item.goodsName" :label="item.goodsName"
+                  :value="item.goodsName" />
               </ws-select>
               </ws-select>
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="扣重比" span="1" prop="buckleWeightRatio">
             <ws-form-item label="扣重比" span="1" prop="buckleWeightRatio">
-              <ws-input
-                v-model="inspect.buckleWeightRatio"
-                placeholder="请输入扣重比"
-                maxlength="100"
-                size="small"
-                :disabled="disabled"
-              />
+              <ws-input v-model="inspect.buckleWeightRatio" placeholder="请输入扣重比" maxlength="100" size="small"
+                :disabled="disabled" />
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="类型" span="1" prop="type">
             <ws-form-item label="类型" span="1" prop="type">
-              <ws-select
-                v-model="inspect.type"
-                placeholder=""
-                :disabled="disabled"
-              >
-                <ws-option
-                  v-for="item in typeList"
-                  :key="item"
-                  :label="item"
-                  :value="item"
-                />
+              <ws-select v-model="inspect.type" placeholder="" :disabled="disabled">
+                <ws-option v-for="item in typeList" :key="item" :label="item" :value="item" />
               </ws-select>
               </ws-select>
             </ws-form-item>
             </ws-form-item>
-            <ws-form-item
-              label="购粮性质"
-              span="1"
-              prop="natureOfGrainPurchase"
-            >
-              <ws-input
-                v-model="inspect.natureOfGrainPurchase"
-                placeholder="请输入购粮性质"
-                maxlength="100"
-                size="small"
-                :disabled="disabled"
-              />
+            <ws-form-item label="购粮性质" span="1" prop="natureOfGrainPurchase">
+              <ws-input v-model="inspect.natureOfGrainPurchase" placeholder="请输入购粮性质" maxlength="100" size="small"
+                :disabled="disabled" />
             </ws-form-item>
             </ws-form-item>
-            <ws-form-item
-              label="净重单价(元/公斤)"
-              span="1"
-              prop="buckleWeightRatio"
-            >
-              <ws-input
-                v-model="inspect.tidalGrainPrice"
-                placeholder="请输入净重单价"
-                maxlength="100"
-                size="small"
-                disabled
-              />
+            <ws-form-item label="净重单价(元/公斤)" span="1" prop="buckleWeightRatio">
+              <ws-input v-model="inspect.tidalGrainPrice" placeholder="请输入净重单价" maxlength="100" size="small" disabled />
             </ws-form-item>
             </ws-form-item>
           </ws-info-table>
           </ws-info-table>
 
 
           <div class="title">质检数据</div>
           <div class="title">质检数据</div>
           <ws-info-table>
           <ws-info-table>
             <ws-form-item label="等级" span="1" prop="grade">
             <ws-form-item label="等级" span="1" prop="grade">
-              <ws-select
-                v-model="inspect.grade"
-                placeholder="请输入等级"
-                class="typeselect"
-                @change="waterContentChange"
-                :disabled="disabled"
-              >
-                <ws-option
-                  v-for="item in gradeList"
-                  :key="item.constKey"
-                  :label="item.constValue"
-                  :value="item.constValue"
-                />
+              <ws-select v-model="inspect.grade" placeholder="请输入等级" class="typeselect" @change="waterContentChange"
+                :disabled="disabled">
+                <ws-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
+                  :value="item.constValue" />
               </ws-select>
               </ws-select>
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="杂质(%)" span="1" prop="impurity">
             <ws-form-item label="杂质(%)" span="1" prop="impurity">
-              <ws-input
-                v-model="inspect.impurity"
-                placeholder="请输入杂质占比"
-                maxlength="100"
-                size="small"
-                :disabled="disabled"
-              />
+              <ws-input v-model="inspect.impurity" placeholder="请输入杂质占比" maxlength="100" size="small"
+                :disabled="disabled" />
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="水分(%)" span="1" prop="waterContent">
             <ws-form-item label="水分(%)" span="1" prop="waterContent">
-              <ws-input
-                v-model="inspect.waterContent"
-                placeholder="请输入水分占比"
-                maxlength="100"
-                size="small"
-                @change="waterContentChange"
-                :disabled="disabled"
-              />
+              <ws-input v-model="inspect.waterContent" placeholder="请输入水分占比" maxlength="100" size="small"
+                @change="waterContentChange" :disabled="disabled" />
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="霉变粒(%)" span="1" prop="mildewGrain">
             <ws-form-item label="霉变粒(%)" span="1" prop="mildewGrain">
-              <ws-input
-                v-model="inspect.mildewGrain"
-                placeholder="请输入霉变粒占比"
-                maxlength="100"
-                size="small"
-                :disabled="disabled"
-              />
+              <ws-input v-model="inspect.mildewGrain" placeholder="请输入霉变粒占比" maxlength="100" size="small"
+                :disabled="disabled" />
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="容重(克/升)" span="1" prop="bulkDensity">
             <ws-form-item label="容重(克/升)" span="1" prop="bulkDensity">
-              <ws-input
-                v-model="inspect.bulkDensity"
-                placeholder="请输入容重"
-                maxlength="100"
-                size="small"
-                :disabled="disabled"
-              />
+              <ws-input v-model="inspect.bulkDensity" placeholder="请输入容重" maxlength="100" size="small"
+                :disabled="disabled" />
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="热损伤(%)" span="1" prop="jiaorenli">
             <ws-form-item label="热损伤(%)" span="1" prop="jiaorenli">
-              <ws-input
-                v-model="inspect.jiaorenli"
-                placeholder="请输入热损伤占比"
-                maxlength="100"
-                size="small"
-                :disabled="disabled"
-              />
+              <ws-input v-model="inspect.jiaorenli" placeholder="请输入热损伤占比" maxlength="100" size="small"
+                :disabled="disabled" />
             </ws-form-item>
             </ws-form-item>
             <ws-form-item label="不完整粒(%)" span="1" prop="imperfectGrain">
             <ws-form-item label="不完整粒(%)" span="1" prop="imperfectGrain">
-              <ws-input
-                v-model="inspect.imperfectGrain"
-                placeholder="请输入不完整粒占比"
-                maxlength="100"
-                size="small"
-                :disabled="disabled"
-              />
+              <ws-input v-model="inspect.imperfectGrain" placeholder="请输入不完整粒占比" maxlength="100" size="small"
+                :disabled="disabled" />
             </ws-form-item>
             </ws-form-item>
           </ws-info-table>
           </ws-info-table>
           <!-- <div style="text-align: right; color: #323233">
           <!-- <div style="text-align: right; color: #323233">
             潮粮单价(元/公斤):{{ unitPrice}}
             潮粮单价(元/公斤):{{ unitPrice}}
           </div> -->
           </div> -->
           <div class="but">
           <div class="but">
-            <el-button @click="cancel" v-if="this.types != 2" type="primary"
-              >取消</el-button
-            >
-            <el-button @click="print" v-if="this.types != 2" type="primary"
-              >保存并打印</el-button
-            >
-            <el-button @click="cancel" v-if="this.types == 2" type="primary"
-              >关闭</el-button
-            >
+            <el-button @click="cancel" v-if="this.types != 2" type="primary">取消</el-button>
+            <el-button @click="print" v-if="this.types != 2" type="primary">保存并打印</el-button>
+            <el-button @click="cancel" v-if="this.types == 2" type="primary">关闭</el-button>
           </div>
           </div>
         </div>
         </div>
       </ws-form>
       </ws-form>
     </div>
     </div>
-    <el-dialog
-      width="70%"
-      class="table-content"
-      center
-      :visible.sync="isShowPrint"
-      title="粮食质检单"
-    >
-      <inspectInfoPrint :printData="inspect"></inspectInfoPrint>
+    <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食质检单" @close="closeDialog">
+      <div slot="footer">
+        <inspectInfoPrint :printData="inspect" ref="saveImg"></inspectInfoPrint>
+        <div class="bottom-row4">
+          <el-button type="primary">关闭</el-button>
+          <el-button type="primary" @click="printSmall">打印小票</el-button>
+          <el-button type="primary" @click="printBig">打印单据</el-button>
+        </div>
+      </div>
     </el-dialog>
     </el-dialog>
   </div>
   </div>
 </template>
 </template>
 <script>
 <script>
-import {
-  inspectAdd,
-  getbinNumber,
-  getcustomer,
-  getinspectLook,
-  getinspectLookUnitPrice,
-  getinspectLookGoods,
-  getinspectEdit,
-  getamount,
-  getCount,
-} from '@/model/houseSelfCollect/index'
-import { packList } from '@/model/contarct/index'
-import inspectInfoPrint from './component/inspectInfoPrint.vue'
-export default {
-  components: {
-    inspectInfoPrint,
-  },
-  watch: {},
-  data() {
-    return {
-      isShowPrint: false,
-      // warehouseList: {},
-      inspect: {
-        tidalGrainPrice: 0,
-        buckleWeightRatio: 0,
-      },
-      disabled: false,
-      disabled1: false,
-      types: '1',
-      information: '添加',
-      goodNameList: [],
-      gradeList: [],
-      customerList: [],
-      getbinNumberList: [],
-      cangid: '', //仓库id
-      warehouseName: '',
-      unitPrice: 0,
-      count: 0,
-      cangNo: '',
-      typeList: ['干粮', '潮粮'],
-      purchasePriceList: [],
-      id: '',
-    }
-  },
-  activated() {
-    this.types = this.$route.query.type
-    this.cangid = this.$route.query.cangid
-    this.warehouseName = this.$route.query.warehouseName
-    this.cangNo = this.$route.query.warehouseNo
-    this.count = Number(this.$route.query.count) + 1
-    this.purchasePriceList = this.$route.query.purchasePriceList
-    this.id = this.$route.query.id
-    if (this.types == 2) {
-      this.disabled = true
-      this.disabled1 = true
-      this.information = '查看'
-    } else if (this.types == 3) {
-      this.disabled = false
-      this.disabled1 = true
-      this.information = '编辑'
-    }
-    this.calculation()
-    this.getList(this.id)
-  },
-  methods: {
-    getdate() {
-      var date = new Date()
-      var year = date.getFullYear() //获取完整的年份(4位)
-      var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
-      var datetime = date.getDate() //获取当前日(1-31)
-      if (mouth < 10) {
-        mouth = '0' + mouth
-      }
-      if (datetime < 10) {
-        datetime = '0' + datetime
-      }
-      return year + mouth + datetime
+  import {
+    inspectAdd,
+    getbinNumber,
+    getcustomer,
+    getinspectLook,
+    getinspectLookUnitPrice,
+    getinspectLookGoods,
+    getinspectEdit,
+    getamount,
+    getCount,
+  } from '@/model/houseSelfCollect/index'
+  import {
+    packList
+  } from '@/model/contarct/index'
+  import inspectInfoPrint from './component/inspectInfoPrint.vue'
+  import html2canvas from "html2canvas"
+  import axios from "axios"
+  export default {
+    components: {
+      inspectInfoPrint,
     },
     },
-    calculation() {
-      let number = '000' + this.count
-      number = number.substring(number.length - 4, number.length)
-      this.inspect.qualityNo = 'SGRK' + this.getdate() + this.cangNo + number //SGRK+8位时间+3位仓库编号+4位序列号
-      // + this.verifyinit()
+    watch: {},
+    data() {
+      return {
+        isShowPrint: false,
+        // warehouseList: {},
+        inspect: {
+          tidalGrainPrice: 0,
+          buckleWeightRatio: 0,
+        },
+        disabled: false,
+        disabled1: false,
+        types: '1',
+        information: '添加',
+        goodNameList: [],
+        gradeList: [],
+        customerList: [],
+        getbinNumberList: [],
+        cangid: '', //仓库id
+        warehouseName: '',
+        unitPrice: 0,
+        count: 0,
+        cangNo: '',
+        typeList: ['干粮', '潮粮'],
+        purchasePriceList: [],
+        id: '',
+      }
     },
     },
-    print() {
-      // if (!this.inspect.qualityNo) {
-      //   this.$message({
-      //     message: '编号不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.binNumber) {
-      //   this.$message({
-      //     message: '仓位不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.customerName) {
-      //   this.$message({
-      //     message: '客户不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.storageTagNo) {
-      //   this.$message({
-      //     message: '囤位号不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-
-      // if (this.inspect.storageTagNo.length > 10) {
-      //   this.$message({
-      //     message: '囤位号不超过10个字符',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.carNumber) {
-      //   this.$message({
-      //     message: '车牌号不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (this.inspect.carNumber.length > 7) {
-      //   this.$message({
-      //     message: '车牌号输入错误',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.goodsName) {
-      //   this.$message({
-      //     message: '货名不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (
-      //   this.inspect.buckleWeightRatio < 0 ||
-      //   this.inspect.buckleWeightRatio > 2
-      // ) {
-      //   this.$message({
-      //     message: '扣重比输入错误',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (
-      //   String(this.inspect.buckleWeightRatio).indexOf('.') != -1 &&
-      //   String(this.inspect.buckleWeightRatio).length -
-      //     (String(this.inspect.buckleWeightRatio).indexOf('.') + 1) >
-      //     2
-      // ) {
-      //   this.$message({
-      //     message: '扣重比输入错误',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.type) {
-      //   this.$message({
-      //     message: '类型不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.type) {
-      //   this.$message({
-      //     message: '类型不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.natureOfGrainPurchase) {
-      //   this.$message({
-      //     message: '购粮性质不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.grade) {
-      //   this.$message({
-      //     message: '等级不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.impurity) {
-      //   this.$message({
-      //     message: '杂质不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.waterContent) {
-      //   this.$message({
-      //     message: '水分不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.mildewGrain) {
-      //   this.$message({
-      //     message: '霉变粒不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.bulkDensity) {
-      //   this.$message({
-      //     message: '容重不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.jiaorenli) {
-      //   this.$message({
-      //     message: '热损伤不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // if (!this.inspect.imperfectGrain) {
-      //   this.$message({
-      //     message: '不完整粒不能为空',
-      //     type: 'warning',
-      //   })
-      //   return
-      // }
-      // //查看当前用户对应货名有未结算状态的送货
-      // let count = 0
-      // getCount({
-      //   compId: sessionStorage.getItem('ws-pf_compId'),
-      //   customerName: this.inspect.customerName,
-      //   goodsName: this.inspect.goodsName,
-      // })  .toPromise()
-      //   .then((response) => {
-      //        count = response
-      //   })
-      // //  客户下拉校验
-      // getamount({
-      //   compId: sessionStorage.getItem('ws-pf_compId'),
-      //   customerName: this.inspect.customerName,
-      //   goodsName: this.inspect.goodsName,
-      // })
-      //   .toPromise()
-      //   .then((response) => {
-      //     for (let i = 0; i < this.purchasePriceList.length; i++) {
-      //       if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
-      //         console.log(this.purchasePriceList[i].saleLimit - response)
-      //         if (this.purchasePriceList[i].saleLimit - response < 50 || count > 0) {
-      //           // this.$confirm(
-      //           //   '当前客户已累计销售我司' +
-      //           //     this.inspect.goodsName +
-      //           //     response +
-      //           //     '吨,最高可售' +
-      //           //     this.purchasePriceList[i].saleLimit +
-      //           //     '吨。',
-      //           //   '提示',
-      //           //   {
-      //           //     cancelButtonText: '取消',
-      //           //     type: 'warning',
-      //           //   }
-      //           // )
-      //           //   .then(() => {})
-      //           //   .catch(() => {
-      //           //     return false
-      //           //   })
-      //             this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + response +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
-      //                   '提示',
-      //                   {
-      //                     confirmButtonText: '确定',
-      //                     callback: (action) => {
-      //                       // this.$message({
-      //                       //   type: 'info',
-      //                       //   message: `累计售粮已超出上限`,
-      //                       // })
-      //                     },
-      //                   }
-      //                 )
-      //         }
-      //       }
-      //     }
-      //   })
-      this.inspect.warehouseName = this.warehouseName
-      this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
-      this.inspect.qualityInspector = sessionStorage.getItem('ws-pf_staffName')
-      if (this.types == null) {
-        this.$confirm('确定保存质检信息?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning',
-        })
-          .then(() => {
-            inspectAdd(this.inspect)
-              .toPromise()
-              .then((response) => {
-                this.$message.success('保存成功')
-                 getinspectLook({ id: response })
-                  .toPromise()
-                  .then((response) => {
-                    this.inspect = response
-                  })
-                this.isShowPrint = true
-                //打印
-                // this.$router.go(-1)
-              })
-          })
-          .catch(() => {
-            return false
-          })
+    activated() {
+      this.types = this.$route.query.type
+      this.cangid = this.$route.query.cangid
+      this.warehouseName = this.$route.query.warehouseName
+      this.cangNo = this.$route.query.warehouseNo
+      this.count = Number(this.$route.query.count) + 1
+      this.purchasePriceList = this.$route.query.purchasePriceList
+      this.id = this.$route.query.id
+      if (this.types == 2) {
+        this.disabled = true
+        this.disabled1 = true
+        this.information = '查看'
       } else if (this.types == 3) {
       } else if (this.types == 3) {
-        this.$confirm('确定保存质检信息?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning',
-        })
-          .then(() => {
-            // return
-            getinspectEdit(this.inspect)
-              .toPromise()
-              .then((response) => {
-                this.$message.success('修改成功')
-                getinspectLook({ id: this.inspect.id })
-                  .toPromise()
-                  .then((response) => {
-                    this.inspect = response
-                  })
-                this.isShowPrint = true
-              })
-          })
-          .catch(() => {
-            return false
-          })
+        this.disabled = false
+        this.disabled1 = true
+        this.information = '编辑'
       }
       }
+      this.calculation()
+      this.getList(this.id)
     },
     },
-    cancel() {
-      this.$router.push({ path: 'inspectionManagement' })
-    },
-    customerChange(e) {
-      let customers = e.split('(')
-      this.inspect.customerName = customers[0]
-      this.inspect.customerPhone = customers[1].split(')')[0]
-    },
+    methods: {
+      printSmall() {
+        window.location.href =
+          '../../../static/inspection.html?type=1&dataList=' +
+          JSON.stringify(this.printData)
+      },
+      printBig() {
+        window.location.href =
+          '../../../static/inspection.html?type=2&dataList=' +
+          JSON.stringify(this.printData)
+      },
+      getdate() {
+        var date = new Date()
+        var year = date.getFullYear() //获取完整的年份(4位)
+        var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
+        var datetime = date.getDate() //获取当前日(1-31)
+        if (mouth < 10) {
+          mouth = '0' + mouth
+        }
+        if (datetime < 10) {
+          datetime = '0' + datetime
+        }
+        return year + mouth + datetime
+      },
+      calculation() {
+        let number = '000' + this.count
+        number = number.substring(number.length - 4, number.length)
+        this.inspect.qualityNo = 'SGRK' + this.getdate() + this.cangNo + number //SGRK+8位时间+3位仓库编号+4位序列号
+        // + this.verifyinit()
+      },
+      closeDialog() {
+        html2canvas(this.$refs.saveImg.$el).then(canvas => {
+          let dataURL = canvas.toDataURL("image/png");
+          this.imgUrl = dataURL;
+          if (this.imgUrl !== "") {
+            let b = this.dataURLtoFile(this.imgUrl, "aa")
+            console.log(b)
+            let formdata = new FormData();
+            formdata.append("file", b);
+            axios({
+              method: 'post',
+              url: 'https://www.zthymaoyi.com/upload/admin',
+              data: formdata
+            }).then((response) => {
+              console.log(response)
+              //编辑接口
+              
+              this.inspect.pictureAddress=response.data.url
 
 
-    waterContentChange() {
-      if (this.inspect.goodsName) {
-        for (var i = 0; i < this.purchasePriceList.length; i++) {
-          if (this.purchasePriceList[i].goodsName == this.inspect.goodsName) {
-            this.inspect.buckleWeightRatio =
-              this.purchasePriceList[i].deductWeight
+            })
+
+            this.dialogTableVisible = true;
           }
           }
+        });
+      },
+      print() {
+        // if (!this.inspect.qualityNo) {
+        //   this.$message({
+        //     message: '编号不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.binNumber) {
+        //   this.$message({
+        //     message: '仓位不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.customerName) {
+        //   this.$message({
+        //     message: '客户不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.storageTagNo) {
+        //   this.$message({
+        //     message: '囤位号不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+
+        // if (this.inspect.storageTagNo.length > 10) {
+        //   this.$message({
+        //     message: '囤位号不超过10个字符',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.carNumber) {
+        //   this.$message({
+        //     message: '车牌号不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (this.inspect.carNumber.length > 7) {
+        //   this.$message({
+        //     message: '车牌号输入错误',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.goodsName) {
+        //   this.$message({
+        //     message: '货名不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (
+        //   this.inspect.buckleWeightRatio < 0 ||
+        //   this.inspect.buckleWeightRatio > 2
+        // ) {
+        //   this.$message({
+        //     message: '扣重比输入错误',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (
+        //   String(this.inspect.buckleWeightRatio).indexOf('.') != -1 &&
+        //   String(this.inspect.buckleWeightRatio).length -
+        //     (String(this.inspect.buckleWeightRatio).indexOf('.') + 1) >
+        //     2
+        // ) {
+        //   this.$message({
+        //     message: '扣重比输入错误',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.type) {
+        //   this.$message({
+        //     message: '类型不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.type) {
+        //   this.$message({
+        //     message: '类型不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.natureOfGrainPurchase) {
+        //   this.$message({
+        //     message: '购粮性质不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.grade) {
+        //   this.$message({
+        //     message: '等级不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.impurity) {
+        //   this.$message({
+        //     message: '杂质不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.waterContent) {
+        //   this.$message({
+        //     message: '水分不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.mildewGrain) {
+        //   this.$message({
+        //     message: '霉变粒不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.bulkDensity) {
+        //   this.$message({
+        //     message: '容重不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.jiaorenli) {
+        //   this.$message({
+        //     message: '热损伤不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // if (!this.inspect.imperfectGrain) {
+        //   this.$message({
+        //     message: '不完整粒不能为空',
+        //     type: 'warning',
+        //   })
+        //   return
+        // }
+        // //查看当前用户对应货名有未结算状态的送货
+        // let count = 0
+        // getCount({
+        //   compId: sessionStorage.getItem('ws-pf_compId'),
+        //   customerName: this.inspect.customerName,
+        //   goodsName: this.inspect.goodsName,
+        // })  .toPromise()
+        //   .then((response) => {
+        //        count = response
+        //   })
+        // //  客户下拉校验
+        // getamount({
+        //   compId: sessionStorage.getItem('ws-pf_compId'),
+        //   customerName: this.inspect.customerName,
+        //   goodsName: this.inspect.goodsName,
+        // })
+        //   .toPromise()
+        //   .then((response) => {
+        //     for (let i = 0; i < this.purchasePriceList.length; i++) {
+        //       if (this.inspect.goodsName == this.purchasePriceList[i].goodsName) {
+        //         console.log(this.purchasePriceList[i].saleLimit - response)
+        //         if (this.purchasePriceList[i].saleLimit - response < 50 || count > 0) {
+        //           // this.$confirm(
+        //           //   '当前客户已累计销售我司' +
+        //           //     this.inspect.goodsName +
+        //           //     response +
+        //           //     '吨,最高可售' +
+        //           //     this.purchasePriceList[i].saleLimit +
+        //           //     '吨。',
+        //           //   '提示',
+        //           //   {
+        //           //     cancelButtonText: '取消',
+        //           //     type: 'warning',
+        //           //   }
+        //           // )
+        //           //   .then(() => {})
+        //           //   .catch(() => {
+        //           //     return false
+        //           //   })
+        //             this.$alert('当前客户已累计销售我司' +this.inspect.goodsName + response +'吨,最高可售' +this.purchasePriceList[i].saleLimit +'吨。',
+        //                   '提示',
+        //                   {
+        //                     confirmButtonText: '确定',
+        //                     callback: (action) => {
+        //                       // this.$message({
+        //                       //   type: 'info',
+        //                       //   message: `累计售粮已超出上限`,
+        //                       // })
+        //                     },
+        //                   }
+        //                 )
+        //         }
+        //       }
+        //     }
+        //   })
+        this.inspect.warehouseName = this.warehouseName
+        this.inspect.compId = sessionStorage.getItem('ws-pf_compId')
+        this.inspect.qualityInspector = sessionStorage.getItem('ws-pf_staffName')
+        if (this.types == null) {
+          this.$confirm('确定保存质检信息?', '提示', {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning',
+            })
+            .then(() => {
+              inspectAdd(this.inspect)
+                .toPromise()
+                .then((response) => {
+                  this.$message.success('保存成功')
+                  getinspectLook({
+                      id: response
+                    })
+                    .toPromise()
+                    .then((response) => {
+                      this.inspect = response
+                    })
+                  this.isShowPrint = true
+                  //打印
+                  // this.$router.go(-1)
+                })
+            })
+            .catch(() => {
+              return false
+            })
+        } else if (this.types == 3) {
+          this.$confirm('确定保存质检信息?', '提示', {
+              confirmButtonText: '确定',
+              cancelButtonText: '取消',
+              type: 'warning',
+            })
+            .then(() => {
+              // return
+              getinspectEdit(this.inspect)
+                .toPromise()
+                .then((response) => {
+                  this.$message.success('修改成功')
+                  getinspectLook({
+                      id: this.inspect.id
+                    })
+                    .toPromise()
+                    .then((response) => {
+                      this.inspect = response
+                    })
+                  this.isShowPrint = true
+                })
+            })
+            .catch(() => {
+              return false
+            })
         }
         }
-      }
-      //潮粮单价改变事件
-      if (
-        this.inspect.goodsName &&
-        this.inspect.waterContent &&
-        this.inspect.grade
-      ) {
-        getinspectLookUnitPrice({
-          warehouseId: this.cangid,
-          goodsName: this.inspect.goodsName,
-          waterContent: this.inspect.waterContent,
-          grade: this.inspect.grade,
+      },
+      cancel() {
+        this.$router.push({
+          path: 'inspectionManagement'
         })
         })
-          .toPromise()
-          .then((response) => {
-            this.inspect.tidalGrainPrice = response
-            this.unitPrice = response
-          })
-      }
-    },
+      },
+      customerChange(e) {
+        let customers = e.split('(')
+        this.inspect.customerName = customers[0]
+        this.inspect.customerPhone = customers[1].split(')')[0]
+      },
 
 
-    getList(ids) {
-      // 货名
-      getinspectLookGoods({ warehouseId: this.cangid })
-        .toPromise()
-        .then((response) => {
-          this.goodNameList = []
-          this.goodNameList = response
-        })
-      // 品级
-      packList({ constId: 'CON3' })
-        .toPromise()
-        .then((response) => {
-          this.gradeList = response
-        })
-      //客户
-      getcustomer({ compId: sessionStorage.getItem('ws-pf_compId') })
-        .toPromise()
-        .then((response) => {
-          this.customerList = []
-          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,
-            })
+      waterContentChange() {
+        if (this.inspect.goodsName) {
+          for (var i = 0; i < this.purchasePriceList.length; i++) {
+            if (this.purchasePriceList[i].goodsName == this.inspect.goodsName) {
+              this.inspect.buckleWeightRatio =
+                this.purchasePriceList[i].deductWeight
+            }
           }
           }
-        })
-      // 仓位
-      getbinNumber({ id: this.cangid })
-        .toPromise()
-        .then((response) => {
-          this.getbinNumberList = []
-          for (let i = 0; i < response.warehousePositionInfoList.length; i++) {
-            this.getbinNumberList.push({
-              value: response.warehousePositionInfoList[i].binNumber,
+        }
+        //潮粮单价改变事件
+        if (
+          this.inspect.goodsName &&
+          this.inspect.waterContent &&
+          this.inspect.grade
+        ) {
+          getinspectLookUnitPrice({
+              warehouseId: this.cangid,
+              goodsName: this.inspect.goodsName,
+              waterContent: this.inspect.waterContent,
+              grade: this.inspect.grade,
             })
             })
-          }
-        })
-      if (this.types == 2 || this.types == 3) {
-        //查看
-        getinspectLook({ id: ids })
+            .toPromise()
+            .then((response) => {
+              this.inspect.tidalGrainPrice = response
+              this.unitPrice = response
+            })
+        }
+      },
+
+      getList(ids) {
+        // 货名
+        getinspectLookGoods({
+            warehouseId: this.cangid
+          })
           .toPromise()
           .toPromise()
           .then((response) => {
           .then((response) => {
-            this.inspect = response
+            this.goodNameList = []
+            this.goodNameList = response
           })
           })
-      }
+        // 品级
+        packList({
+            constId: 'CON3'
+          })
+          .toPromise()
+          .then((response) => {
+            this.gradeList = response
+          })
+        //客户
+        getcustomer({
+            compId: sessionStorage.getItem('ws-pf_compId')
+          })
+          .toPromise()
+          .then((response) => {
+            this.customerList = []
+            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,
+              })
+            }
+          })
+        // 仓位
+        getbinNumber({
+            id: this.cangid
+          })
+          .toPromise()
+          .then((response) => {
+            this.getbinNumberList = []
+            for (let i = 0; i < response.warehousePositionInfoList.length; i++) {
+              this.getbinNumberList.push({
+                value: response.warehousePositionInfoList[i].binNumber,
+              })
+            }
+          })
+        if (this.types == 2 || this.types == 3) {
+          //查看
+          getinspectLook({
+              id: ids
+            })
+            .toPromise()
+            .then((response) => {
+              this.inspect = response
+            })
+        }
+      },
     },
     },
-  },
-}
+  }
 </script>
 </script>
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-/deep/.el-dialog__header {
-  text-align: center !important;
-  padding: 10px 0 !important;
-  height: auto !important;
-}
+  /deep/.el-dialog__header {
+    text-align: center !important;
+    padding: 10px 0 !important;
+    height: auto !important;
+  }
+
+  /deep/.el-dialog__title {
+    font-size: 24px !important;
+  }
+
+  .center {
+    background: #f6f7fc;
+  }
+
+  .ws-info-table {
+    border: none;
+  }
+
+  .ws-info-table .el-form-item {
+    width: 50%;
+    border: none;
+  }
+
+  /deep/.ws-info-table .el-form-item .el-form-item__label {
+    width: 30%;
+    text-align: center;
+    background: #ffffff;
+    font-size: 14px;
+    color: #8890b1;
+  }
+
+  /deep/.ws-info-table .el-form-item .el-form-item__content {
+    border: none;
+  }
+
+  .title {
+    font-size: 16px;
+    font-weight: 600;
+    margin: 10px;
+  }
+
+  .titleup {
+    position: relative;
+  }
+
+  .title::before {
+    content: '';
+    display: inline-block;
+    width: 5px;
+    height: 15px;
+    background: #8890b1;
+    margin-right: 5px;
+  }
+
+  .substance {
+    background: #ffffff;
+    width: 100%;
+    border-radius: 4px;
+    margin: 0 auto;
+    padding-top: 20px;
+  }
+
+  /deep/.el-table .el-table__header .cell,
+  .el-table .el-table__body .cell {
+    text-align: center;
+  }
+
+  /deep/.el-table--enable-row-transition .el-table__body td {
+    text-align: center;
+  }
+
+  .bg-left {
+    padding-left: 30px;
+  }
+
+  .bg-right {
+    padding-right: 10px;
+    text-align: right;
+  }
+
+  .bg-bottom {
+    margin: 15px 0px;
+  }
 
 
-/deep/.el-dialog__title {
-  font-size: 24px !important;
-}
-.center {
-  background: #f6f7fc;
-}
+  .titleup {
+    position: relative;
+  }
 
 
-.ws-info-table {
-  border: none;
-}
-.ws-info-table .el-form-item {
-  width: 50%;
-  border: none;
-}
-/deep/.ws-info-table .el-form-item .el-form-item__label {
-  width: 30%;
-  text-align: center;
-  background: #ffffff;
-  font-size: 14px;
-  color: #8890b1;
-}
-/deep/.ws-info-table .el-form-item .el-form-item__content {
-  border: none;
-}
-.title {
-  font-size: 16px;
-  font-weight: 600;
-  margin: 10px;
-}
-.titleup {
-  position: relative;
-}
-.title::before {
-  content: '';
-  display: inline-block;
-  width: 5px;
-  height: 15px;
-  background: #8890b1;
-  margin-right: 5px;
-}
+  .titleup::before {
+    content: '';
+    display: inline-block;
+    width: 5px;
+    height: 30px;
+    background: #5473e8;
+    position: absolute;
+    left: 0;
+  }
 
 
-.substance {
-  background: #ffffff;
-  width: 100%;
-  border-radius: 4px;
-  margin: 0 auto;
-  padding-top: 20px;
-}
-/deep/.el-table .el-table__header .cell,
-.el-table .el-table__body .cell {
-  text-align: center;
-}
-/deep/.el-table--enable-row-transition .el-table__body td {
-  text-align: center;
-}
-.bg-left {
-  padding-left: 30px;
-}
-.bg-right {
-  padding-right: 10px;
-  text-align: right;
-}
-.bg-bottom {
-  margin: 15px 0px;
-}
-.titleup {
-  position: relative;
-}
-.titleup::before {
-  content: '';
-  display: inline-block;
-  width: 5px;
-  height: 30px;
-  background: #5473e8;
-  position: absolute;
-  left: 0;
-}
-.but {
-  text-align: center;
-  margin: 20px auto;
-}
+  .but {
+    text-align: center;
+    margin: 20px auto;
+  }
 </style>
 </style>

+ 7 - 4
src/views/houseSelfCollect/inspectionManagement.vue

@@ -144,7 +144,7 @@ export default {
     }
     }
   },
   },
   activated() {
   activated() {
-    this.getList()
+    this.selectWarehouse()
   },
   },
   methods: {
   methods: {
     find() {
     find() {
@@ -214,8 +214,8 @@ export default {
       console.log(`当前页: ${val}`)
       console.log(`当前页: ${val}`)
       this.getList()
       this.getList()
     },
     },
-    getList() {
-      selectWarehouseSelf({
+    selectWarehouse(){
+       selectWarehouseSelf({
         compId: sessionStorage.getItem('ws-pf_compId'),
         compId: sessionStorage.getItem('ws-pf_compId'),
         personCharge: sessionStorage.getItem('ws-pf_staffName'),
         personCharge: sessionStorage.getItem('ws-pf_staffName'),
       })
       })
@@ -237,14 +237,17 @@ export default {
             this.warehouseNo =  this.warehouseList[0].No
             this.warehouseNo =  this.warehouseList[0].No
             this.cangid =  this.warehouseList[0].id
             this.cangid =  this.warehouseList[0].id
             this.purchasePriceList =  this.warehouseList[0].purchasePriceList
             this.purchasePriceList =  this.warehouseList[0].purchasePriceList
+            this.getList()
           }
           }
         })
         })
 
 
+    },
+    getList() {
       getinspectList({
       getinspectList({
         compId: sessionStorage.getItem('ws-pf_compId'),
         compId: sessionStorage.getItem('ws-pf_compId'),
         currentPage: this.currentPage,
         currentPage: this.currentPage,
         pageSize: this.pageSize,
         pageSize: this.pageSize,
-        searchKeyWord: this.searchKeyWord,
+        searchKeyWord: (this.searchKeyWord).toUpperCase(),
         warehouseName: this.warehouseName,
         warehouseName: this.warehouseName,
       })
       })
         .toPromise()
         .toPromise()

+ 9 - 7
src/views/houseSelfCollect/weighingManagement.vue

@@ -159,7 +159,8 @@ export default {
     }
     }
   },
   },
   activated() {
   activated() {
-    this.getList()
+    this.selectWarehouse()
+   
   },
   },
   methods: {
   methods: {
     print(row) {
     print(row) {
@@ -223,7 +224,7 @@ export default {
       console.log(`当前页: ${val}`)
       console.log(`当前页: ${val}`)
       this.getList()
       this.getList()
     },
     },
-    getList() {
+    selectWarehouse(){
       selectWarehouseSelf({
       selectWarehouseSelf({
         compId: sessionStorage.getItem('ws-pf_compId'),
         compId: sessionStorage.getItem('ws-pf_compId'),
         personCharge: sessionStorage.getItem('ws-pf_staffName'),
         personCharge: sessionStorage.getItem('ws-pf_staffName'),
@@ -241,8 +242,12 @@ export default {
           this.warehouseName = this.warehouseList[0].value
           this.warehouseName = this.warehouseList[0].value
           this.warehouseId = this.warehouseList[0].warehouseId
           this.warehouseId = this.warehouseList[0].warehouseId
           this.purchasePriceList = this.warehouseList[0].warehouseList
           this.purchasePriceList = this.warehouseList[0].warehouseList
+         this.getList()
+          
         })
         })
-      getweighingList({
+    },
+    getList() {
+          getweighingList({
         compId: sessionStorage.getItem('ws-pf_compId'),
         compId: sessionStorage.getItem('ws-pf_compId'),
         currentPage: this.currentPage,
         currentPage: this.currentPage,
         pageSize: this.pageSize,
         pageSize: this.pageSize,
@@ -251,16 +256,13 @@ export default {
       })
       })
         .toPromise()
         .toPromise()
         .then((response) => {
         .then((response) => {
-          // this.$notify.success({
-          //   title: '成功',
-          //   message: '删除成功',
-          // })
           this.weighingList = response.records
           this.weighingList = response.records
           this.deptBudgetTotal = response.total
           this.deptBudgetTotal = response.total
         })
         })
         .catch((response) => {
         .catch((response) => {
           // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
           // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
         })
         })
+      
     },
     },
   },
   },
 }
 }