Procházet zdrojové kódy

2024年6月5日15:50:28

纪新园 před 1 rokem
rodič
revize
66b4ba3b3d

+ 12 - 0
src/api/basicdata/warehouse.js

@@ -84,6 +84,18 @@ export function treeselect(ancestors) {
   })
 }
 
+// 查询库区分页
+export function tWarehouseListPage(ancestors) {
+  const query = {
+    ancestors
+  }
+  return request({
+    url: '/basicdata/warehouse/listPage',
+    method: 'get',
+    params: query
+  })
+}
+
 // 根据当前登录用户查询部门下拉树结构
 export function nominateTreeselect(ancestors) {
   const query = {

+ 286 - 154
src/views/Warehousing/inStock/AddOrUpdate.vue

@@ -642,21 +642,21 @@
             </el-col>
             <el-col :span="12">
               <el-form-item label="是否质押" prop="isPledge">
-               <el-select
-                 v-model="form.isPledge"
-                 placeholder="请选择是否质押"
-                 clearable
-                 :disabled="browseStatus || form.warehouseStatus > 3"
-                 style="width: 80%"
-                 @change="feeUnitChange"
-                 >
-                   <el-option
-                     v-for="(item, index) in isPledgeOptions"
-                     :key="index.dictValue"
-                     :label="item.dictLabel"
-                     :value="item.dictValue"
-                   />
-                 </el-select>
+                <el-select
+                  v-model="form.isPledge"
+                  placeholder="请选择是否质押"
+                  clearable
+                  :disabled="browseStatus || form.warehouseStatus > 3"
+                  style="width: 80%"
+                  @change="feeUnitChange"
+                >
+                  <el-option
+                    v-for="(item, index) in isPledgeOptions"
+                    :key="index.dictValue"
+                    :label="item.dictLabel"
+                    :value="item.dictValue"
+                  />
+                </el-select>
               </el-form-item>
             </el-col>
           </el-row>
@@ -1312,6 +1312,10 @@
               >导入Excel
               </el-button
               >
+              <el-button size="small" type="primary" @click="openUploadExcel1"
+              >导入Excel并保存
+              </el-button
+              >
               <el-button v-if="true" type="success" size="small" @click="openNoUpload" :disabled="browseStatus">智能大数据
               </el-button>
             </el-col>
@@ -1490,17 +1494,17 @@
                 </el-button
                 >
                 <el-button
-                    type="text"
-                    size="small"
-                    @click="makerCode(scope.row)"
-                    v-if="scope.row.fId&&showGenerate==1"
+                  type="text"
+                  size="small"
+                  @click="makerCode(scope.row)"
+                  v-if="scope.row.fId&&showGenerate==1"
                 >生成条码
                 </el-button>
                 <el-button
-                    type="text"
-                    size="small"
-                    @click="showElabel(scope)"
-                    v-if="showDataElabel == '0'"
+                  type="text"
+                  size="small"
+                  @click="showElabel(scope)"
+                  v-if="showDataElabel == '0'"
                 >条码
                 </el-button>
               </template>
@@ -1734,14 +1738,28 @@
             </el-col>
             <el-col :span="6">
               <el-form-item label="库区" prop="fWarehouselocid">
-                <treeselect
+                <!--                <treeselect
+                                  v-model="importList.fWarehouselocid"
+                                  @select="getAlltree"
+                                  :options="fWarehouseidOptions"
+                                  :show-count="true"
+                                  :disable-branch-nodes="true"
+                                  placeholder="请选择库区"
+                                />-->
+                <el-select
+                  filterable
                   v-model="importList.fWarehouselocid"
-                  @select="getAlltree"
-                  :options="fWarehouseidOptions"
-                  :show-count="true"
-                  :disable-branch-nodes="true"
+                  style="width: 100%"
                   placeholder="请选择库区"
-                />
+                  @change="getAlltree"
+                >
+                  <el-option
+                    v-for="(item, index) in fWarehouseidOptions"
+                    :key="index.fId"
+                    :label="item.fName"
+                    :value="item.fId"
+                  ></el-option>
+                </el-select>
               </el-form-item>
             </el-col>
           </el-row>
@@ -2489,7 +2507,7 @@
             <tr>
               <td>客户名称</td>
               <td colspan="2">{{ form.fCorpidName }}</td>
-              <td >入库日期</td>
+              <td>入库日期</td>
               <td colspan="3" v-if="Printinglist.length">
                 {{ Printinglist[0].fBsdate | fBsdateFormat }}
               </td>
@@ -5765,7 +5783,7 @@
               </tr>
               <tr>
                 <td>总件数</td>
-                <td colspan="2">{{ form.fPlanqty}}</td>
+                <td colspan="2">{{ form.fPlanqty }}</td>
                 <td v-if="radio == 1">总净重(吨)</td>
                 <td v-if="radio == 2">总净重(千克)</td>
                 <td v-if="radio == 1" colspan="3">{{ (form.fPlannetweight / 1000).toFixed(4) }}</td>
@@ -5797,7 +5815,7 @@
               </tr>
               <tr>
                 <td>属性</td>
-                <td colspan="2">{{ item.fBusinessType| fStorageTypeFormat(fStorageTypeOptions)}}</td>
+                <td colspan="2">{{ item.fBusinessType| fStorageTypeFormat(fStorageTypeOptions) }}</td>
                 <td>属性详情</td>
                 <td colspan="4">{{ item.fMarks }}</td>
               </tr>
@@ -6299,7 +6317,8 @@
               <td>{{ item.fQty }}</td>
               <td></td>
               <td>{{ item.fBusinessType| fStorageTypeFormat(fStorageTypeOptions) }}</td>
-              <td>{{ item.fMarks }}</td>
+                           
+              <td>{{ item.fMarks }}</td>
               <td></td>
               <td></td>
               <td>{{ item.fWarehouseInformation }}</td>
@@ -6340,7 +6359,8 @@
         fGPid:form.fId,
         fPid:eId,
         fType:'1',
-      })">录入条码</el-button>
+      })"
+      >录入条码</el-button>
       <el-table :data="elabelList" element-loading-text="努力加载中">
       <el-table-column
         label="序号"
