Procházet zdrojové kódy

维多利亚bug修改

cz před 2 roky
rodič
revize
8f4201e51d

+ 39 - 9
src/views/product-material/customer/addCustomer.vue

@@ -11,12 +11,16 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="客户编码" prop="code">
-              <el-input v-model="form.code" placeholder="请输入"></el-input>
+              <el-input
+                v-model="form.code"
+                placeholder="请输入"
+                :disabled="isEdit === 'edit'"
+              ></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="1"></el-col>
-          <el-col :span="15">
-            <el-form-item label=".">
+          <el-col :span="15" style="margin-top: 30px">
+            <el-form-item label=" ">
               <span>不输入则自动生成,自动编码规则示例:C00001</span>
             </el-form-item>
           </el-col>
@@ -115,7 +119,6 @@
 
         <el-form-item label="上传附件">
           <el-upload
-            class="upload-demo"
             action="/api/service-file/uploadFile"
             :headers="uploadHeader"
             :on-preview="handlePreview"
@@ -159,6 +162,9 @@ export default {
       type: Object,
       default: () => {},
     },
+    isEdit: {
+      type: String,
+    },
   },
   data() {
     return {
@@ -218,19 +224,35 @@ export default {
       fileList: [],
     };
   },
+
   created() {
     getRegionData({ parentId: "", type: "1" }).then((res) => {
       this.countryData = res.data.data;
     });
   },
+  watch: {
+    form: {
+      handler(val, oldVal) {
+        this.fileList = val.fileInfoList;
+        this.fileList = this.fileList.map((x) => ({ name: x.fileName, ...x }));
+        // console.log(this.fileList, "aaa");
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
   methods: {
     handleSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
           this.loading = true;
-          this.form.fileInfoList = this.fileList.map((x) => ({
-            ...x.response.data,
-          }));
+          this.form.fileInfoList = this.fileList.map((x) => {
+            if (x.response) {
+              return { ...x.response.data };
+            } else {
+              return { ...x };
+            }
+          });
           this.$emit("submit");
         }
       });
@@ -251,10 +273,18 @@ export default {
     handleSuccess(response, file, fileList) {
       this.fileList = fileList;
     },
-    handleRemove(response, file, fileList) {
+    handleRemove(file, fileList) {
       this.fileList = fileList;
     },
-    handlePreview() {},
+    handlePreview(file) {
+      let path = "";
+      if (file.response) {
+        path = "/file/" + file.response.data.filePath;
+      } else {
+        path = "/file/" + file.filePath;
+      }
+      window.open(path, "_blank");
+    },
   },
 };
 </script>

+ 11 - 8
src/views/product-material/customer/index.vue

@@ -8,6 +8,7 @@ import byTable from "@/components/by-table/index.js";
 import addCustomer from "./addCustomer.vue";
 
 import * as API from "@/api/product-material/customer/index.js";
+import { getFileData } from "@/api/system/common.js";
 
 export default {
   components: {
@@ -94,6 +95,7 @@ export default {
       this.getList();
     },
     handleAdd() {
+      this.titleText = "add";
       this.form = {
         id: "",
         code: "",
@@ -108,7 +110,7 @@ export default {
         remark: "",
         fileInfoList: [],
       };
-      this.titleText = "add";
+
       this.open = true;
       this.$nextTick(() => {
         this.$refs.addCustomer.countryChange(this.form.countryId);
@@ -133,16 +135,16 @@ export default {
     },
     handleEdit(row) {
       this.titleText = "edit";
-      this.form = row;
       this.open = true;
-      if (this.form.fileInfoList === "") {
-        this.form.fileInfoList = [];
-      }
       this.$nextTick(() => {
         this.$refs.addCustomer.loading = true;
-        this.$refs.addCustomer.countryChange(this.form.countryId);
-        this.$refs.addCustomer.provinceChange(this.form.provinceId);
-        this.$refs.addCustomer.loading = false;
+        getFileData({ businessId: row.id }).then((file) => {
+          this.form = JSON.parse(JSON.stringify(row));
+          this.form.fileInfoList = file.data.data;
+          this.$refs.addCustomer.countryChange(this.form.countryId);
+          this.$refs.addCustomer.provinceChange(this.form.provinceId);
+          this.$refs.addCustomer.loading = false;
+        });
       });
     },
     handleSubmit() {
@@ -277,6 +279,7 @@ export default {
     >
       <add-customer
         :form="form"
+        :isEdit="titleText"
         @submit="handleSubmit"
         @cancel="handleCancel"
         ref="addCustomer"

+ 10 - 12
src/views/product-material/product/addProduct.vue

@@ -136,7 +136,7 @@
             <div v-loading="loadingImage">
               <img
                 v-if="imgUrl"
-                :src="imgUrl"
+                :src="'/file/' + imgUrl"
                 style="max-width: 150px; max-height: 150px"
                 fit="scale-down"
               />
@@ -296,6 +296,7 @@ export default {
   },
   data() {
     return {
+      host: window.location.host,
       uploadHeader: {
         Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
         "Blade-Auth": "bearer " + getToken(),
@@ -387,17 +388,13 @@ export default {
       }
     );
   },
-  mounted() {
-    this.fileData = this.fileData1;
-    // if (this.form.fileInfoList && this.form.fileInfoList.length > 0) {
-    //   this.fileList = this.form.fileInfoList;
-    // }
-  },
+  mounted() {},
   watch: {
-    fileData: {
+    fileData1: {
       handler(val) {
         if (val) {
-          this.fileData = this.fileData1;
+          this.fileData = val;
+          this.imgUrl = this.fileData.filePath;
         }
       },
     },
@@ -419,7 +416,6 @@ export default {
           const arr = [];
           arr.push(this.fileData);
           this.form.fileInfoList = arr;
-
           this.$emit("submit");
         }
       });
@@ -462,8 +458,10 @@ export default {
     },
     mainPictureSuccess(response) {
       this.fileData = response.data;
-      this.imageUrl = this.fileData.filePath;
-      this.loadingImage = false;
+      this.imgUrl = this.fileData.filePath;
+      setTimeout(() => {
+        this.loadingImage = false;
+      }, 200);
     },
     mainPictureError() {
       this.loadingImage = false;

+ 12 - 2
src/views/product-material/product/index.vue

@@ -2,7 +2,7 @@
   <div class="video-setting">
     <el-row :gutter="8">
       <el-col :span="6">
-        <tree @treeClick="reload"></tree>
+        <tree @treeClick="reload" @handleRefresh="handleRefresh"></tree>
       </el-col>
       <el-col :span="18" class="right">
         <el-card class="top">
@@ -138,7 +138,12 @@
             top="60px"
           >
             <div class="search-box">
-              <el-form :form="req" label-position="top" label-width="100px" @submit.native.prevent>
+              <el-form
+                :form="req"
+                label-position="top"
+                label-width="100px"
+                @submit.native.prevent
+              >
                 <el-form-item
                   :label="$t('product_material.product.productType')"
                 >
@@ -610,6 +615,11 @@ export default {
       this.req.classifyId = row.id;
       this.getList();
     },
+    handleRefresh() {
+      this.req.pageNum = 1;
+      this.req.classifyId = "";
+      this.getList();
+    },
     handleSubmit() {
       if (!this.form.id) {
         API.productAdd(this.form).then(

+ 9 - 0
src/views/product-material/product/tree.vue

@@ -10,6 +10,11 @@
       <div style="width: 100px; margin-left: 10px">
         <el-button size="mini" @click="add"> 添加</el-button>
       </div>
+      <div
+        style="width: 40px; margin-left: 10px; cursor: pointer"
+        class="el-icon-refresh-right"
+        @click="handleRefresh"
+      ></div>
     </el-row>
     <el-tree
       ref="tree"
@@ -176,6 +181,10 @@ export default {
     handleNodeClick(row) {
       this.$emit("treeClick", row);
     },
+    handleRefresh() {
+      this.getTree();
+      this.$emit("handleRefresh");
+    },
     getTree() {
       this.loading = true;
       API.productTree(this.treeQuery).then(

+ 37 - 5
src/views/product-material/supply/addSupply.vue

@@ -23,7 +23,11 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="供应商编码" prop="code">
-              <el-input v-model="form.code" placeholder="请输入"></el-input>
+              <el-input
+                v-model="form.code"
+                placeholder="请输入"
+                :disabled="isEdit === 'edit'"
+              ></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -141,8 +145,7 @@
         </el-row>
         <el-form-item label="上传附件">
           <el-upload
-            class="upload-demo"
-            action="http://36.134.91.96:10001/api/service-file/uploadFile"
+            action="/api/service-file/uploadFile"
             :headers="uploadHeader"
             :on-preview="handlePreview"
             :on-remove="handleRemove"
@@ -199,6 +202,9 @@ export default {
       type: Object,
       default: () => {},
     },
+    isEdit: {
+      type: String,
+    },
     supplyTypeList: {
       type: Array,
       default: () => [],
@@ -287,11 +293,29 @@ export default {
       this.countryData = res.data.data;
     });
   },
+  watch: {
+    form: {
+      handler(val, oldVal) {
+        this.fileList = val.fileInfoList;
+        this.fileList = this.fileList.map((x) => ({ name: x.fileName, ...x }));
+        // console.log(this.fileList, "aaa");
+      },
+      deep: true,
+      immediate: true,
+    },
+  },
   methods: {
     handleSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
           this.loading = true;
+          this.form.fileInfoList = this.fileList.map((x) => {
+            if (x.response) {
+              return { ...x.response.data };
+            } else {
+              return { ...x };
+            }
+          });
           this.$emit("submit");
         }
       });
@@ -312,10 +336,18 @@ export default {
     handleSuccess(response, file, fileList) {
       this.form.fileInfoList = fileList;
     },
-    handleRemove(response, file, fileList) {
+    handleRemove(response, fileList) {
       this.form.fileInfoList = fileList;
     },
-    handlePreview() {},
+    handlePreview(file) {
+      let path = "";
+      if (file.response) {
+        path = "/file/" + file.response.data.filePath;
+      } else {
+        path = "/file/" + file.filePath;
+      }
+      window.open(path, "_blank");
+    },
   },
 };
 </script>

+ 1 - 1
src/views/product-material/supply/addSupplyPrice.vue

@@ -42,7 +42,7 @@
                 placeholder="产品名称"
               ></el-input>
             </el-col>
-            <el-col :span="3">
+            <el-col :span="3" v-if="isEdit !== 'edit'">
               <el-button size="mini" @click="selectDialog = true"
                 >选择
               </el-button>

+ 16 - 13
src/views/product-material/supply/index.vue

@@ -87,6 +87,7 @@
       >
         <add-supply
           :form="form"
+          :isEdit="titleText"
           :supplyTypeList="supplyTypeList"
           @submit="handleSubmit"
           @cancel="handleCancel"
@@ -270,6 +271,7 @@ import test from "@/components/form-test/index.vue";
 import query from "@/components/query/index.vue";
 import addSupply from "./addSupply.vue";
 import * as API from "@/api/product-material/supply/index.js";
+import { getFileData } from "@/api/system/common.js";
 
 import labelTitle from "@/components/label-title/index.vue";
 export default {
@@ -357,8 +359,8 @@ export default {
         provinceId: "",
         cityId: "",
         detailedAddress: "",
-        accountPeriod: "",
-        returnPeriod: "",
+        accountPeriod: "0",
+        returnPeriod: "5",
         accountName: "",
         bankAccount: "",
         bankOfDeposit: "",
@@ -379,7 +381,7 @@ export default {
       label: item.dictValue,
       value: item.dictKey,
     }));
-    this.selectConfig[0].data = [
+    this.selectConfig[1].data = [
       {
         label: "有",
         value: "1",
@@ -429,8 +431,8 @@ export default {
         provinceId: "",
         cityId: "",
         detailedAddress: "",
-        accountPeriod: "",
-        returnPeriod: "",
+        accountPeriod: "0",
+        returnPeriod: "5",
         accountName: "",
         bankAccount: "",
         bankOfDeposit: "",
@@ -457,8 +459,8 @@ export default {
         provinceId: "",
         cityId: "",
         detailedAddress: "",
-        accountPeriod: "",
-        returnPeriod: "",
+        accountPeriod: "0",
+        returnPeriod: "5",
         accountName: "",
         bankAccount: "",
         bankOfDeposit: "",
@@ -472,14 +474,15 @@ export default {
       this.titleText = "edit";
       this.form = row;
       this.open = true;
-      if (this.form.fileInfoList === "") {
-        this.form.fileInfoList = [];
-      }
       this.$nextTick(() => {
         this.$refs.addSupply.loading = true;
-        this.$refs.addSupply.countryChange(this.form.countryId);
-        this.$refs.addSupply.provinceChange(this.form.provinceId);
-        this.$refs.addSupply.loading = false;
+        getFileData({ businessId: row.id }).then((file) => {
+          this.form = JSON.parse(JSON.stringify(row));
+          this.form.fileInfoList = file.data.data;
+          this.$refs.addSupply.countryChange(this.form.countryId);
+          this.$refs.addSupply.provinceChange(this.form.provinceId);
+          this.$refs.addSupply.loading = false;
+        });
       });
     },
     handleSubmit() {

+ 3 - 1
src/views/product-material/supply/priceMaintenance.vue

@@ -343,7 +343,9 @@ export default {
     },
     handleEdit(row) {
       this.titleText = "edit";
-      this.form = row;
+      this.form = JSON.parse(JSON.stringify(row));
+      this.form.name = this.form.materialName;
+      this.form.code = this.form.materialCode;
       this.open = true;
     },
     handleSubmit() {

+ 1 - 2
src/views/product-material/warehouse/index.vue

@@ -26,9 +26,8 @@
       <el-table-column
         label="仓管员"
         align="left"
-        prop="warehouseKeeperId"
+        prop="warehouseKeeperName"
         width="150"
-        :formatter="showWarehouseKeeperId"
       />
       <el-table-column label="仓库说明" align="left" prop="remarks" />
 

+ 11 - 0
vue.config.js

@@ -57,6 +57,17 @@ module.exports = {
           '^/api': '/',
         },
       },
+      '/file': {
+        //本地服务接口地址
+        target: 'http://36.134.91.96:10001',
+        // target: 'https://cfm.bytesail.cn/api',
+        //远程演示服务地址,可用于直接启动项目
+        //target: 'https://saber.bladex.vip/api',
+        ws: true,
+        pathRewrite: {
+          '^/api': '/',
+        },
+      },
     },
   },
   // 自定义webpack配置