浏览代码

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002390 2 年之前
父节点
当前提交
cfd7906d63

+ 4 - 1
src/components/FileUpload/index.vue

@@ -99,7 +99,10 @@ export default {
       separator: ";",
       uploadList: [],
       baseUrl: "https://sy.derom.com/document-center/fastdfs/download",
-      uploadFileUrl: "/drp-file/document-center/fastdfs/upload",
+      uploadFileUrl:
+        process.env.NODE_ENV == "development"
+          ? "/document-center/fastdfs/upload"
+          : "/drp-file/document-center/fastdfs/upload",
       headers: {
         Authorization: "Bearer " + getToken(),
       },

+ 3 - 2
src/components/computed-input/index.vue

@@ -1,11 +1,12 @@
 <template>
-  <el-input
+  <!-- <el-input
     v-model="value"
     readonly
     :size="size"
     :placeholder="placeholder"
     style="width: 100%"
-  ></el-input>
+  ></el-input> -->
+  <span>{{ value || "- -" }}</span>
 </template>
 
 <script>

+ 1 - 9
src/components/popover-select/api/index.js

@@ -1,14 +1,6 @@
 import request from "@/utils/request";
 
-export function list(url, params) {
-  return request({
-    url: `/pu/contract/${url}/list`,
-    method: "get",
-    params: params,
-  });
-}
-
-export function refer(data, params) {
+export function REFER(data, params) {
   return request({
     url: "/refer/query",
     method: "POST",

+ 20 - 2
src/components/popover-select/components/MATERIAL_PARAM.js

@@ -1,13 +1,31 @@
 export default [
   {
     key: "code",
-    title: "物料编码",
+    title: "编码",
     type: "Input",
     search: true,
   },
   {
     key: "name",
-    title: "物料名称",
+    title: "名称",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "specification",
+    title: "规格",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "manufacturerIdName",
+    title: "生产厂家",
+    type: "Input",
+    search: true,
+  },
+  {
+    key: "unitIdName",
+    title: "单位",
     type: "Input",
     search: true,
   },

+ 3 - 3
src/components/popover-select/index.vue

@@ -1,5 +1,5 @@
 <script>
-import { refer } from "./api/index";
+import { REFER } from "./api/index";
 export default {
   name: "PopoverSelect",
   props: {
@@ -130,14 +130,14 @@ export default {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await refer(prop, {
+        const { code, rows, total } = await REFER(prop, {
           pageNum,
           pageSize,
         });
         if (code === 200) {
           this.data = rows;
           this.page.total = total;
-        } 
+        }
       } catch (err) {
         //
       } finally {

+ 2 - 2
src/components/popover-tree-select/components/index.vue

@@ -1,5 +1,5 @@
 <script>
-import { refer } from "../api/index";
+import { REFER } from "../api/index";
 
 export default {
   name: "TableDialog",
@@ -48,7 +48,7 @@ export default {
       try {
         this.loading = true;
         const { type, queryParams } = this.$props;
-        const { code, msg, rows } = await refer({
+        const { code, msg, rows } = await REFER({
           type: type,
           ...prop,
           ...queryParams,

+ 6 - 0
src/views/purchase/PurchaseDemandList/add.vue

@@ -756,6 +756,12 @@ export default {
         transportationCondition: null,
       }
       this.basicForm.puDemandItemList.push(newLine)
+      // 补单需求状态改变
+      if (this.basicForm.billType == 'BDXQ') {
+        this.BDZT = false
+      } else {
+        this.BDZT = true
+      }
     },
     delLine(index) {
       console.log('删除行:', index)

+ 28 - 7
src/views/purchase/contract/add/index.vue

@@ -1,5 +1,6 @@
 <script>
 import { Columns, TabColumns } from "../column";
+import { REFER } from "@/components/popover-select/api";
 import { ADD, CODE } from "@/api/business/purchase/contract";
 import { initDicts, initRules, initParams } from "@/utils/init";
 
@@ -75,12 +76,35 @@ export default {
         const code = await CODE();
         this.params.code = code;
       } catch (err) {
-        //
+        // catch
       } finally {
+        // finally
         this.loading = false;
       }
     },
     //
+    async fetchRefer(prop, type, source) {
+      const { rateCode } = prop;
+      if (type === "MATERIAL_PARAM") {
+        try {
+          this.loading = true;
+          const { code, rows } = await REFER({
+            search: rateCode,
+            type: "TAX_RATE_PARAM",
+          });
+          if (code === 200) {
+            const [{ ntaxrate }] = rows;
+            source.tax = ntaxrate;
+          }
+        } catch (err) {
+          // catch
+        } finally {
+          // finally
+          this.loading = false;
+        }
+      }
+    },
+    //
     rowAdd(prop) {
       const tab = this.tabColumns.find((element) => element.key === prop);
       this.params[prop].push(initParams(tab.tableColumns));
@@ -90,10 +114,6 @@ export default {
       prop.splice(index, 1);
     },
     //
-    sava() {
-      this.visible = false;
-    },
-    //
     submit(prop) {
       this.$refs[prop].validate(async (valid) => {
         if (valid) {
@@ -244,6 +264,7 @@ export default {
                 :prop="cColumn.key"
                 :label="cColumn.title"
                 :width="cColumn.width"
+                show-overflow-tooltip
               >
                 <template slot-scope="scope">
                   <el-input
@@ -256,7 +277,7 @@ export default {
                     style="width: 100%"
                   ></el-input>
                   <dr-computed-input
-                    v-if="cColumn.inputType === 'ComputedInput'"
+                    v-else-if="cColumn.inputType === 'ComputedInput'"
                     v-model="scope.row[cColumn.key]"
                     :source="scope.row"
                     :computed="cColumn.computed"
@@ -275,6 +296,7 @@ export default {
                     :clearable="cColumn.clearable"
                     :placeholder="cColumn.placeholder"
                     :data-mapping="cColumn.dataMapping"
+                    @change="fetchRefer"
                   >
                   </dr-popover-select>
                   <el-input-number
@@ -334,7 +356,6 @@ export default {
       </el-form-item>
       <el-form-item label-width="0" style="text-align: right">
         <el-button :size="size" @click="hide">取 消</el-button>
-        <el-button :size="size" @click="sava">保 存</el-button>
         <el-button :size="size" @click="submit('ruleForm')"> 新 增 </el-button>
       </el-form-item>
     </el-form>

+ 4 - 0
src/views/purchase/contract/column.js

@@ -315,6 +315,10 @@ export const TabColumns = [
         dataMapping: {
           material: "code",
           materialName: "name",
+          puUnit: "unitIdName",
+          registration: "registrationNo",
+          specification: "specification",
+          manufacturer: "manufacturerIdName",
         },
       },
       { title: "物料编码", key: "material", width: 200 },

+ 2 - 1
src/views/purchase/contract/edit/index.vue

@@ -271,6 +271,7 @@ export default {
                 :prop="cColumn.key"
                 :label="cColumn.title"
                 :width="cColumn.width"
+                show-overflow-tooltip
               >
                 <template slot-scope="scope">
                   <el-input
@@ -283,7 +284,7 @@ export default {
                     style="width: 100%"
                   ></el-input>
                   <dr-computed-input
-                    v-if="cColumn.inputType === 'ComputedInput'"
+                    v-else-if="cColumn.inputType === 'ComputedInput'"
                     v-model="scope.row[cColumn.key]"
                     :source="scope.row"
                     :computed="cColumn.computed"

+ 1 - 1
src/views/purchase/contract/index.vue

@@ -164,7 +164,7 @@ export default {
         :prop="column.key"
         :label="column.title"
         :width="column.width || 180"
-        :show-overflow-tooltip="column.showOverflowTooltip || true"
+        show-overflow-tooltip
       >
         <template slot-scope="scope">
           <dict-tag

+ 1 - 1
vue.config.js

@@ -53,7 +53,7 @@ module.exports = {
         },
       },
       "/drp-file": {
-        target: `https://sy.derom.com`,
+        target: `https://test-sy.derom.com`,
         changeOrigin: true,
         pathRewrite: { [`^/drp-file`]: "" },
       },