@@ -6359,11 +6379,14 @@
         </template>
       </el-table-column>
         <el-table-column
-            label="操作"
-            align="center"
-            width="100">
+          label="操作"
+          align="center"
+          width="100"
+        >
         <template slot-scope="scope">
-          <el-button type="text" size="small" icon="el-icon-delete" @click="deleteBarcode(scope)" :disabled="eRow.fBillstatus == 40">删除</el-button>
+          <el-button type="text" size="small" icon="el-icon-delete" @click="deleteBarcode(scope)"
+                     :disabled="eRow.fBillstatus == 40"
+          >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -6373,6 +6396,33 @@
         <el-button @click="showElabelDialog = false">取 消</el-button>
       </span>
     </el-dialog>
+    <el-dialog :title="upload.title" :visible.sync="upload.open" :close-on-click-modal="false" width="400px"
+               append-to-body
+    >
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?fWarehouseid=' + this.form.fWarehouseid+'&billId='+this.form.fId"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+        <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
     <upload-excel
       ref="upexcel"
       :uploadExcelVisible="uploadExcel"
@@ -6458,53 +6508,48 @@
       <el-button @click="cancel">取 消</el-button>
     </div>
   </div>
+
 </template>
 
 <script>
 import print from 'print-js'
-import { selectUserByRole } from '@/api/basicdata/warehouse'
+import { listWarehousesss, selectUserByRole, tWarehouseListPage } from '@/api/basicdata/warehouse'
 import {
-  addWhgenleg,
   addJoblist,
+  addWarehouse,
+  addWarehousebills,
+  addWhgenleg,
+  checkCode,
+  deleteCode,
   disChargelist,
-  updateCredit,
-  listWarehousebills,
+  downloadTemplate,
+  feesCheck,
+  generate,
   getWarehousebills,
-  delWarehousebills,
-  addWarehousebills,
-  addWarehouse,
-  exportWarehousebills,
+  listElabelByfGPid,
+  ordersRevoke,
+  pleaseCheck,
+  queryClerkRoleList,
   revoke,
   revokeTwo,
-  delinStock_s,
+  saveCode,
   submitWarehousingApproval,
-  ordersRevoke,
-  checkCode,
-  queryClerkRoleList,
-  pleaseCheck,
-  feesCheck, downloadTemplate, listElabelByfGPid, saveCode, deleteCode, generate,
+  updateCredit,
   warehousebillsitems,
-  warehousebillsfees,
   warehousecntr
 } from '@/api/warehouseBusiness/warehouseInStock'
