tong 4 سال پیش
والد
کامیت
bcf399222d
3فایلهای تغییر یافته به همراه155 افزوده شده و 119 حذف شده
  1. 37 11
      src/components/Uploadfile/index.vue
  2. 116 106
      src/views/warehouseBusiness/inStock/index.vue
  3. 2 2
      vue.config.js

+ 37 - 11
src/components/Uploadfile/index.vue

@@ -1,6 +1,8 @@
 <template>
-  <div class="component-upload-image">
+  <div style="display: flex; justify-content:center;">
+    <button style="height: 20px"><a :href=File>查看</a></button>
     <el-upload
+      class="upload-demo"
       :action="uploadImgUrl"
       list-type="picture-card"
       :on-success="handleUploadSuccess"
@@ -9,11 +11,12 @@
       name="file"
       :show-file-list="false"
       :headers="headers"
-      style="display: inline-block; vertical-align: top"
     >
-      <img v-if="value" :src="value" class="avatar" />
-      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+      <!-- <img v-if="value" :src="value" class="avatar" />
+      <i v-else class="el-icon-plus avatar-uploader-icon"></i> -->
+      <button>上传</button>
     </el-upload>
+    <button @click="Delete" style="height: 20px; margin-left:10px;">删除</button>
   </div>
 </template>
 
