Просмотр исходного кода

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

002390 2 лет назад
Родитель
Сommit
946deb33d9

+ 71 - 0
src/components/computed-input/index.vue

@@ -0,0 +1,71 @@
+<template>
+  <el-input
+    v-model="value"
+    readonly
+    :size="size"
+    :placeholder="placeholder"
+    style="width: 100%"
+  ></el-input>
+</template>
+
+<script>
+export default {
+  name: "ComputedInput",
+  props: {
+    // v-model
+    value: {
+      type: [Number, String],
+      require: true,
+    },
+    // v-model
+    computed: {
+      type: Function,
+      default: () => {
+        return () => {};
+      },
+      require: true,
+    },
+    // 源数据
+    source: {
+      type: Object,
+      require: true,
+    },
+    // 组件大小
+    size: {
+      type: String,
+      dafault: () => {
+        return "mini";
+      },
+    },
+    // 提示
+    placeholder: {
+      type: String,
+      dafault: () => {
+        return "";
+      },
+    },
+  },
+  data() {
+    return {};
+  },
+  computed: {
+    newSource() {
+      return this.$props.source;
+    },
+  },
+  watch: {
+    newSource: {
+      handler: function (newProp) {
+        const { computed } = this.$props;
+        this.$emit("input", computed(newProp));
+      },
+      deep: true,
+    },
+  },
+  methods: {},
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+<style scoped></style>

+ 3 - 0
src/main.js

@@ -51,6 +51,8 @@ import DictData from "@/components/DictData";
 import PopoverSelect from "@/components/popover-select/index.vue";
 //
 import PopoverTreeSelect from "@/components/popover-tree-select/index.vue";
+//
+import ComputedInput from "@/components/computed-input/index.vue";
 
 // 全局方法挂载
 Vue.prototype.getDicts = getDicts;
@@ -73,6 +75,7 @@ Vue.component("ImageUpload", ImageUpload);
 Vue.component("ImagePreview", ImagePreview);
 Vue.component("DrPopoverSelect", PopoverSelect);
 Vue.component("DrPopoverTreeSelect", PopoverTreeSelect);
+Vue.component("DrComputedInput", ComputedInput);
 
 Vue.use(directive);
 Vue.use(plugins);

+ 8 - 0
src/views/purchase/contract/add/index.vue

@@ -255,6 +255,14 @@ export default {
                     :placeholder="cColumn.placeholder"
                     style="width: 100%"
                   ></el-input>
+                  <dr-computed-input
+                    v-if="cColumn.inputType === 'ComputedInput'"
+                    v-model="scope.row[cColumn.key]"
+                    :source="scope.row"
+                    :computed="cColumn.computed"
+                    :placeholder="cColumn.placeholder"
+                    style="width: 100%"
+                  ></dr-computed-input>
                   <dr-popover-select
                     v-else-if="cColumn.inputType === 'PopoverSelect'"
                     v-model="scope.row[cColumn.key]"

+ 40 - 11
src/views/purchase/contract/column.js

@@ -108,8 +108,9 @@ export const Columns = [
   {
     key: "contractFormat",
     title: "合同格式",
-    inputType: "Input",
+    inputType: "Select",
     require: true,
+    referName: "puarchase_contract_contract_format",
   },
   {
     key: "productName",
@@ -246,21 +247,21 @@ export const Columns = [
     title: "对外附件",
     inputType: "Upload",
     span: 24,
-    fileType: ["pdf", "xls"],
+    fileType: ["pdf"],
   },
   {
     key: "puFile",
     title: "采购商盖章合同附件",
     inputType: "Upload",
     span: 24,
-    fileType: ["pdf", "xls"],
+    fileType: ["pdf"],
   },
   {
     key: "supplierFile",
     title: "供应商盖章合同附件",
     inputType: "Upload",
     span: 24,
-    fileType: ["pdf", "xls"],
+    fileType: ["pdf"],
   },
   { key: "projectCode", title: "项目编号", inputType: "Input" },
   { key: "projectName", title: "项目名称", inputType: "Input" },
@@ -364,17 +365,24 @@ export const TabColumns = [
         title: "采购数量",
         key: "qty",
         inputType: "InputNumber",
-
         width: 200,
       },
       {
         title: "含税单价",
         key: "taxPrice",
         inputType: "InputNumber",
-
         width: 200,
       },
-      { title: "含税金额合计", key: "taxMoney", width: 200 },
+      {
+        title: "含税金额合计",
+        key: "taxMoney",
+        inputType: "ComputedInput",
+        width: 200,
+        computed: (prop) => {
+          const { qty, taxPrice } = prop;
+          return qty && taxPrice ? qty * taxPrice : null;
+        },
+      },
       { title: "无税单价", key: "taxFreePrice" },
       { title: "无税金额合计", key: "taxFreeMoney", width: 200 },
       {
@@ -448,8 +456,20 @@ export const TabColumns = [
       { title: "账期天数", key: "paymetDays", inputType: "Input", width: 200 },
       { title: "付款比例%", key: "ratio", inputType: "Input", width: 200 },
       { title: "付款金额", key: "money", inputType: "Input", width: 200 },
-      { title: "是否预付款", key: "isAdvance", width: 200 },
-      { title: "是否质保金", key: "isQuality", width: 200 },
+      {
+        title: "是否预付款",
+        key: "isAdvance",
+        width: 200,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
+      {
+        title: "是否质保金",
+        key: "isQuality",
+        width: 200,
+        inputType: "Select",
+        referName: "sys_yes_no",
+      },
       {
         title: "结算方式",
         key: "paymentMeans",
@@ -474,8 +494,17 @@ export const TabColumns = [
     title: "合同执行组织范围",
     key: "contractApplyOrgList",
     tableColumns: [
-      { title: "组织名称", key: "orgName", inputType: "Input" },
-      { title: "组织编码", key: "org", inputType: "Input" },
+      {
+        title: "组织名称",
+        key: "orgName",
+        inputType: "PopoverSelect",
+        referName: "ORG_PARAM",
+        dataMapping: {
+          org: "code",
+          orgName: "name",
+        },
+      },
+      { title: "组织编码", key: "org" },
     ],
   },
 ];