-import { operationAgreement } from '@/api/agreement/agreement'
-import { listCorps, getCorps } from '@/api/basicdata/corps'
-import { listFees, getFees } from '@/api/basicdata/fees'
-import {
-  listWarehouse,
-  treeselect,
-  listWarehousesss
-} from '@/api/basicdata/warehouse'
+import { getCorps, listCorps } from '@/api/basicdata/corps'
+import { listFees } from '@/api/basicdata/fees'
 import { listGoods } from '@/api/basicdata/goods'
 import { listCntrs } from '@/api/basicdata/cntr'
-import { listUser, queryUserVal } from '@/api/system/user'
+import { queryUserVal } from '@/api/system/user'
 import ApprovalComments from '@/views/startApproval'
 import AddOrUpdate from '@/views/viewApproval'
 import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import UploadFile from '@/components/Uploadfile'
 import Cookies from 'js-cookie'
-import { addSet, select, resetModule } from '@/api/system/set'
+import { addSet, resetModule, select } from '@/api/system/set'
 import draggable from 'vuedraggable'
 import upLoad from '../components/upLoad'
 import incomeMoney from '../components/incomeMoney'
@@ -6513,6 +6558,7 @@ import uploadExcel from './uploadExcel'
 import noUpload from './noUpload'
 import { getDept } from '@/api/basicdata/dept'
 import axios from 'axios'
+import { getToken } from '@/utils/auth'
 
 export default {
   name: 'inStock',
@@ -6529,6 +6575,7 @@ export default {
   components: {
     UploadFile,
     Treeselect,
+    tWarehouseListPage,
     AddOrUpdate,
     ApprovalComments,
     draggable,
@@ -6562,6 +6609,20 @@ export default {
       warehouseCrList: [],
       fStltypeOptions: [],
       form: {},
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: '',
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: 'Bearer ' + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + '/warehouseBusiness/inStock/importInstockV1'
+      },
       rules: {
         fDeptid: [{ required: true, message: ' ', trigger: 'blur' }],
         fMblno: [{ required: true, message: ' ', trigger: 'blur' }],
@@ -6959,10 +7020,10 @@ export default {
       showDataElabel: null,
       showElabelDialog: false,
       elabelList: [],
-      isPledgeOptions:[],
-      eId:'',
-      eRow:{},
-      showGenerate:0
+      isPledgeOptions: [],
+      eId: '',
+      eRow: {},
+      showGenerate: 0
     }
   },
   async created() {
@@ -7072,9 +7133,9 @@ export default {
     this.getConfigKey('warehouse.inStock.showPrint').then((response) => {
       this.showPrint = response.msg
     })
-    this.getConfigKey("generate_label").then((response) => {
-      this.showGenerate = response.msg;
-    });
+    this.getConfigKey('generate_label').then((response) => {
+      this.showGenerate = response.msg
+    })
     // 业务员获取
     selectUserByRole().then(res => {
       this.fSalesmanOption = res.rows
@@ -7131,9 +7192,9 @@ export default {
     })
   },
   mounted() {
-      if (this.$refs.printTable) {
-          this.$refs.printTable.style.setProperty('--url', 'url(' + this.signature + ') bottom right no-repeat')
-      }
+    if (this.$refs.printTable) {
+      this.$refs.printTable.style.setProperty('--url', 'url(' + this.signature + ') bottom right no-repeat')
+    }
   },
   activated() {
     this.getDicts('st_in_type').then((response) => {
@@ -7437,6 +7498,64 @@ export default {
         }
       })
     },
+    //文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      getWarehousebills(this.form.fId).then((response1) => {
+        this.TFformdata(response1.data.warehousebills)
+        if (!this.copyStatus || this.recordStatus === true) {
+          if (response1.data.warehouseBillsItem) {
+            response1.data.warehouseBillsItem.map((e) => {
+              e.fLntype = e.fLntype ? e.fLntype.toString() : null
+            })
+            this.detailList = response1.data.warehouseBillsItem
+          } else {
+            this.detailList = []
+          }
+          response1.data.warehousebillsfeesCr.map((e) => {
+            if (e.fFeeunitid) {
+              e.fFeeUnitid = e.fFeeunitid.toString()
+            }
+            if (e.fStltypeid || e.fStltypeid == 0) {
+              e.fStltypeid = e.fStltypeid.toString()
+            }
+          })
+          this.warehouseCrList = response1.data.warehousebillsfeesCr
+          response1.data.warehousebillsfeesDr.map((e) => {
+            if (e.fFeeunitid) {
+              e.fFeeUnitid = e.fFeeunitid.toString()
+            }
+            if (e.fStltypeid || e.fStltypeid == 0) {
+              e.fStltypeid = e.fStltypeid.toString()
+            }
+          })
+          this.warehouseDrList = response1.data.warehousebillsfeesDr
+          if (response1.data.tCntrList) {
+            this.CntrTable = response1.data.tCntrList
+          } else {
+            this.CntrTable = []
+          }
+          if (response1.data.enclosures) {
+            this.relevantAttachments = response1.data.enclosures
+          }
+        }
+      })
+      this.upload.open = false
+      this.upload.isUploading = false
+      this.$refs.upload.clearFiles()
+      this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true })
+
+    },
+    // 提交上传文件
+    submitFileForm() {
+      if (this.form.fId === null || this.form.fId === undefined) {
+        return this.$message.error('请先保存主表数据')
+      }
+      this.$refs.upload.submit()
+    },
     //开始拖拽事件
     onStart() {
       this.drag = true
@@ -7670,14 +7789,14 @@ export default {
               this.form.fProductName = ''
             }
             if (this.detailList.length > 0) {
-                let arr = []
-                this.detailList.map((e) => {
-                    arr.push(e.fMarks)
-                })
-                arr = [...new Set(arr)]
+              let arr = []
+              this.detailList.map((e) => {
+                arr.push(e.fMarks)
+              })
+              arr = [...new Set(arr)]
 
-                this.form.fMarks = arr.join(',')
-                this.form.fMarks = this.form.fMarks.slice(0, 100)
+              this.form.fMarks = arr.join(',')
+              this.form.fMarks = this.form.fMarks.slice(0, 100)
             } else {
               this.form.fMarks = ''
             }
@@ -7795,8 +7914,8 @@ export default {
             })
             arr = [...new Set(arr)]
 
