浏览代码

Merge remote-tracking branch 'origin/dev' into dev

lichao 3 年之前
父节点
当前提交
6d9fd0ced2

+ 5 - 4
src/views/kaihe/domesticTrade/orderInformation/index.vue

@@ -1991,20 +1991,21 @@ export default {
         }
       }
       if (this.warehouseCrList) {
+        console.log(this.warehouseCrList[1].fCorpid);
         for (let li in this.warehouseCrList) {
           if (!this.warehouseCrList[li].fBusinessType) {
             this.$message.error('应付费用第' + (Number(li) + 1) + '行业务类型为空,请维护业务类型')
             return false
-          } else if (!this.warehouseDrList[li].fCorpid) {
+          } else if (!this.warehouseCrList[li].fCorpid) {
             this.$message.error('应付费用第' + (Number(li) + 1) + '行客户名称为空,请维护客户名称')
             return false
-          } else if (!this.warehouseDrList[li].fFeeid) {
+          } else if (!this.warehouseCrList[li].fFeeid) {
             this.$message.error('应付费用第' + (Number(li) + 1) + '行费用名称为空,请维护费用名称')
             return false
-          } else if (!this.warehouseDrList[li].fQty) {
+          } else if (!this.warehouseCrList[li].fQty) {
             this.$message.error('应付费用第' + (Number(li) + 1) + '行数量为空,请维护数量')
             return false
-          } else if (!this.warehouseDrList[li].fUnitprice) {
+          } else if (!this.warehouseCrList[li].fUnitprice) {
             this.$message.error('应付费用第' + (Number(li) + 1) + '行单价为空,请维护单价')
             return false
           }

+ 90 - 79
src/views/warehouseBusiness/warehouseCheck/index.vue

@@ -84,19 +84,20 @@
         >删除
         </el-button>
       </el-col>
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--            type="warning"-->
-<!--            icon="el-icon-download"-->
-<!--            size="mini"-->
-<!--            @click="handleExport"-->
-<!--        >导出-->
-<!--        </el-button>-->
-<!--      </el-col>-->
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button-->
+      <!--            type="warning"-->
+      <!--            icon="el-icon-download"-->
+      <!--            size="mini"-->
+      <!--            @click="handleExport"-->
+      <!--        >导出-->
+      <!--        </el-button>-->
+      <!--      </el-col>-->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="resetQuery"></right-toolbar>
     </el-row>
-    <el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange" ref="table" :height="tableHeight">
-      <el-table-column type="selection" width="55" align="center" />
+    <el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange" ref="table"
+              :height="tableHeight">
+      <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="序号" type="index" width="50" fixed align="center"/>
       <el-table-column label="仓库名称" align="center" prop="fWarehouseName"/>
       <el-table-column label="巡检人" align="center" prop="fInspectorName"/>
@@ -303,7 +304,7 @@
           </template>
         </el-table-column>
         <el-table-column label="巡检记录" align="center">
-          <template slot-scope="scope"  style="width: 100px;">
+          <template slot-scope="scope" style="width: 100px;">
             <el-button
                 size="mini"
                 type="text"
@@ -352,7 +353,7 @@
           </template>
         </el-table-column>
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-          <template slot-scope="scope"  style="width: 100px;">
+          <template slot-scope="scope" style="width: 100px;">
             <el-button
                 size="mini"
                 type="text"
@@ -415,7 +416,8 @@
           </el-select>
         </el-form-item>
         <el-form-item label="备注" prop="fRemark">
-          <el-input style="width: 200px;" v-model="twarehousecheckdetailList.fRemark" type="textarea" placeholder="请输入内容" autosize/>
+          <el-input style="width: 200px;" v-model="twarehousecheckdetailList.fRemark" type="textarea"
+                    placeholder="请输入内容" autosize/>
         </el-form-item>
       </el-form>
       <div style="margin-top: 20px;border: 1px solid #cccccc;padding: 5px;border-radius: 10px">
@@ -444,7 +446,18 @@
 </template>
 
 <script>
-import {listCorps,deleteMasterTable,delLog,information,secondDelete,newlyAdded,savePicture,selectUserByRole,addOrModifyPictureList,currentLogin} from '@/api/warehouseCheck/index'
+import {
+  listCorps,
+  deleteMasterTable,
+  delLog,
+  information,
+  secondDelete,
+  newlyAdded,
+  savePicture,
+  selectUserByRole,
+  addOrModifyPictureList,
+  currentLogin
+} from '@/api/warehouseCheck/index'
 import {listWarehousesss} from "@/api/basicdata/warehouse";
 import {getToken} from "@/utils/auth";
 
@@ -457,14 +470,13 @@ export default {
       headers: {
         Authorization: "Bearer " + getToken(),
       },
-      patrolInspection:[],
+      patrolInspection: [],
       uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
       warehouseOptions: [],
       fPlanneddate: [],
-      fileList:[
-      ],
+      fileList: [],
       dialogImageUrl: '',
-      dVisible:false,
+      dVisible: false,
       // 遮罩层
       loading: true,
       // 选中数组
@@ -475,12 +487,11 @@ export default {
       multiple: true,
       // 显示搜索条件
       showSearch: true,
-      pictureEist:[],
+      pictureEist: [],
       // 总条数
       total: 0,
       // 入出库状态表格数据
-      logList: [
-      ],
+      logList: [],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -492,13 +503,12 @@ export default {
         pageSize: 10,
       },
       // 表单参数
-      form: {
-      },
-      formList:[],
+      form: {},
+      formList: [],
       // 表单校验
       rules: {},
-      twarehousecheckdetailList:{},
-      picturefId:''
+      twarehousecheckdetailList: {},
+      picturefId: ''
     };
   },
   created() {
@@ -508,7 +518,7 @@ export default {
     let currentMonth = date.getMonth()
     let nextMonth = ++currentMonth
     let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1)  // 下个月的第一天
-    let oneDay = 1000*60*60*24
+    let oneDay = 1000 * 60 * 60 * 24
     let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
     let day = lastTime.getDate()
     if (day < 10) {
@@ -516,7 +526,7 @@ export default {
     }
     this.fPlanneddate = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
 
-    currentLogin().then(res=>{
+    currentLogin().then(res => {
       console.log(res)
     })
     selectUserByRole().then(res => {
@@ -545,7 +555,7 @@ export default {
       let currentMonth = date.getMonth()
       let nextMonth = ++currentMonth
       let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1)  // 下个月的第一天
-      let oneDay = 1000*60*60*24
+      let oneDay = 1000 * 60 * 60 * 24
       let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
       let day = lastTime.getDate()
       if (day < 10) {
@@ -553,7 +563,7 @@ export default {
       }
       this.queryParams.timeInterval = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
     },
-    onSuccess(response, file, fileList){
+    onSuccess(response, file, fileList) {
       console.log(fileList)
       this.pictureEist = fileList
     },
@@ -567,94 +577,94 @@ export default {
       this.pictureEist = fileList
     },
     //录入新行
-    inputDetails(){
+    inputDetails() {
       if (this.form.tWarehouseCheckItemsList === null) this.form.tWarehouseCheckItemsList = []
       this.form.tWarehouseCheckItemsList.push({
-        fWarehousename:'',
-        fWarehouseFid:this.form.fWarehouseFid,
-        fLatestinspectorid:'',
-        fInspectorId:this.form.fInspectorId,
-        fPlanneddate:'',
-        fLatestinspectdate:'',
-        fInspectionrecord:'',
-        updateTime:'',
-        createBy:'',
-        createTime:'',
-        updateBy:'',
-        remark:'',
+        fWarehousename: '',
+        fWarehouseFid: this.form.fWarehouseFid,
+        fLatestinspectorid: '',
+        fInspectorId: this.form.fInspectorId,
+        fPlanneddate: '',
+        fLatestinspectdate: '',
+        fInspectionrecord: '',
+        updateTime: '',
+        createBy: '',
+        createTime: '',
+        updateBy: '',
+        remark: '',
       })
     },
     //关闭新增图片弹窗
-    closePicture(){
+    closePicture() {
       this.opentwo = false
       this.fileList = []
     },
     //图片保存
-    preservationtwo(){
-      // console.log(this.pictureEist)
+    preservationtwo() {
       this.twarehousecheckdetailList.fPhotoUrl = []
-      for (let item in this.pictureEist){
-        if (this.pictureEist[item].response){
+      for (let item in this.pictureEist) {
+        if (this.pictureEist[item].response) {
           this.twarehousecheckdetailList.fPhotoUrl.push({
-            url:this.pictureEist[item].response.url
+            url: this.pictureEist[item].response.url
           })
-        }else {
+        } else {
           this.twarehousecheckdetailList.fPhotoUrl.push({
-            url:this.pictureEist[item].url
+            url: this.pictureEist[item].url
           })
         }
       }
       this.twarehousecheckdetailList.fPhotoUrl = JSON.stringify(this.twarehousecheckdetailList.fPhotoUrl)
-      if (!this.twarehousecheckdetailList.fId){
-        addOrModifyPictureList(this.twarehousecheckdetailList,'post').then(res=>{
+      if (!this.twarehousecheckdetailList.fId) {
+        addOrModifyPictureList(this.twarehousecheckdetailList, 'post').then(res => {
           console.log(res)
         })
-      }else {
-        addOrModifyPictureList(this.twarehousecheckdetailList,'put').then(res=>{
+      } else {
+        addOrModifyPictureList(this.twarehousecheckdetailList, 'put').then(res => {
           console.log(res)
         })
       }
     },
-    pictureList(scope){
+    pictureList(scope) {
       let data = {
-        fItemFid:scope.row.fId
+        fItemFid: scope.row.fId
       }
-      savePicture(data).then(res=>{
+      savePicture(data).then(res => {
         let data = res.rows
-        if (data.length === 0){
+        if (data.length === 0) {
           this.twarehousecheckdetailList = {
-            fCheckFid:scope.row.fCheckFid,
-            fItemFid:scope.row.fId,
-            fWarehouseid:scope.row.fWarehouseFid, //仓库名称
-            fCreateTime:'',
-            fInspectorid:'',
-            fRemark:'',
-            fPhotoUrl:[]
+            fCheckFid: scope.row.fCheckFid,
+            fItemFid: scope.row.fId,
+            fWarehouseid: scope.row.fWarehouseFid, //仓库名称
+            fCreateTime: '',
+            fInspectorid: '',
+            fRemark: '',
+            fPhotoUrl: []
           }
-        }else {
+        } else {
           this.twarehousecheckdetailList = res.rows[0]
           this.twarehousecheckdetailList.fWarehouseid = scope.row.fWarehouseFid
           this.fileList = []
-          for (let item in JSON.parse(res.rows[0].fPhotoUrl)){
+          for (let item in JSON.parse(res.rows[0].fPhotoUrl)) {
             this.fileList.push(JSON.parse(res.rows[0].fPhotoUrl)[item])
           }
+          this.pictureEist = this.fileList
         }
       })
       this.opentwo = true
     },
     //查看明细
-    viewDetails(row){
-      information(row.fId).then(res =>{
+    viewDetails(row) {
+      information(row.fId).then(res => {
         this.open = true
         if (res.data.twarehousecheckitemsVOList === null) res.data.twarehousecheckitemsVOList = []
         this.form = res.data
       })
     },
     //明细删除第二弹窗
-    singleItemDeletion(index,scope){
+    singleItemDeletion(index, scope) {
       let this_ = this
-      if (scope.row.fId){
-        secondDelete(scope.row.fId).then(res=>{
+      if (scope.row.fId) {
+        secondDelete(scope.row.fId).then(res => {
           this_.$message({
             showClose: true,
             message: '删除成功',
@@ -662,7 +672,7 @@ export default {
           });
           this_.viewDetails(this_.form)
         })
-      }else {
+      } else {
         this_.form.tWarehouseCheckItemsList.splice(index, 1);
       }
     },
@@ -681,9 +691,10 @@ export default {
           this.loading = false
           this.total = res.total
           // 根据浏览器高度设置初始高度
-          setInterval(() => {
-            this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
-          }, 300)
+          this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
+          // setInterval(() => {
+          //   this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
+          // }, 300)
         }
       })
     },
@@ -747,7 +758,7 @@ export default {
         if (valid) {
           newlyAdded(this.form).then(response => {
             this.msgSuccess("新增成功");
-            this.viewDetails({fId:response.data})
+            this.viewDetails({fId: response.data})
             // this.open = false;
             // this.getList();
           });