@@ -24,21 +27,27 @@ export default {
   components: {},
   data() {
     return {
+      File: '',
       uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
       headers: {
         Authorization: "Bearer " + getToken(),
       },
     };
   },
-  props: {
-    value: {
-      type: String,
-      default: "",
-    },
-  },
+  // props: {
+  //   value: {
+  //     type: String,
+  //     default: "",
+  //   },
+  // },
   methods: {
     handleUploadSuccess(res) {
-      this.$emit("input", res.url);
+      console.log(res)
+      this.$emit("input", res);
+      // this.$emit("fileName", res.fileName);
+      
+      this.File = res.url;
+      console.log(res.url)
       this.loading.close();
     },
     handleBeforeUpload() {
@@ -48,6 +57,11 @@ export default {
         background: "rgba(0, 0, 0, 0.7)",
       });
     },
+    // 删除
+    Delete() {
+     this.File = '';
+     this.$message('已删除')
+    },
     handleUploadError() {
       this.$message({
         type: "error",
@@ -65,4 +79,16 @@ export default {
   width: 100%;
   height: 100%;
 }
+
+.upload-demo /deep/ .el-upload--picture-card {
+  height: 18px;
+  width: 45px;
+  line-height: 18px;
+  border: none;
+  margin-left:10px!important;
+}
+.upload-demo {
+  line-height: 30px;
+   margin-left:0px!important;
+}
 </style>

+ 116 - 106
src/views/warehouseBusiness/inStock/index.vue

@@ -300,7 +300,7 @@
 
           <el-col :span="8">
             <el-form-item label="仓管员" prop="fStorekeeper">
-               <el-select
+              <el-select
                 v-model="form.fStorekeeper"
                 filterable
                 remote
@@ -559,7 +559,7 @@
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item label="制单人" prop="createBy">
+            <el-form-item label="制单人111" prop="createBy">
               <el-input
                 disabled
                 v-model="form.createBy"
@@ -919,14 +919,14 @@
         <el-table-column label="序号" type="index" width="80">
         </el-table-column>
         <el-table-column
-          prop="attachName"
+          prop="fName"
           header-align="center"
           align="center"
           label="附件名称"
         >
           <template slot-scope="scope">
             <el-input
-              v-model="scope.row.attachName"
+              v-model="scope.row.fName"
               :disabled="browseStatus"
               placeholder="附件名称"
               show-word-limit
@@ -934,14 +934,14 @@
           </template>
         </el-table-column>
         <el-table-column
-          prop="opUserName"
+          prop="createBy"
           header-align="center"
           align="center"
           label="上传人"
         >
           <template slot-scope="scope">
             <el-input
-              v-model="scope.row.opUserName"
+              v-model="scope.row.createBy"
               :disabled="browseStatus"
               placeholder="上传人"
               show-word-limit
@@ -949,14 +949,14 @@
           </template>
         </el-table-column>
         <el-table-column
-          prop="opDate"
+          prop="createTime"
           header-align="center"
           align="center"
           label="上传时间"
         >
           <template slot-scope="scope">
             <el-date-picker
-              v-model="scope.row.opDate"
+              v-model="scope.row.createTime"
               type="date"
               disabled
               placeholder="上传时间"
@@ -966,16 +966,16 @@
           </template>
         </el-table-column>
         <el-table-column
-  prop="attachId"
-  header-align="center"
-  align="center"
-  width="250PX"
-  label="上传附件"
->
-  <template slot-scope="scope">
-    <uploadImage @input="showFile" v-model="scope.row.fUrl"/>
-  </template>
-</el-table-column>
+          prop="fUrl"
+          header-align="center"
+          align="center"
+          width="250PX"
+          label="上传附件"
+        >
+          <template slot-scope="scope">
+            <uploadFile @input="showFile" v-model="scope.row.fUrl" />
+          </template>
+        </el-table-column>
         <el-table-column
           header-align="center"
           align="center"
@@ -1025,19 +1025,19 @@
               show-word-limitfMblnoOptions
             /> -->
             <el-select
-                v-model="scope.row.fCorpid"
-                filterable
-                remote
-                :remote-method="corpsRemoteMethod"
-                placeholder="客户名称"
-              >
-                <el-option
-                  v-for="dict in KHblnoOptions"
-                  :key="dict.fId"
-                  :label="dict.fName"
-                  :value="dict.fId"
-                ></el-option>
-              </el-select>
+              v-model="scope.row.fCorpid"
+              filterable
+              remote
+              :remote-method="corpsRemoteMethod"
+              placeholder="客户名称"
+            >
+              <el-option
+                v-for="dict in KHblnoOptions"
+                :key="dict.fId"
+                :label="dict.fName"
+                :value="dict.fId"
+              ></el-option>
+            </el-select>
           </template>
         </el-table-column>
         <el-table-column
@@ -1054,19 +1054,19 @@
               show-word-limit
             /> -->
             <el-select
-                v-model="scope.row.fCorpid"
-                filterable
-                remote
-                :remote-method="fWRemoteMethod"
-                placeholder="费用名称"
-              >
-                <el-option
-                  v-for="dict in fWbuOptions"
-                  :key="dict.fId"
-                  :label="dict.fName"
-                  :value="dict.fId"
-                ></el-option>
-              </el-select>
+              v-model="scope.row.fCorpid"
+              filterable
+              remote
+              :remote-method="fWRemoteMethod"
+              placeholder="费用名称"
+            >
+              <el-option
+                v-for="dict in fWbuOptions"
+                :key="dict.fId"
+                :label="dict.fName"
+                :value="dict.fId"
+              ></el-option>
+            </el-select>
           </template>
         </el-table-column>
         <el-table-column
@@ -1083,17 +1083,17 @@
               show-word-limit
             /> -->
             <el-select
-                v-model="scope.row.fFeeUnitid"
-                placeholder="请选择计费单位"
-                clearable
-              >
-                <el-option
-                  v-for="dict in jFeetunitOptions"
-                  :key="dict.dictValue"
-                  :label="dict.dictLabel"
-                  :value="dict.dictValue"
-                />
-              </el-select>
+              v-model="scope.row.fFeeUnitid"
+              placeholder="请选择计费单位"
+              clearable
+            >
+              <el-option
+                v-for="dict in jFeetunitOptions"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="dict.dictValue"
+              />
+            </el-select>
           </template>
         </el-table-column>
         <el-table-column
@@ -1258,19 +1258,19 @@
               show-word-limit
             /> -->
             <el-select
-                v-model="scope.row.fCorpid"
-                filterable
-                remote
-                :remote-method="corpsRemoteMethod"
-                placeholder="客户名称"
-              >
-                <el-option
-                  v-for="dict in KHblnoOptions"
-                  :key="dict.fId"
-                  :label="dict.fName"
-                  :value="dict.fId"
-                ></el-option>
-              </el-select>
+              v-model="scope.row.fCorpid"
+              filterable
+              remote
+              :remote-method="corpsRemoteMethod"
+              placeholder="客户名称"
+            >
+              <el-option
+                v-for="dict in KHblnoOptions"
+                :key="dict.fId"
+                :label="dict.fName"
+                :value="dict.fId"
+              ></el-option>
+            </el-select>
           </template>
         </el-table-column>
         <el-table-column
@@ -1287,19 +1287,19 @@
               show-word-limit
             /> -->
             <el-select
-                v-model="scope.row.fCorpid"
-                filterable
-                remote
-                :remote-method="fWRemoteMethod"
-                placeholder="费用名称"
-              >
-                <el-option
-                  v-for="dict in fWbuOptions"
-                  :key="dict.fId"
-                  :label="dict.fName"
-                  :value="dict.fId"
-                ></el-option>
-              </el-select>
+              v-model="scope.row.fCorpid"
+              filterable
+              remote
+              :remote-method="fWRemoteMethod"
+              placeholder="费用名称"
+            >
+              <el-option
+                v-for="dict in fWbuOptions"
+                :key="dict.fId"
+                :label="dict.fName"
+                :value="dict.fId"
+              ></el-option>
+            </el-select>
           </template>
         </el-table-column>
         <el-table-column
@@ -1316,17 +1316,17 @@
               show-word-limit
             /> -->
             <el-select
-                v-model="scope.row.fFeeUnitid"
-                placeholder="请选择计费单位"
-                clearable
-              >
-                <el-option
-                  v-for="dict in jFeetunitOptions"
-                  :key="dict.dictValue"
-                  :label="dict.dictLabel"
-                  :value="dict.dictValue"
-                />
-              </el-select>
+              v-model="scope.row.fFeeUnitid"
+              placeholder="请选择计费单位"
+              clearable
+            >
+              <el-option
+                v-for="dict in jFeetunitOptions"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="dict.dictValue"
+              />
+            </el-select>
           </template>
         </el-table-column>
         <el-table-column
@@ -1766,11 +1766,11 @@ import { listWarehouse } from "@/api/basicdata/warehouse";
 import { listGoods } from "@/api/basicdata/goods";
 
 import { listUser, queryUserVal } from "@/api/system/user";
-import UploadImage from '@/components/UploadImage'
+import UploadFile from "@/components/Uploadfile";
 export default {
   name: "Warehousebills",
   components: {
-    UploadImage
+    UploadFile,
   },
   data() {
     return {
@@ -1838,9 +1838,9 @@ export default {
       // 状态(数据字典),N 入字典
       fBillstatusOptions: [],
       // 费用名称
-      fWbuOptions:[],
+      fWbuOptions: [],
       // 计价单位
-      jFeetunitOptions:[],
+      jFeetunitOptions: [],
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -1968,8 +1968,10 @@ export default {
   },
   methods: {
     // 上传成功返回数据
-    showFile (row) {
-  console.log(row)
+    showFile(row) {
+      console.log(row);
+      // this.$set(this.relevantAttachments[0], 'fName', row.fileName)
+      this.$set(this.relevantAttachments[0], 'fUrl', row.url)
     },
     printSomething() {
       // 此处的style即为打印时的样式
@@ -1988,8 +1990,8 @@ export default {
         fUrl: null,
         fName: null,
         createBy: this.queryParams.createBy,
-        createTime: Date.parse(new Date())
-      })
+        createTime: Date.parse(new Date()),
+      });
     },
     // 添加list
     addRelevant() {
@@ -2051,10 +2053,14 @@ export default {
     },
     queryUser() {
       queryUserVal().then((response) => {
+        console.log(response)
+        console.log(this.form)
+        console.log(this.relevantAttachments)
         if (response.user !== null) {
           this.userVal = response.user;
           this.$set(this.form, "fDeptid", this.userVal.deptId);
           this.$set(this.form, "createBy", this.userVal.userName);
+          // this.$set(this.relevantAttachments, "opUserName", this.userVal.userName);
           this.$set(this.form, "createTime", Date.parse(new Date()));
         }
         if (response.dept !== null) {
@@ -2182,6 +2188,7 @@ export default {
       this.dataList = [];
       this.warehouseCrList = [];
       this.warehouseDrList = [];
+      this.relevantAttachments = []
       this.title = "入库单";
     },
     /** 修改按钮操作 */
@@ -2347,6 +2354,9 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      if(typeof this.form.fBillstatus === 'undefined' || this.form.fBillstatus==null) {
+        this.form.fBillstatus = 6;
+      }
       this.$refs["form"].validate((valid) => {
         console.log(valid);
         console.log(this.form);
@@ -2358,7 +2368,7 @@ export default {
           // 附件数据
           formData.append("tWarehouseBills", JSON.stringify(this.form));
           // 附件数据
-          formData.append("tWhgenleg", null);
+          formData.append("tWhgenleg", JSON.stringify(this.relevantAttachments));
           // // 费用明细付款
           formData.append(
             "tWarehousebillsfeesCr",
@@ -2428,7 +2438,7 @@ export default {
       }
       let queryParams = { pageNum: 1, pageSize: 10, fName: name };
       listCorps(queryParams).then((response) => {
-        console.log(response)
+        console.log(response);
         this.fMblnoOptions = response.rows;
         this.KHblnoOptions = response.rows;
       });
@@ -2444,14 +2454,14 @@ export default {
       });
     },
     // 远程模糊查询费用名称
-    fWRemoteMethod(name) { 
-     if (name == null || name === "") {
+    fWRemoteMethod(name) {
+      if (name == null || name === "") {
         return false;
       }
       let queryParams = { pageNum: 1, pageSize: 10, fName: name };
       listFees(queryParams).then((response) => {
         this.fWbuOptions = response.rows;
-        console.log(response)
+        console.log(response);
       });
     },
     /* 远程模糊查询经营单位 */
@@ -2482,7 +2492,7 @@ export default {
       let queryParams = { pageNum: 1, pageSize: 10, userName: name };
       listUser(queryParams).then((response) => {
         this.userOptions = response.rows;
-        console.log(response.rows)
+        console.log(response.rows);
       });
     },
   },

+ 2 - 2
vue.config.js

@@ -34,8 +34,8 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        // target: `http://192.168.137.112:9010`,
-        target: `http://engineering.echepei.com:9010/`,
+        target: `http://192.168.137.230:9010`,
+        // target: `http://engineering.echepei.com:9010/`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''