-              this.form.fMarks = arr.join(',')
-              this.form.fMarks = this.form.fMarks.slice(0, 100)
+            this.form.fMarks = arr.join(',')
+            this.form.fMarks = this.form.fMarks.slice(0, 100)
           } else {
             this.form.fMarks = ''
           }
@@ -7918,8 +8037,8 @@ export default {
             })
             arr = [...new Set(arr)]
 
-              this.form.fMarks = arr.join(',')
-              this.form.fMarks = this.form.fMarks.slice(0, 100)
+            this.form.fMarks = arr.join(',')
+            this.form.fMarks = this.form.fMarks.slice(0, 100)
           } else {
             this.form.fMarks = ''
           }
@@ -8227,14 +8346,14 @@ export default {
                 this.form.fProductName = ''
               }
               if (this.detailList.length > 0) {
-                  let arr = []
-                  this.detailList.map((e) => {
-                      arr.push(e.fMarks)
-                  })
-                  arr = [...new Set(arr)]
+                let arr = []
+                this.detailList.map((e) => {
+                  arr.push(e.fMarks)
+                })
+                arr = [...new Set(arr)]
 
-                  this.form.fMarks = arr.join(',')
-                  this.form.fMarks = this.form.fMarks.slice(0, 100)
+                this.form.fMarks = arr.join(',')
+                this.form.fMarks = this.form.fMarks.slice(0, 100)
               } else {
                 this.form.fMarks = ''
               }
@@ -8339,14 +8458,14 @@ export default {
                 this.form.fProductName = ''
               }
               if (this.detailList.length > 0) {
-                  let arr = []
-                  this.detailList.map((e) => {
-                      arr.push(e.fMarks)
-                  })
-                  arr = [...new Set(arr)]
+                let arr = []
+                this.detailList.map((e) => {
+                  arr.push(e.fMarks)
+                })
+                arr = [...new Set(arr)]
 
-                  this.form.fMarks = arr.join(',')
-                  this.form.fMarks = this.form.fMarks.slice(0, 100)
+                this.form.fMarks = arr.join(',')
+                this.form.fMarks = this.form.fMarks.slice(0, 100)
               } else {
                 this.form.fMarks = ''
               }
@@ -8452,14 +8571,14 @@ export default {
                 this.form.fProductName = ''
               }
               if (this.detailList.length > 0) {
-                  let arr = []
-                  this.detailList.map((e) => {
-                      arr.push(e.fMarks)
-                  })
-                  arr = [...new Set(arr)]
+                let arr = []
+                this.detailList.map((e) => {
+                  arr.push(e.fMarks)
+                })
+                arr = [...new Set(arr)]
 
-                  this.form.fMarks = arr.join(',')
-                  this.form.fMarks = this.form.fMarks.slice(0, 100)
+                this.form.fMarks = arr.join(',')
+                this.form.fMarks = this.form.fMarks.slice(0, 100)
               } else {
                 this.form.fMarks = ''
               }
@@ -8510,11 +8629,11 @@ export default {
                     cancelButtonText: '取消',
                     type: 'warning'
                   }).then(() => {
-                    loading.close();
+                    loading.close()
                     this.mblnoStatus = true
                     this.saveForm()
                   }).catch(() => {
-                    loading.close();
+                    loading.close()
                     this.$message({
                       type: 'info',
                       message: '已取消'
@@ -8526,7 +8645,7 @@ export default {
                     this.TFformdata(response.data.warehouseBills)
                     this.detailList = response.data.warehousebillsitems
                     this.msgSuccess('保存成功')
-                    loading.close();
+                    loading.close()
                     getWarehousebills(this.form.fId).then((response) => {
                       this.TFformdata(response.data.warehousebills)
                       if (!this.copyStatus || this.recordStatus === true) {
@@ -8678,9 +8797,9 @@ export default {
             if (
               this.importList.fCntrno == this.detailList[item].fCntrno &&
               this.importList.fCntrno &&
-              this.importList.fId!= this.detailList[item].fId
+              this.importList.fId != this.detailList[item].fId
             ) {
-              console.log(this.importList,this.detailList[item])
+              console.log(this.importList, this.detailList[item])
               return this.$message.error('箱号不能重复')
             }
           }
@@ -8889,7 +9008,10 @@ export default {
             }
           })
           this.playcomputer()
-          treeselect(this.form.fWarehouseid).then((response) => {
+          /* treeselect(this.form.fWarehouseid).then((response) => {
+             this.fWarehouseidOptions = response.data
+           }) */
+          tWarehouseListPage(this.form.fWarehouseid).then((response) => {
             this.fWarehouseidOptions = response.data
           })
           if (status == 'copy') {
@@ -9235,7 +9357,10 @@ export default {
       this.reset()
       this.fixdetaiNum = null
       this.fixdetaiNum = index
-      treeselect(this.form.fWarehouseid).then((response) => {
+      /* treeselect(this.form.fWarehouseid).then((response) => {
+         this.fWarehouseidOptions = response.data
+       })*/
+      tWarehouseListPage(this.form.fWarehouseid).then((response) => {
         this.fWarehouseidOptions = response.data
       })
       this.allfPlanqty += row.fQty
@@ -9253,27 +9378,27 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        if (rows[index].fId){
-          warehousecntr(rows[index].fId).then(res=>{
+        if (rows[index].fId) {
+          warehousecntr(rows[index].fId).then(res => {
             rows.splice(index, 1)
             this.$message({
               type: 'success',
               message: '删除成功!'
-            });
+            })
           })
-        }else {
+        } else {
           rows.splice(index, 1)
           this.$message({
             type: 'success',
             message: '删除成功!'
-          });
+          })
         }
       }).catch(() => {
         this.$message({
           type: 'info',
           message: '已取消删除'
-        });
-      });
+        })
+      })
     },
     wDeleteRow(index, rows) {
       this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
@@ -9281,8 +9406,8 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        if (rows[index].fId){
-          warehousebillsitems(rows[index].fId).then(res=>{
+        if (rows[index].fId) {
+          warehousebillsitems(rows[index].fId).then(res => {
             rows.splice(index, 1)
             this.sumMum = 0
             this.detailList.map((e) => {
@@ -9300,9 +9425,9 @@ export default {
             this.$message({
               type: 'success',
               message: '删除成功!'
-            });
+            })
           })
-        }else {
+        } else {
           rows.splice(index, 1)
           this.sumMum = 0
           this.detailList.map((e) => {
@@ -9320,14 +9445,14 @@ export default {
           this.$message({
             type: 'success',
             message: '删除成功!'
-          });
+          })
         }
       }).catch(() => {
         this.$message({
           type: 'info',
           message: '已取消删除'
-        });
-      });
+        })
+      })
     },
     //付款信息新行
     addpayment() {
@@ -9409,52 +9534,52 @@ export default {
     showElabel(scope) {
       this.eRow = scope.row
       this.eId = scope.row.fId
-      if (scope.row.fId){
-        listElabelByfGPid({fPid:scope.row.fId}).then(res=>{
+      if (scope.row.fId) {
+        listElabelByfGPid({ fPid: scope.row.fId }).then(res => {
           this.elabelList = res.data
           this.showElabelDialog = true
         })
-      }else {
-        this.$message.error('该单据未保存');
+      } else {
+        this.$message.error('该单据未保存')
       }
     },
     //条码保存
-    saveBarcode(){
-      for (let item in this.elabelList){
-        for (let li in this.elabelList){
-          if(item !== li){
-            if (this.elabelList[item].fContent == this.elabelList[li].fContent){
-              return  this.$message.error('序号'+Number(Number(item)+1)+'和序号'+Number(Number(li)+1)+'重复');
+    saveBarcode() {
+      for (let item in this.elabelList) {
+        for (let li in this.elabelList) {
+          if (item !== li) {
+            if (this.elabelList[item].fContent == this.elabelList[li].fContent) {
+              return this.$message.error('序号' + Number(Number(item) + 1) + '和序号' + Number(Number(li) + 1) + '重复')
             }
           }
         }
       }
-      saveCode(this.elabelList).then(res=>{
-        listElabelByfGPid({fPid:this.eId}).then(res=>{
+      saveCode(this.elabelList).then(res => {
+        listElabelByfGPid({ fPid: this.eId }).then(res => {
           this.elabelList = res.data
         })
       })
     },
     //条码删除
-    deleteBarcode(scope){
-      if (scope.row.fId){
-        deleteCode(scope.row.fId).then(res=>{
-          this.elabelList.splice(scope.$index, 1);
+    deleteBarcode(scope) {
+      if (scope.row.fId) {
+        deleteCode(scope.row.fId).then(res => {
+          this.elabelList.splice(scope.$index, 1)
         })
-      }else {
-        this.elabelList.splice(scope.$index, 1);
+      } else {
+        this.elabelList.splice(scope.$index, 1)
       }
     },
-    makerCode(row){
+    makerCode(row) {
       console.log(this.form)
       generate({
-        id:this.form.fId,
-        itemId:row.fId,
-        number:row.fQty,
-        type:1,
-        corpId:this.form.fCorpid
-      }).then(res=>{
-        this.$message('生成成功');
+        id: this.form.fId,
+        itemId: row.fId,
+        number: row.fQty,
+        type: 1,
+        corpId: this.form.fCorpid
+      }).then(res => {
+        this.$message('生成成功')
       })
     },
     //打印
@@ -9578,8 +9703,8 @@ export default {
             })
             arr = [...new Set(arr)]
 
-              this.form.fMarks = arr.join(',')
-              this.form.fMarks = this.form.fMarks.slice(0, 100)
+            this.form.fMarks = arr.join(',')
+            this.form.fMarks = this.form.fMarks.slice(0, 100)
           } else {
             this.form.fMarks = ''
           }
@@ -9756,9 +9881,16 @@ export default {
       })
     },
     openUploadExcel() {
+      downloadTemplate().then(res => {
+        this.download(res.msg)
+      })
       this.uploadExcel = !this.uploadExcel
       this.$refs.upexcel.init(this.form, this.detailList)
     },
+    openUploadExcel1() {
+      this.upload.title = '用户导入'
+      this.upload.open = true
+    },
     // 监听 子组件弹窗关闭后触发,有子组件调用
     showAddOrUpdate(data) {
       if (data === 'false') {

+ 19 - 9
src/views/Warehousing/inStock/uploadExcel.vue

@@ -8,7 +8,7 @@
         ">
         <div style="display: flex;;margin-bottom: 10px;">
           <el-upload :action="actionUrl" multiple :on-progress="progress" :headers="headers" :show-file-list="false"
-             :data="{fWarehouseid:form.fWarehouseid?form.fWarehouseid:''}"
+             :data="{fWarehouseid:form.fWarehouseid?form.fWarehouseid:'',billId:form.fId?form.fId:''}"
              :on-success="
               (res) => {
                 handleSucces(res);
@@ -31,7 +31,8 @@
           <template slot-scope="scope">
             <span v-if="item.label == 'fBsdate'">
               <el-date-picker v-model="scope.row.fBsdate" type="date" style="width: 100%" value-format="timestamp"
-                placeholder="入库日期" @change="dateSelected(scope, 'fBsdate')">
+                placeholder="入库日期">
+<!--                placeholder="入库日期" @change="dateSelected(scope, 'fBsdate')">-->
               </el-date-picker>
             </span>
             <span v-else-if="item.label == 'fGoodsid'">
@@ -195,7 +196,8 @@ export default {
       },
       actionUrl:
         process.env.VUE_APP_BASE_API +
-        "/warehouseBusiness/inStock/importInstock", // 上传的图片服务器地址
+        // "/warehouseBusiness/inStock/importInstock", // 上传的图片服务器地址
+        "/warehouseBusiness/inStock/importInstockV1", // 上传的图片服务器地址
       uploadVisible: false,
       excelList: [],
       drag: false,
@@ -343,7 +345,7 @@ export default {
   },
   methods: {
     dateSelected(scope, name) {
-      if (name === 'fBsdate') {
+      /*if (name === 'fBsdate') {
         this.excelList.forEach(item => {
           if (!item.fBsdate) this.$set(item, 'fBsdate', scope.row.fBsdate)
         })
@@ -351,7 +353,7 @@ export default {
         this.excelList.forEach(item => {
           if (!item.fGoodsid) this.$set(item, 'fGoodsid', scope.row.fGoodsid)
         })
-      } else if (name === 'fBusinessType') {
+      } else*/ if (name === 'fBusinessType') {
         this.excelList.forEach(item => {
           if (!item.fBusinessType) this.$set(item, 'fBusinessType', scope.row.fBusinessType)
         })
@@ -386,8 +388,16 @@ export default {
       if (res.code) {
         if (res.data.length) {
           res.data.map((e) => {
-            e.fBsdate = this.form.fBsdate;
-            e.fGoodsid = this.form.fGoodsid;
+           /* e.fBsdate = this.form.fBsdate;
+            e.fGoodsid = this.form.fGoodsid;*/
+            if (e.fGoodsid == null){
+              e.fGoodsid = this.form.fGoodsid;
+            }
+            if (e.fBsdate == null){
+              e.fBsdate = this.form.fBsdate;
+            }else{
+              e.fBsdate = Date.parse(e.fBsdate);
+            }
             e.fCntrtype = Number(e.fCntrtype)
             e.fBusinessType = e.fBusinessType + ''
           });
@@ -522,11 +532,11 @@ export default {
         //     "请输入第" + (Number(item) + 1) + "行的包装规格"
         //   );
         // }
-        if (this.excelList[item].fCntrno == null) {
+       /* if (this.excelList[item].fCntrno == null) {
           return this.$message.error(
             "请输入第" + (Number(item) + 1) + "行的箱号"
           );
-        }
+        }*/
       }
       this.$emit("adddetailList", this.excelList);
       this.uploadVisible = false;

+ 9 - 1
src/views/Warehousing/outStock/AddOrUpdate.vue

@@ -4330,11 +4330,19 @@ export default {
           checked: 0,
           width: 100
         },
-        {
+       /* {
           surface: '8',
           label: 'fWarehouseids',
           name: '库位',
           checked: 0,
+          hide: true,
+          width: 150
+        },*/
+        {
+          surface: '8',
+          label: 'fWarehouseInformation',
+          name: '库位',
+          checked: 0,
           width: 150
         },
         {

+ 1 - 1
src/views/reportManagement/whgenleg/index.vue

@@ -386,7 +386,7 @@ export default {
         },
         {
           surface: "8",
-          label: "fWarehouseids",
+          label: "fWarehouseInformation",
           name: "仓库",
           checked: 0,
           width: 100,