Jelajahi Sumber

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

黄梓星 1 tahun lalu
induk
melakukan
8f769157b2
35 mengubah file dengan 837 tambahan dan 608 penghapusan
  1. 1 1
      src/api/business/purchase/catalogue.js
  2. 9 0
      src/api/requisition/basic.js
  3. 1 1
      src/components/DictTag/index.vue
  4. 3 4
      src/components/FileUpload/index.vue
  5. 5 6
      src/components/popover-select-v2/index.vue
  6. 54 5
      src/components/super-table/index.vue
  7. 1 1
      src/components/super-table/once/filters.vue
  8. 8 0
      src/utils/expression.js
  9. 1 1
      src/utils/request.js
  10. 110 108
      src/views/material/changeApply/add/index.vue
  11. 1 1
      src/views/material/changeApply/amendantRecord/index.vue
  12. 20 19
      src/views/material/changeApply/index.vue
  13. 3 0
      src/views/material/changeApply/see/index.vue
  14. 2 2
      src/views/material/requisition/add.vue
  15. 40 7
      src/views/material/requisition/index.vue
  16. 20 14
      src/views/purchase/apply/add/columns.js
  17. 10 8
      src/views/purchase/apply/add/index.vue
  18. 18 20
      src/views/purchase/apply/columns.js
  19. 75 45
      src/views/purchase/apply/copy/columns.js
  20. 95 89
      src/views/purchase/apply/copy/index.vue
  21. 74 46
      src/views/purchase/apply/edit/columns.js
  22. 88 79
      src/views/purchase/apply/edit/index.vue
  23. 6 1
      src/views/purchase/apply/index.vue
  24. 17 17
      src/views/purchase/apply/see/columns.js
  25. 60 40
      src/views/purchase/catalogue/columns.js
  26. 7 13
      src/views/purchase/catalogue/export/index.vue
  27. 2 2
      src/views/purchase/catalogue/index.vue
  28. 2 2
      src/views/purchase/catalogue/see/columns.js
  29. 2 2
      src/views/purchase/contract/add/columns.js
  30. 93 66
      src/views/purchase/contract/columns.js
  31. 2 2
      src/views/purchase/contract/edit/columns.js
  32. 1 1
      src/views/purchase/contract/export/index.vue
  33. 1 0
      src/views/purchase/contract/index.vue
  34. 2 2
      src/views/purchase/contract/see/columns.js
  35. 3 3
      src/views/purchase/task/xie-yi-zhi-cai/column.js

+ 1 - 1
src/api/business/purchase/catalogue.js

@@ -50,7 +50,7 @@ export function EXIST(data) {
 
 export function EXPORT(data) {
   return request({
-    url: "/pu/price/catalogue/export",
+    url: "/pu/price/catalogue/exportByIds",
     method: "POST",
     data: data,
   });

+ 9 - 0
src/api/requisition/basic.js

@@ -35,6 +35,15 @@ export function editReq(data) {
   })
 }
 
+// 物料申请单-修改提交
+export function betchSubmit(data) {
+  return request({
+    url: `/system/apply/material/submit/${data}`,
+    method: 'post',
+    // data: data
+  })
+}
+
 // 物料申请单-删除
 export function delReq(id) {
   return request({

+ 1 - 1
src/components/DictTag/index.vue

@@ -35,7 +35,7 @@ export default {
       type: Array,
       default: null,
     },
-    value: [Number, String, Array],
+    value: [Number, String, Array,Boolean],
     size: String,
   },
   computed: {

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

@@ -1,7 +1,6 @@
 <template>
   <div class="upload-file">
     <el-upload
-      drag
       multiple
       :action="uploadFileUrl"
       :before-upload="handleBeforeUpload"
@@ -16,12 +15,12 @@
       ref="fileUpload"
     >
       <!-- 上传按钮 -->
-      <!-- <el-button size="mini" type="primary">选取文件</el-button> -->
-      <i class="el-icon-upload"></i>
+      <el-button size="mini" type="primary">选取文件</el-button>
+      <!-- <i class="el-icon-upload"></i>
       <div class="el-upload__text">
         将文件拖到此处,或
         <em>点击上传</em>
-      </div>
+      </div> -->
       <!-- 上传提示 -->
       <div class="el-upload__tip" slot="tip" v-if="showTip">
         请上传

+ 5 - 6
src/components/popover-select-v2/index.vue

@@ -37,7 +37,7 @@ export default {
       default: () => ({}),
     },
     // 多选
-    multiple: {
+    checkbox: {
       type: Boolean,
       default: false,
     },
@@ -155,15 +155,14 @@ export default {
     // select
     useSelect(prop) {
       this.selectData = prop;
-      console.log(" this.selectData ", this.selectData);
     },
     // confirm
     useConfirm(prop) {
       this.hide();
       const {
-        $props: { source, multiple, valueKey, dataMapping },
+        $props: { source, checkbox, valueKey, dataMapping },
       } = this;
-      if (multiple) {
+      if (checkbox) {
         this.$emit(
           "change",
           this.selectData.map((item) => {
@@ -277,8 +276,8 @@ export default {
           :size="size"
           :page="page"
           :columns="TableColumns"
-          :radio="!multiple"
-          :checkbox="multiple"
+          :radio="!checkbox"
+          :checkbox="checkbox"
           pagination
           highlight-current-row
           @pagination="useQuery"

+ 54 - 5
src/components/super-table/index.vue

@@ -52,6 +52,10 @@ export default {
       type: Function,
       default: () => {},
     },
+    //
+    storageKey: {
+      type: String,
+    },
   },
   components: {
     ElDictTag: () => import("@/components/DictTag/index.vue"),
@@ -72,11 +76,15 @@ export default {
     IconFilter: () => import("./once/filters.vue"),
   },
   data() {
-    const { columns } = this.$props;
-    const innerColumns = columns.map(({ item, attr }) => ({
-      attr,
-      item: { hidden: true, ...item },
-    }));
+    const { columns, storageKey } = this.$props;
+    const localColumns = localStorage.getItem(storageKey);
+    const innerColumns =
+      storageKey && localColumns
+        ? JSON.parse(localColumns)
+        : columns.map(({ item, attr }) => ({
+            attr,
+            item: { hidden: true, ...item },
+          }));
     return {
       innerColumns: innerColumns,
       rowKey: "id",
@@ -160,10 +168,32 @@ export default {
         );
       }
     },
+    // 宽度
+    onWidth(newProp, oldProp, column) {
+      this.innerColumns = this.innerColumns.map(({ item, attr }) => ({
+        attr,
+        item: {
+          ...item,
+          width: item.key === column.property ? newProp : item.width,
+        },
+      }));
+      if (this.$props.storageKey) {
+        localStorage.setItem(
+          this.$props.storageKey,
+          JSON.stringify(this.innerColumns)
+        );
+      }
+    },
     // 冻结
     onHide(prop) {
       this.$nextTick(() => {
         this.$refs.superTable.doLayout();
+        if (this.$props.storageKey) {
+          localStorage.setItem(
+            this.$props.storageKey,
+            JSON.stringify(this.innerColumns)
+          );
+        }
       });
     },
     // 排序
@@ -172,18 +202,36 @@ export default {
       this.$nextTick(() => {
         this.$refs.superTable.sort(key, sort);
         this.$refs.superTable.doLayout();
+        if (this.$props.storageKey) {
+          localStorage.setItem(
+            this.$props.storageKey,
+            JSON.stringify(this.innerColumns)
+          );
+        }
       });
     },
     // 冻结
     onFreeze() {
       this.$nextTick(() => {
         this.$refs.superTable.doLayout();
+        if (this.$props.storageKey) {
+          localStorage.setItem(
+            this.$props.storageKey,
+            JSON.stringify(this.innerColumns)
+          );
+        }
       });
     },
     // 过滤
     onFilter() {
       this.$nextTick(() => {
         this.$refs.superTable.doLayout();
+        if (this.$props.storageKey) {
+          localStorage.setItem(
+            this.$props.storageKey,
+            JSON.stringify(this.innerColumns)
+          );
+        }
       });
     },
     onFilters(value) {
@@ -232,6 +280,7 @@ export default {
       :highlight-current-row="radio"
       @row-click="onRowClick"
       @selection-change="onSelectionChange"
+      @header-dragend="onWidth"
       v-bind="$attrs"
       v-on="$listeners"
       style="flex: 1"

+ 1 - 1
src/components/super-table/once/filters.vue

@@ -3,7 +3,7 @@
     v-if="innerValue !== false || filterData.length"
     :visible-arrow="false"
     width="auto"
-    trigger="hover"
+    trigger="click"
     placement="bottom"
     popper-class="p-0"
     class="icon-filter"

+ 8 - 0
src/utils/expression.js

@@ -0,0 +1,8 @@
+import CONFIG from "@/config";
+
+// 无税单价
+export function iunitprice(tax = 0, price = 0) {
+  return ((Number(price) / (Number(tax) / 100 + 1)) * 1).toFixed(
+    CONFIG.precision
+  );
+}

+ 1 - 1
src/utils/request.js

@@ -117,7 +117,7 @@ service.interceptors.response.use(
             url: res.config.url,
             data: res.config.data,
             method: res.config.method,
-            params: { ...res.config.params},
+            params: { ...res.config.params },
           });
         }
       } catch (err) {

+ 110 - 108
src/views/material/changeApply/add/index.vue

@@ -298,123 +298,125 @@ export default {
           :name="item.key"
           lazy
         >
-          <el-super-table
-            v-model="materialInfo[item.key]"
-            :dict="dict"
-            :ref="tabName"
-            :columns="columns"
-            :size="$attrs.size"
-          >
-            <template slot="materialName" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-              >
-              </component>
-            </template>
-            <!-- 判断是否禁用 -->
-            <template slot="drug" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                :disabled="!(scope.row.medicineMaterial ==='0') "
-              >
-              <el-option
-                  v-for="item in dict.type[scope.attr.dictName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
+          <div style="height: 420px;display:flex">
+            <el-super-table
+              v-model="materialInfo[item.key]"
+              :dict="dict"
+              :ref="tabName"
+              :columns="columns"
+              :size="$attrs.size"
+            >
+              <template slot="materialName" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
+                  :size="$attrs.size"
+                  :source.sync="scope.row"
                 >
-                </el-option>
-              </component>
-            </template>
-
-            <template slot="registrationNo" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                :disabled="!(scope.row.medicineMaterial ==='0') "
-              >
-              </component>
-            </template>
-
-            <template slot="medicalDevices" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                :disabled="!(scope.row.medicineMaterial ==='0') "
-              >
-              <el-option
-                  v-for="item in dict.type[scope.attr.dictName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
+                </component>
+              </template>
+              <!-- 判断是否禁用 -->
+              <template slot="drug" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
+                  :size="$attrs.size"
+                  :source.sync="scope.row"
+                  :disabled="!(scope.row.medicineMaterial ==='0') "
+                >
+                <el-option
+                    v-for="item in dict.type[scope.attr.dictName]"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </component>
+              </template>
+  
+              <template slot="registrationNo" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
+                  :size="$attrs.size"
+                  :source.sync="scope.row"
+                  :disabled="!(scope.row.medicineMaterial ==='0') "
                 >
-                </el-option>
-              </component>
-            </template>
-            <template slot="maintenanceType" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                :disabled="!(scope.row.medicineMaterial ==='0') "
-              >
-              <el-option
-                  v-for="item in dict.type[scope.attr.dictName]"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
+                </component>
+              </template>
+  
+              <template slot="medicalDevices" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
+                  :size="$attrs.size"
+                  :source.sync="scope.row"
+                  :disabled="!(scope.row.medicineMaterial ==='0') "
                 >
-                </el-option>
-              </component>
-            </template>
-            <template slot="dosageFromName" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                :disabled="!(scope.row.medicineMaterial ==='0') "
-              >
-              </component>
-            </template>
-            
-
-            <el-table-column fixed="right" label="操作" width="120" align="center">
-              <template slot="header" slot-scope="scope">
-                <el-button
-                  type="text"
+                <el-option
+                    v-for="item in dict.type[scope.attr.dictName]"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </component>
+              </template>
+              <template slot="maintenanceType" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
                   :size="$attrs.size"
-                  @click="useRowAdd(tabName)"
+                  :source.sync="scope.row"
+                  :disabled="!(scope.row.medicineMaterial ==='0') "
                 >
-                  增行
-                </el-button>
+                <el-option
+                    v-for="item in dict.type[scope.attr.dictName]"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  >
+                  </el-option>
+                </component>
               </template>
-              <template slot-scope="scope">
-                <el-button
-                  type="text"
+              <template slot="dosageFromName" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
                   :size="$attrs.size"
-                  @click.native.prevent="useRowRemove(tabName, scope)"
+                  :source.sync="scope.row"
+                  :disabled="!(scope.row.medicineMaterial ==='0') "
                 >
-                删除
-                </el-button>
-                <AmendantRecord
-                  v-if=" tabName ==='materialBasic' && addType === 'edit' && scope.row.id"
-                  v-model="scope.row"
-                ></AmendantRecord>
+                </component>
               </template>
-            </el-table-column>
-          </el-super-table>
+              
+  
+              <el-table-column fixed="right" label="操作" width="120" align="center">
+                <template slot="header" slot-scope="scope">
+                  <el-button
+                    type="text"
+                    :size="$attrs.size"
+                    @click="useRowAdd(tabName)"
+                  >
+                    增行
+                  </el-button>
+                </template>
+                <template slot-scope="scope">
+                  <el-button
+                    type="text"
+                    :size="$attrs.size"
+                    @click.native.prevent="useRowRemove(tabName, scope)"
+                  >
+                  删除
+                  </el-button>
+                  <AmendantRecord
+                    v-if=" tabName ==='materialBasic' && addType === 'edit' && scope.row.id"
+                    v-model="scope.row"
+                  ></AmendantRecord>
+                </template>
+              </el-table-column>
+            </el-super-table>
+          </div>
         </el-tab-pane>
       </el-tabs>
 

+ 1 - 1
src/views/material/changeApply/amendantRecord/index.vue

@@ -85,7 +85,7 @@ export default {
       :size="size"
     >
 
-      <div style="padding: 10px;">
+      <div style="padding: 10px;height: 600px;display: flex;">
 
         <el-super-table
           v-model="tableData"

+ 20 - 19
src/views/material/changeApply/index.vue

@@ -45,25 +45,26 @@
         </el-col>
       </el-row>
 
-
-      <el-super-table
-        v-model="tableList"
-        :dict="dict"
-        :columns="TableColumns"
-        :size="size"
-        pagination
-        :page="page"
-        @pagination="useQuery(params, page)"
-        @row-dblclick="useSee"
-      >
-        <el-table-column fixed="right" label="操作" width="150" align="center">
-          <template slot-scope="scope">
-            <el-button type="text" size="small" @click="useSee(scope.row)">查看</el-button>
-            <el-button @click="handleEdit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
-            <el-button type="text" size="small" @click="deleteRow(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3">删除</el-button>
-          </template>
-        </el-table-column>
-      </el-super-table>
+      <div style="height: 600px; display:flex;">
+        <el-super-table
+          v-model="tableList"
+          :dict="dict"
+          :columns="TableColumns"
+          :size="size"
+          pagination
+          :page="page"
+          @pagination="useQuery(params, page)"
+          @row-dblclick="useSee"
+        >
+          <el-table-column fixed="right" label="操作" width="150" align="center">
+            <template slot-scope="scope">
+              <el-button type="text" size="small" @click="useSee(scope.row)">查看</el-button>
+              <el-button @click="handleEdit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
+              <el-button type="text" size="small" @click="deleteRow(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-super-table>
+      </div>
     </div>
 </el-card>
 

+ 3 - 0
src/views/material/changeApply/see/index.vue

@@ -246,6 +246,7 @@ export default {
             :name="item.key"
             lazy
           >
+          <div style="height: 420px;display:flex">
             <el-super-table
               v-model="materialInfo[item.key]"
               :dict="dict"
@@ -274,6 +275,8 @@ export default {
                 </template>
               </el-table-column>
             </el-super-table>
+          </div>
+           
           </el-tab-pane>
         </el-tabs>
      

+ 2 - 2
src/views/material/requisition/add.vue

@@ -18,7 +18,7 @@
     </el-row>
     <el-tabs type="border-card" v-model="tabValue" @tab-click="handleClick">
       <el-tab-pane label="基本信息" name="first">
-        <div style="width: 100%;height: 680px;overflow-y: auto; overflow-x: hidden;">
+        <div style="width: 100%;height: 580px;overflow-y: auto; overflow-x: hidden;">
           <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="170px">
             <el-row :gutter="20">
               <el-col :span="8">
@@ -1658,7 +1658,7 @@
 
 <style lang="scss" scoped>
   .requisition_add {
-    height: calc(100vh - 84px);
+    // height: calc(100vh - 84px);
     padding: 12px;
     box-sizing: border-box;
     overflow-y: auto;

+ 40 - 7
src/views/material/requisition/index.vue

@@ -4,7 +4,7 @@
      
       <el-card>
 
-        <el-super-search
+      <el-super-search
         v-model="params"
         :size="size"
         :dict="dict"
@@ -29,7 +29,7 @@
           <el-button :size="size" @click="handleImport">批量导入</el-button>
         </el-col>
         <el-col :span="1.5">
-          <!-- <el-button :size="size" @click="handleBatchSubmit">批量提交</el-button> -->
+          <el-button :size="size" @click="handleBatchSubmit">批量提交</el-button>
         </el-col>
         <!-- 导入弹窗 -->
         <el-dialog 
@@ -116,7 +116,7 @@
 
 <script>
   import addReq from './add.vue';
-  import {getReqList, delReq, importData, fileImport} from '@/api/requisition/basic';
+  import {getReqList, delReq, importData, fileImport,betchSubmit} from '@/api/requisition/basic';
   import {saveAs} from "file-saver";
   import { blobValidate } from "@/utils/ruoyi";
   import { SearchColumns, TableColumns } from './columns';
@@ -180,12 +180,45 @@
     },
     methods: {
       // 批量提交
-      handleBatchSubmit(){
-        let filterList = this.checkedList.filter(item => (item.status ==='0' ||item.status ==='3') )
+     async handleBatchSubmit(){
+        let filterList = this.checkedList.filter(item => !(item.status == '0' || item.status == '3') )
         
-        console.log(filterList,'filterList');
-        if(filterList.length){  
+        if(!filterList.length &&  this.checkedList.length){  
 
+          try {
+
+            this.failLoad = true;
+            
+            let ids = this.checkedList.map( item => Number(item.id));
+            
+            let {code,msg} = await betchSubmit(ids);
+
+            if(code == 200){
+              this.reset();
+            }
+
+            this.$notify({
+              title: code == 200 ? msg : 'error',
+              type: code == 200 ? 'success' :'error',
+              message: code == 200 ?'' :msg,
+            });
+
+            // if(code == 200){
+            //   this.$notify.success({
+            //     title: msg,
+            //   });
+            // }else{
+            //   this.$notify.error({
+            //     title: '错误',
+            //     message: msg,
+            //   });
+            // }
+
+          } catch (error) {
+            
+          }finally{
+            this.failLoad = false;
+          }
 
         }else{
           this.$notify.warning({

+ 20 - 14
src/views/purchase/apply/add/columns.js

@@ -1,4 +1,5 @@
 import CONFIG from "@/config";
+import { iunitprice } from "@/utils/expression";
 
 export default function useColumns() {
   const TableColumns = [
@@ -117,7 +118,7 @@ export default function useColumns() {
           item: { key: "materialName", title: "物料名称", require: true },
           attr: {
             is: "el-popover-select-v2",
-            multiple: true,
+            checkbox: true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -194,10 +195,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
-              prop.price = ((taxPrice / (tax / 100 + 1)) * 1).toFixed(
-                CONFIG.precision
-              );
-              return prop.price;
+              return (prop.price = iunitprice(tax, taxPrice));
             },
           },
         },
@@ -312,19 +310,25 @@ export default function useColumns() {
         {
           item: { width: 100, key: "priceDiffer", title: "单价差" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              const { taxPrice = 0, recentlyPrice = 0 } = prop;
+              return (prop.priceDiffer = (
+                Number(taxPrice) - Number(recentlyPrice)
+              ));
             },
           },
         },
 
         {
-          item: { width: 100, key: "increase", title: "涨幅" },
+          item: { width: 100, key: "increase", title: "涨幅(%)" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              const { priceDiffer = 0, recentlyPrice = 0 } = prop;
+              return (prop.increase = recentlyPrice
+                ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
+                    2
+                  )
+                : "0.00");
             },
           },
         },
@@ -334,16 +338,18 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
         {
-          item: { width: 100, key: "yAffectedAmount", title: "预计年影响" },
+          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yAffectedAmount = (
+                Number(priceDiffer) * Number(yPurchaseQuantity)
+              ));
             },
           },
         },

+ 10 - 8
src/views/purchase/apply/add/index.vue

@@ -67,10 +67,12 @@ export default {
         currencyCode,
         currencyName,
       } = this.params;
+      const { nickName: createByName } = this.$store.state.user;
       if (selectData.length) {
         this.params[this.tabName].splice(-1);
       }
       for (const item of selectData) {
+        this.loading = true;
         const { tax: taxName, unitName, code: materialCode } = item;
         // task 1
         const { ntaxrate } = await tax(taxName);
@@ -86,6 +88,7 @@ export default {
           isApprovalFirst = "N",
           isPriceAdjustment = "N",
         } = await fetchExist({ puOrg, customer, supplier, materialCode });
+        this.loading = false;
         await this.onRowAdd(this.tabName, {
           ...item,
           currency: currency,
@@ -100,7 +103,10 @@ export default {
           recentlyPrice,
           isApprovalFirst,
           isPriceAdjustment,
-          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate).toFixed(6),
+          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
+          createByName: createByName,
+          updateByName: createByName,
+          id: null,
         });
       }
     },
@@ -220,10 +226,10 @@ export default {
         ref="superForm"
         label-width="auto"
         label-position="right"
-        style="padding: 20px"
+        style="padding: 18px"
       >
       </el-super-form>
-      <el-tabs v-model="tabName" style="padding: 0 20px 20px">
+      <el-tabs v-model="tabName" style="padding: 0 18px 18px">
         <el-tab-pane
           v-for="({ item, TableColumns: columns }, index) in TabColumns"
           :key="index"
@@ -272,8 +278,4 @@ export default {
   </el-button>
 </template>
 
-<style scoped>
-::v-deep .el-table__row.is-hidden {
-  display: none;
-}
-</style>
+<style scoped></style>

+ 18 - 20
src/views/purchase/apply/columns.js

@@ -2,34 +2,34 @@ import CONFIG from "@/config";
 
 export default function useColumns() {
   const TableColumns = [
-    { item: { key: "priceCode", title: "价格编码" ,  width:150 }, attr: {} },
+    { item: { key: "priceCode", title: "价格编码", width: 150 }, attr: {} },
     {
-      item: { key: "status", title: "状态" ,  width:100},
-      attr: { is: "el-dict-tag", dictName: "sys_status",  width:100 },
+      item: { key: "status", title: "状态", width: 100 },
+      attr: { is: "el-dict-tag", dictName: "sys_status", width: 100 },
     },
-    { item: { key: "supplierName", title: "供应商" ,  width:150}, attr: {} },
-    { item: { key: "currencyName", title: "币种" ,  width:100}, attr: {} },
+    { item: { key: "supplierName", title: "供应商", width: 150 }, attr: {} },
+    { item: { key: "currencyName", title: "币种", width: 100 }, attr: {} },
     {
-      item: { key: "explainStr", title: "价格合理性说明" ,  width:100},
+      item: { key: "explainStr", title: "价格合理性说明", width: 100 },
       attr: {},
     },
-    { item: { key: "buyerName", title: "采购员",  width:100 }, attr: {} },
-    { item: { key: "puDeptName", title: "采购部门" ,  width:100}, attr: {} },
+    { item: { key: "buyerName", title: "采购员", width: 100 }, attr: {} },
+    { item: { key: "puDeptName", title: "采购部门", width: 100 }, attr: {} },
     {
-      item: { key: "file", title: "附件", filter: false,  width:100 },
+      item: { key: "file", title: "附件", filter: false, width: 100 },
       attr: { is: "el-file-preview" },
     },
-    { item: { key: "createByName", title: "创建人",  width:100 }, attr: {} },
+    { item: { key: "createByName", title: "创建人", width: 100 }, attr: {} },
     {
-      item: { key: "isEffective", title: "是否已推价格" ,  width:100},
-      attr: { is: "el-dict-tag", dictName: "is_effective" ,  width:100},
+      item: { key: "isEffective", title: "是否已推价格", width: 100 },
+      attr: { is: "el-dict-tag", dictName: "is_effective", width: 100 },
     },
     {
-      item: { key: "effectiveDate", title: "生效日期" ,  width:100},
+      item: { key: "effectiveDate", title: "生效日期", width: 100 },
       attr: {},
     },
     {
-      item: { key: "sourceType", title: "来源单据类型" ,  width:100},
+      item: { key: "sourceType", title: "来源单据类型", width: 100 },
       attr: {},
     },
   ].map(({ item, attr }) => ({
@@ -43,19 +43,17 @@ export default function useColumns() {
     },
   }));
   const SearchColumns = [
-    
-    { 
-      item:{
+    {
+      item: {
         key: "priceCode",
-        title: "价格编码", 
+        title: "价格编码",
       },
       attr: {
-        clearable:true,
+        clearable: true,
         is: "el-input",
       },
     },
     {
-      
       item: { key: "supplierName", title: "供应商" },
       attr: {
         is: "el-popover-select-v2",

+ 75 - 45
src/views/purchase/apply/copy/columns.js

@@ -1,4 +1,5 @@
 import CONFIG from "@/config";
+import { iunitprice } from "@/utils/expression";
 
 export default function useColumns() {
   const TableColumns = [
@@ -117,6 +118,7 @@ export default function useColumns() {
           item: { key: "materialName", title: "物料名称", require: true },
           attr: {
             is: "el-popover-select-v2",
+            checkbox: true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -141,7 +143,7 @@ export default function useColumns() {
         { item: { key: "specification", title: "规格" }, attr: {} },
         { item: { key: "model", title: "型号" }, attr: {} },
         {
-          item: { key: "unitName", title: "单位" },
+          item: { key: "unitName", title: "单位", hidden: false },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "name",
@@ -150,7 +152,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "puUnitName", title: "采购单位" },
+          item: { key: "puUnitName", title: "采购单位", hidden: false },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "name",
@@ -167,6 +169,8 @@ export default function useColumns() {
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
+            value: 1,
+            disabled: true,
           },
         },
         {
@@ -176,6 +180,7 @@ export default function useColumns() {
             valueKey: "ntaxrate",
             referName: "TAX_RATE_PARAM",
             dataMapping: { tax: "ntaxrate" },
+            disabled: true,
           },
         },
         {
@@ -190,10 +195,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
-              prop.price = ((taxPrice / (tax / 100 + 1)) * 1).toFixed(
-                CONFIG.precision
-              );
-              return prop.price;
+              return (prop.price = iunitprice(tax, taxPrice));
             },
           },
         },
@@ -248,12 +250,20 @@ export default function useColumns() {
             },
           },
         },
-        { item: { key: "recentlyPrice", title: "最近价格" }, attr: {} },
+        {
+          item: { key: "recentlyPrice", title: "最近价格" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+            disabled: true,
+          },
+        },
         {
           item: { key: "isApprovalFirst", title: "首次报批" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
+            disabled: true,
           },
         },
         {
@@ -261,6 +271,7 @@ export default function useColumns() {
           attr: {
             is: "el-select",
             dictName: "is_effective",
+            disabled: true,
           },
         },
         {
@@ -279,8 +290,9 @@ export default function useColumns() {
             value: "N",
           },
         },
+
         {
-          item: { width:100,key: "isChannel", title: "是否渠道变更" },
+          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
@@ -288,68 +300,80 @@ export default function useColumns() {
           },
         },
         {
-          item: { width:100,key: "brandReplacement", title: "是否品牌替换" },
+          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
             value: "N",
           },
-        },{
-          item: { width:100,key: "priceDiffer", title: "单价差" },
+        },
+        {
+          item: { width: 100, key: "priceDiffer", title: "单价差" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { taxPrice = 0, recentlyPrice = 0 } = prop;
+              return (prop.priceDiffer = (
+                Number(taxPrice) - Number(recentlyPrice)
+              ));
             },
           },
         },
 
         {
-          item: { width:100,key: "increase", title: "涨幅" },
+          item: { width: 100, key: "increase", title: "涨幅(%)" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { priceDiffer = 0, recentlyPrice = 0 } = prop;
+              return (prop.increase = recentlyPrice
+                ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
+                    2
+                  )
+                : "0.00");
             },
           },
         },
 
         {
-          item: { width:100,key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
         {
-          item: { width:100,key: "yAffectedAmount", title: "预计年影响量" },
+          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yAffectedAmount = (
+                Number(priceDiffer) * Number(yPurchaseQuantity)
+              ));
             },
           },
         },
 
         {
-          item: { width:150,key: "supplierName", title: "供应商名称" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice", title: "中标价" },
+          item: { width: 150, key: "supplierName", title: "供应商名称" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice", title: "中标价" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice", title: "单价" },
+        },
+        {
+          item: { width: 150, key: "unitPrice", title: "单价" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit", title: "利润比" },
+        },
+        {
+          item: { width: 150, key: "profit", title: "利润比" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -357,22 +381,25 @@ export default function useColumns() {
         },
 
         {
-          item: { width:150,key: "supplierName1", title: "供应商名称1" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice1", title: "中标价1" },
+          item: { width: 150, key: "supplierName1", title: "供应商名称1" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice1", title: "中标价1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice1", title: "单价1" },
+        },
+        {
+          item: { width: 150, key: "unitPrice1", title: "单价1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit1", title: "利润比1" },
+        },
+        {
+          item: { width: 150, key: "profit1", title: "利润比1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -380,22 +407,25 @@ export default function useColumns() {
         },
 
         {
-          item: { width:150,key: "supplierName2", title: "供应商名称2" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice2", title: "中标价2" },
+          item: { width: 150, key: "supplierName2", title: "供应商名称2" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice2", title: "中标价2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice2", title: "单价2" },
+        },
+        {
+          item: { width: 150, key: "unitPrice2", title: "单价2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit2", title: "利润比2" },
+        },
+        {
+          item: { width: 150, key: "profit2", title: "利润比2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,

+ 95 - 89
src/views/purchase/apply/copy/index.vue

@@ -18,7 +18,7 @@ const fetchExist = async (prop) => {
 };
 
 export default {
-  name: "AddDrawer",
+  name: "CopyDrawer",
   props: {
     dict: {
       type: Object,
@@ -73,43 +73,58 @@ export default {
   watch: {},
   methods: {
     //
-    changeMaterialName(prop) {
-      const { row } = prop;
-      const { puOrg, customer, supplier } = this.params;
-      const { tax: taxName, unitName, code: materialCode } = row;
-      // task 1
-      tax(taxName).then((res) => {
-        const { ntaxrate } = res;
-        row.tax = ntaxrate === "0E-8" ? "0.000000" : (ntaxrate * 1).toFixed(6);
-      });
-      // task 2
-      unit(unitName).then((res) => {
-        const { id, code, name } = res;
-        row.unit = id;
-        row.unitCode = code;
-        row.unitName = name;
-        row.puUnit = id;
-        row.puUnitCode = code;
-        row.puUnitName = name;
-      });
-      // task 3
-      currency("人民币").then((res) => {
-        const { id, code, name } = res;
-        row.currency = id;
-        row.currencyCode = code;
-        row.currencyName = name;
-      });
-      // task 4
-      fetchExist({ puOrg, customer, supplier, materialCode }).then((res) => {
-        const { recentlyPrice, isApprovalFirst, isPriceAdjustment } = res;
-        row.recentlyPrice = recentlyPrice;
-        if (isApprovalFirst) {
-          row.isApprovalFirst = isApprovalFirst == 0 ? "Y" : "N";
-        }
-        if (isPriceAdjustment) {
-          row.isPriceAdjustment = isPriceAdjustment == 0 ? "Y" : "N";
-        }
-      });
+    async changeMaterialName(prop) {
+      const { selectData } = prop;
+      const {
+        puOrg,
+        customer,
+        supplier,
+        currency,
+        currencyCode,
+        currencyName,
+      } = this.params;
+      const { nickName: createByName } = this.$store.state.user;
+      if (selectData.length) {
+        this.params[this.tabName].splice(-1);
+      }
+      for (const item of selectData) {
+        this.loading = true;
+        const { tax: taxName, unitName, code: materialCode } = item;
+        // task 1
+        const { ntaxrate } = await tax(taxName);
+        // task 2
+        const {
+          id: puUnit,
+          code: puUnitCode,
+          name: puUnitName,
+        } = await unit(unitName);
+        // task 3
+        const {
+          recentlyPrice = "0",
+          isApprovalFirst = "N",
+          isPriceAdjustment = "N",
+        } = await fetchExist({ puOrg, customer, supplier, materialCode });
+        this.loading = false;
+        await this.onRowAdd(this.tabName, {
+          ...item,
+          currency: currency,
+          currencyCode: currencyCode,
+          currencyName: currencyName,
+          unit: puUnit,
+          unitCode: puUnitCode,
+          unitName: puUnitName,
+          puUnit: puUnit,
+          puUnitCode: puUnitCode,
+          puUnitName: puUnitName,
+          recentlyPrice,
+          isApprovalFirst,
+          isPriceAdjustment,
+          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
+          createByName: createByName,
+          updateByName: createByName,
+          id: null,
+        });
+      }
     },
     //
     async fetchItem(prop) {
@@ -127,13 +142,13 @@ export default {
             ...this.$init.params(TableColumns),
             ...item,
           }));
-          return true;
         } else {
-          return false;
+          this.visible = false;
         }
       } catch (err) {
         // catch
         console.error(err);
+        this.visible = false;
       } finally {
         // finally
         this.loading = false;
@@ -141,10 +156,10 @@ export default {
     },
     //
     async onOpen() {
+      this.visible = true;
       const {
         selectData: [{ id }],
       } = this.$props;
-      this.visible = await this.fetchItem(id);
       this.params.id = null;
       this.params.createBy = null;
       this.params.priceCode = null;
@@ -159,6 +174,7 @@ export default {
         updateByName: null,
         delFlag: 0,
       }));
+      await this.fetchItem(id);
     },
     //
     async onHide() {
@@ -167,7 +183,7 @@ export default {
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
     },
     //
-    async onRowAdd(prop) {
+    async onRowAdd(prop, pushParams = {}) {
       const {
         $notify,
         TabColumns,
@@ -185,6 +201,7 @@ export default {
       this.params[prop].push({
         delFlag: "0",
         ...this.$init.params(TableColumns),
+        ...pushParams,
       });
     },
     //
@@ -199,6 +216,7 @@ export default {
         if (valid) {
           try {
             this.loading = true;
+            this.params.priceApplyOrgs = [];
             const { msg, code } = await SAVE(this.params);
             if (code === 200) {
               this.onHide();
@@ -263,20 +281,10 @@ export default {
         ref="superForm"
         label-width="auto"
         label-position="right"
-        style="padding: 20px"
+        style="padding: 18px"
       >
-        <template slot="puOrgName" slot-scope="scope">
-          <component
-            v-bind="scope.attr"
-            v-model="scope.row[scope.item.key]"
-            :size="$attrs.size"
-            :source.sync="scope.row"
-            @change="changePuOrgName({ ...scope, select: $event })"
-          >
-          </component
-        ></template>
       </el-super-form>
-      <el-tabs v-model="tabName" style="padding: 0 20px 20px">
+      <el-tabs v-model="tabName" style="padding: 0 18px 18px">
         <el-tab-pane
           v-for="({ item, TableColumns: columns }, index) in TabColumns"
           :key="index"
@@ -284,47 +292,45 @@ export default {
           :name="item.key"
           lazy
         >
-          <el-super-table
-            v-model="params[item.key]"
-            :dict="dict"
-            :ref="tabName"
-            :columns="columns"
-            :size="$attrs.size"
-          >
-            <template slot="materialName" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                @change="changeMaterialName(scope)"
-              >
-              </component>
-            </template>
-            <el-table-column fixed="right" label="操作" width="100">
-              <template slot="header" slot-scope="scope">
-                <el-button :size="$attrs.size" @click="onRowAdd(tabName)">
-                  新增
-                </el-button>
-              </template>
-              <template slot-scope="scope">
-                <el-button
+          <div v-loading="loading" style="height: 600px; display: flex">
+            <el-super-table
+              v-model="params[item.key]"
+              :dict="dict"
+              :ref="tabName"
+              :columns="columns"
+              :size="$attrs.size"
+            >
+              <template slot="materialName" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
                   :size="$attrs.size"
-                  @click.native.prevent="onRowRemove(tabName, scope)"
+                  :source.sync="scope.row"
+                  @change="changeMaterialName({ ...scope, selectData: $event })"
                 >
-                  删除
-                </el-button>
+                </component>
               </template>
-            </el-table-column>
-          </el-super-table>
+              <el-table-column fixed="right" label="操作" width="100">
+                <template slot="header" slot-scope="scope">
+                  <el-button :size="$attrs.size" @click="onRowAdd(tabName)">
+                    新增
+                  </el-button>
+                </template>
+                <template slot-scope="scope">
+                  <el-button
+                    :size="$attrs.size"
+                    @click.native.prevent="onRowRemove(tabName, scope)"
+                  >
+                    删除
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-super-table>
+          </div>
         </el-tab-pane>
       </el-tabs>
     </el-drawer>
   </el-button>
 </template>
 
-<style scoped>
-::v-deep .el-table__row.is-hidden {
-  display: none;
-}
-</style>
+<style scoped></style>

+ 74 - 46
src/views/purchase/apply/edit/columns.js

@@ -1,4 +1,5 @@
 import CONFIG from "@/config";
+import { iunitprice } from "@/utils/expression";
 
 export default function useColumns() {
   const TableColumns = [
@@ -117,6 +118,7 @@ export default function useColumns() {
           item: { key: "materialName", title: "物料名称", require: true },
           attr: {
             is: "el-popover-select-v2",
+            checkbox: true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -141,7 +143,7 @@ export default function useColumns() {
         { item: { key: "specification", title: "规格" }, attr: {} },
         { item: { key: "model", title: "型号" }, attr: {} },
         {
-          item: { key: "unitName", title: "单位" },
+          item: { key: "unitName", title: "单位", hidden: false },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "name",
@@ -150,7 +152,7 @@ export default function useColumns() {
           },
         },
         {
-          item: { key: "puUnitName", title: "采购单位" },
+          item: { key: "puUnitName", title: "采购单位", hidden: false },
           attr: {
             is: "el-popover-select-v2",
             valueKey: "name",
@@ -167,6 +169,8 @@ export default function useColumns() {
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
+            value: 1,
+            disabled: true,
           },
         },
         {
@@ -176,6 +180,7 @@ export default function useColumns() {
             valueKey: "ntaxrate",
             referName: "TAX_RATE_PARAM",
             dataMapping: { tax: "ntaxrate" },
+            disabled: true,
           },
         },
         {
@@ -190,10 +195,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { tax = 0, taxPrice = 0 } = prop;
-              prop.price = ((taxPrice / (tax / 100 + 1)) * 1).toFixed(
-                CONFIG.precision
-              );
-              return prop.price;
+              return (prop.price = iunitprice(tax, taxPrice));
             },
           },
         },
@@ -248,12 +250,20 @@ export default function useColumns() {
             },
           },
         },
-        { item: { key: "recentlyPrice", title: "最近价格" }, attr: {} },
+        {
+          item: { key: "recentlyPrice", title: "最近价格" },
+          attr: {
+            is: "el-input-number",
+            precision: CONFIG.precision,
+            disabled: true,
+          },
+        },
         {
           item: { key: "isApprovalFirst", title: "首次报批" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
+            disabled: true,
           },
         },
         {
@@ -261,6 +271,7 @@ export default function useColumns() {
           attr: {
             is: "el-select",
             dictName: "is_effective",
+            disabled: true,
           },
         },
         {
@@ -281,7 +292,7 @@ export default function useColumns() {
         },
 
         {
-          item: { width:100,key: "isChannel", title: "是否渠道变更" },
+          item: { width: 100, key: "isChannel", title: "是否渠道变更" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
@@ -289,68 +300,80 @@ export default function useColumns() {
           },
         },
         {
-          item: { width:100,key: "brandReplacement", title: "是否品牌替换" },
+          item: { width: 100, key: "brandReplacement", title: "是否品牌替换" },
           attr: {
             is: "el-select",
             dictName: "is_effective",
             value: "N",
           },
-        },{
-          item: { width:100,key: "priceDiffer", title: "单价差" },
+        },
+        {
+          item: { width: 100, key: "priceDiffer", title: "单价差" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { taxPrice = 0, recentlyPrice = 0 } = prop;
+              return (prop.priceDiffer = (
+                Number(taxPrice) - Number(recentlyPrice)
+              ));
             },
           },
         },
 
         {
-          item: { width:100,key: "increase", title: "涨幅" },
+          item: { width: 100, key: "increase", title: "涨幅(%)" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { priceDiffer = 0, recentlyPrice = 0 } = prop;
+              return (prop.increase = recentlyPrice
+                ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
+                    2
+                  )
+                : "0.00");
             },
           },
         },
 
         {
-          item: { width:100,key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
         {
-          item: { width:100,key: "yAffectedAmount", title: "预计年影响量" },
+          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 :(prop * 1).toFixed(CONFIG.precision);
+              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
+              return (prop.yAffectedAmount = (
+                Number(priceDiffer) * Number(yPurchaseQuantity)
+              ));
             },
           },
         },
 
         {
-          item: { width:150,key: "supplierName", title: "供应商名称" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice", title: "中标价" },
+          item: { width: 150, key: "supplierName", title: "供应商名称" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice", title: "中标价" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice", title: "单价" },
+        },
+        {
+          item: { width: 150, key: "unitPrice", title: "单价" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit", title: "利润比" },
+        },
+        {
+          item: { width: 150, key: "profit", title: "利润比" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -358,22 +381,25 @@ export default function useColumns() {
         },
 
         {
-          item: { width:150,key: "supplierName1", title: "供应商名称1" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice1", title: "中标价1" },
+          item: { width: 150, key: "supplierName1", title: "供应商名称1" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice1", title: "中标价1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice1", title: "单价1" },
+        },
+        {
+          item: { width: 150, key: "unitPrice1", title: "单价1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit1", title: "利润比1" },
+        },
+        {
+          item: { width: 150, key: "profit1", title: "利润比1" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
@@ -381,28 +407,30 @@ export default function useColumns() {
         },
 
         {
-          item: { width:150,key: "supplierName2", title: "供应商名称2" },
-          attr: {is: "el-input"},
-        },{
-          item: { width:150,key: "bidPrice2", title: "中标价2" },
+          item: { width: 150, key: "supplierName2", title: "供应商名称2" },
+          attr: { is: "el-input" },
+        },
+        {
+          item: { width: 150, key: "bidPrice2", title: "中标价2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "unitPrice2", title: "单价2" },
+        },
+        {
+          item: { width: 150, key: "unitPrice2", title: "单价2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
-        },{
-          item: { width:150,key: "profit2", title: "利润比2" },
+        },
+        {
+          item: { width: 150, key: "profit2", title: "利润比2" },
           attr: {
             is: "el-input-number",
             precision: CONFIG.precision,
           },
         },
-
         { item: { key: "createByName", title: "创建人名称" }, attr: {} },
         { item: { key: "updateByName", title: "更新人名称" }, attr: {} },
       ],

+ 88 - 79
src/views/purchase/apply/edit/index.vue

@@ -96,40 +96,58 @@ export default {
   watch: {},
   methods: {
     //
-    changeMaterialName(prop) {
-      console.log(prop, "prop");
-      const { row } = prop;
-      const { puOrg, customer, supplier } = this.params;
-      const { tax: taxName, unitName, code: materialCode } = row;
-      // task 1
-      tax(taxName).then((res) => {
-        const { ntaxrate } = res;
-        row.tax = ntaxrate === "0E-8" ? "0.000000" : (ntaxrate * 1).toFixed(6);
-      });
-      // task 2
-      unit(unitName).then((res) => {
-        const { id, code, name } = res;
-        row.unit = id;
-        row.unitCode = code;
-        row.unitName = name;
-        row.puUnit = id;
-        row.puUnitCode = code;
-        row.puUnitName = name;
-      });
-      // task 3
-      currency("人民币").then((res) => {
-        const { id, code, name } = res;
-        row.currency = id;
-        row.currencyCode = code;
-        row.currencyName = name;
-      });
-      // task 4
-      fetchExist({ puOrg, customer, supplier, materialCode }).then((res) => {
-        const { recentlyPrice, isApprovalFirst, isPriceAdjustment } = res;
-        row.recentlyPrice = recentlyPrice;
-        row.isApprovalFirst = isApprovalFirst;
-        row.isPriceAdjustment = isPriceAdjustment;
-      });
+    async changeMaterialName(prop) {
+      const { selectData } = prop;
+      const {
+        puOrg,
+        customer,
+        supplier,
+        currency,
+        currencyCode,
+        currencyName,
+      } = this.params;
+      const { nickName: createByName } = this.$store.state.user;
+      if (selectData.length) {
+        this.params[this.tabName].splice(-1);
+      }
+      for (const item of selectData) {
+        this.loading = true;
+        const { tax: taxName, unitName, code: materialCode } = item;
+        // task 1
+        const { ntaxrate } = await tax(taxName);
+        // task 2
+        const {
+          id: puUnit,
+          code: puUnitCode,
+          name: puUnitName,
+        } = await unit(unitName);
+        // task 3
+        const {
+          recentlyPrice = "0",
+          isApprovalFirst = "N",
+          isPriceAdjustment = "N",
+        } = await fetchExist({ puOrg, customer, supplier, materialCode });
+        this.loading = false;
+        await this.onRowAdd(this.tabName, {
+          ...item,
+          currency: currency,
+          currencyCode: currencyCode,
+          currencyName: currencyName,
+          unit: puUnit,
+          unitCode: puUnitCode,
+          unitName: puUnitName,
+          puUnit: puUnit,
+          puUnitCode: puUnitCode,
+          puUnitName: puUnitName,
+          recentlyPrice,
+          isApprovalFirst,
+          isPriceAdjustment,
+          tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
+          createByName: createByName,
+          updateByName: createByName,
+          id: null,
+        });
+      }
     },
     //
     async fetchItem(prop) {
@@ -173,7 +191,7 @@ export default {
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
     },
     //
-    async onRowAdd(prop) {
+    async onRowAdd(prop, pushParams = {}) {
       const {
         $notify,
         TabColumns,
@@ -191,6 +209,7 @@ export default {
       this.params[prop].push({
         delFlag: "0",
         ...this.$init.params(TableColumns),
+        ...pushParams,
       });
     },
     //
@@ -277,61 +296,51 @@ export default {
         ref="superForm"
         label-width="auto"
         label-position="right"
-        style="padding: 20px"
+        style="padding: 18px"
       >
-        <template slot="puOrgName" slot-scope="scope">
-          <component
-            v-bind="scope.attr"
-            v-model="scope.row[scope.item.key]"
-            :size="$attrs.size"
-            :source.sync="scope.row"
-            @change="changePuOrgName({ ...scope, select: $event })"
-          >
-          </component
-        ></template>
       </el-super-form>
-      <el-tabs v-model="tabName" style="padding: 0 20px 20px">
+      <el-tabs v-model="tabName" style="padding: 0 18px 18px">
         <el-tab-pane
           v-for="({ item, TableColumns: columns }, index) in TabColumns"
           :key="index"
           :label="item.title"
           :name="item.key"
           lazy
-        >
-          <el-super-table
-            v-model="priceApply[item.key]"
-            :dict="dict"
-            :ref="tabName"
-            :columns="columns"
-            :size="$attrs.size"
-            style="padding: 20px 10px;height: 400px;"
-          >
-            <template slot="materialName" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                @change="changeMaterialName(scope)"
-              >
-              </component>
-            </template>
-            <el-table-column fixed="right" label="操作" width="100">
-              <template slot="header" slot-scope="scope">
-                <el-button :size="$attrs.size" @click="onRowAdd(tabName)">
-                  新增
-                </el-button>
-              </template>
-              <template slot-scope="scope">
-                <el-button
+          ><div v-loading="loading" style="height: 600px; display: flex">
+            <el-super-table
+              v-model="priceApply[item.key]"
+              :dict="dict"
+              :ref="tabName"
+              :columns="columns"
+              :size="$attrs.size"
+            >
+              <template slot="materialName" slot-scope="scope">
+                <component
+                  v-bind="scope.attr"
+                  v-model="scope.row[scope.item.key]"
                   :size="$attrs.size"
-                  @click.native.prevent="onRowRemove(tabName, scope)"
+                  :source.sync="scope.row"
+                  @change="changeMaterialName({ ...scope, selectData: $event })"
                 >
-                  删除
-                </el-button>
+                </component>
               </template>
-            </el-table-column>
-          </el-super-table>
+              <el-table-column fixed="right" label="操作" width="100">
+                <template slot="header" slot-scope="scope">
+                  <el-button :size="$attrs.size" @click="onRowAdd(tabName)">
+                    新增
+                  </el-button>
+                </template>
+                <template slot-scope="scope">
+                  <el-button
+                    :size="$attrs.size"
+                    @click.native.prevent="onRowRemove(tabName, scope)"
+                  >
+                    删除
+                  </el-button>
+                </template>
+              </el-table-column>
+            </el-super-table>
+          </div>
         </el-tab-pane>
       </el-tabs>
     </el-drawer>

+ 6 - 1
src/views/purchase/apply/index.vue

@@ -103,7 +103,11 @@ export default {
     ></el-super-search>
     <el-row class="my-4" style="text-align: right">
       <el-button-group>
-        <add-button :size="size" :dict="dict" @success="useQuery(params, page)"></add-button>
+        <add-button
+          :size="size"
+          :dict="dict"
+          @success="useQuery(params, page)"
+        ></add-button>
         <copy-button
           :size="size"
           :dict="dict"
@@ -152,6 +156,7 @@ export default {
       checkbox
       pagination
       convenitentOperation
+      storage-key="PuchaseApplySuperTable1"
       @row-dblclick="useSee"
       @row-select="useSelect"
       @pagination="useQuery(params, page)"

+ 17 - 17
src/views/purchase/apply/see/columns.js

@@ -100,7 +100,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -109,7 +109,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -118,7 +118,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -127,7 +127,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -199,7 +199,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -209,7 +209,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -219,7 +219,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -228,7 +228,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -242,7 +242,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -251,7 +251,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -260,7 +260,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -274,7 +274,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -283,7 +283,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -292,7 +292,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -306,7 +306,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -315,7 +315,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },
@@ -324,7 +324,7 @@ export default function useColumns() {
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1).toFixed(CONFIG.precision);
+              return prop == null ? 0 : (prop * 1);
             },
           },
         },

+ 60 - 40
src/views/purchase/catalogue/columns.js

@@ -3,67 +3,79 @@ import CONFIG from "@/config";
 export default function useColumns() {
   const TableColumns = [
     {
-      item: { width:100,key: "puOrgName", title: "采购组织" },
+      item: { width: 100, key: "puOrgName", title: "采购组织" },
       attr: {},
     },
-    { item: { width:150,key: "materialName", title: "物料" }, attr: {} },
-    { item: { width:150,key: "materialCode", title: "物料编码" }, attr: {} },
-    { item: { width:100,key: "materialClassifyName", title: "物料一级分类" }, attr: {} },
-    { item: { width:100,key: "manufacturerName", title: "生产厂家名称" }, attr: {} },
-    { item: { width:100,key: "model", title: "物料型号" }, attr: {} },
-    { item: { width:100,key: "specification", title: "物料规格" }, attr: {} },
+    { item: { width: 150, key: "materialName", title: "物料" }, attr: {} },
+    { item: { width: 150, key: "materialCode", title: "物料编码" }, attr: {} },
     {
-      item: { width:100,key: "supplierName", title: "供应商名称" },
+      item: { width: 100, key: "materialClassifyName", title: "物料一级分类" },
       attr: {},
     },
-    { item: { width:100,key: "customerName", title: "客户" }, attr: {} },
     {
-      item: { width:100,key: "taxPrice", title: "主含税单价" },
+      item: { width: 100, key: "manufacturerName", title: "生产厂家名称" },
+      attr: {},
+    },
+    { item: { width: 100, key: "model", title: "物料型号" }, attr: {} },
+    { item: { width: 100, key: "specification", title: "物料规格" }, attr: {} },
+    {
+      item: { width: 100, key: "supplierName", title: "供应商名称" },
+      attr: {},
+    },
+    { item: { width: 100, key: "customerName", title: "客户" }, attr: {} },
+    {
+      item: { width: 100, key: "taxPrice", title: "主含税单价" },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { taxPrice = 0 } = prop;
+          return taxPrice * 1;
         },
       },
     },
-    { item: { width:100,key: "unitName", title: "主单位" }, attr: {} },
-    { item: { width:100,key: "effectiveDate", title: "价格生效日期" }, attr: {} },
-    { item: { width:100,key: "endDate", title: "价格失效日期" }, attr: {} },
-    { item: { width:100,key: "buyerName", title: "采购员" }, attr: {} },
-    { item: { width:100,key: "applyCode", title: "来源单据" }, attr: {} },
+    { item: { width: 100, key: "unitName", title: "主单位" }, attr: {} },
+    {
+      item: { width: 100, key: "effectiveDate", title: "价格生效日期" },
+      attr: {},
+    },
+    { item: { width: 100, key: "endDate", title: "价格失效日期" }, attr: {} },
+    { item: { width: 100, key: "buyerName", title: "采购员" }, attr: {} },
+    { item: { width: 100, key: "applyCode", title: "来源单据" }, attr: {} },
     {
-      item: { width:100,key: "convertRate", title: "换算率" },
+      item: { width: 100, key: "convertRate", title: "换算率" },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { convertRate = 0 } = prop;
+          return convertRate * 1;
         },
       },
     },
     {
-      item: { width:100,key: "status", title: "有效状态" },
+      item: { width: 100, key: "status", title: "有效状态" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { width:100,key: "enableStatus", title: "启用状态" },
+      item: { width: 100, key: "enableStatus", title: "启用状态" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { width:100,key: "materialStatus", title: "物料启用状态" },
+      item: { width: 100, key: "materialStatus", title: "物料启用状态" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { width:100,key: "isDistribution", title: "配送价" },
+      item: { width: 100, key: "isDistribution", title: "配送价" },
       attr: { is: "el-dict-tag", dictName: "is_effective" },
     },
     {
-      item: { width:100,key: "priceType", title: "价格类型" },
+      item: { width: 100, key: "priceType", title: "价格类型" },
       attr: { is: "el-dict-tag", dictName: "sys_price_type" },
     },
-    { item: { width:100,key: "expiryEarly", title: "效期预警" }, attr: {} },
-    { item: { width:100,key: "priority", title: "含税/无税优先" }, attr: {} },
-    { item: { width:100,key: "createByName", title: "创建人" }, attr: {} },
-    { item: { width:100,key: "updateByName", title: "更新人名称" }, attr: {} },
+    { item: { width: 100, key: "expiryEarly", title: "效期预警" }, attr: {} },
+    { item: { width: 100, key: "priority", title: "含税/无税优先" }, attr: {} },
+    { item: { width: 100, key: "createByName", title: "创建人" }, attr: {} },
+    {
+      item: { width: 100, key: "updateByName", title: "更新人名称" },
+      attr: {},
+    },
   ].map(({ item, attr }) => ({
     attr,
     item: {
@@ -77,11 +89,11 @@ export default function useColumns() {
 
   const SearchColumns = [
     {
-      item: { width:100,key: "puOrgName", title: "采购组织" },
+      item: { width: 100, key: "puOrgName", title: "采购组织" },
       attr: {
         is: "el-popover-select-v2",
         referName: "ORG_PARAM",
-        valuewidth:100,key: "name",
+        valueKey: "name",
         dataMapping: {
           puOrg: "id",
           puOrgName: "name",
@@ -89,15 +101,23 @@ export default function useColumns() {
       },
     },
     {
-      item: { width:100,key: "manufacturer", title: "生产厂家" },
-      attr: { is: "el-input" },
+      item: { width: 100, key: "manufacturerName", title: "生成厂家" },
+      attr: {
+        is: "el-popover-select-v2",
+        referName: "MANUFACTURER_PARAM",
+        valueKey: "name",
+        dataMapping: {
+          manufacturer: "id",
+          manufacturerName: "name",
+        },
+      },
     },
     {
-      item: { width:100,key: "supplierName", title: "供应商" },
+      item: { width: 100, key: "supplierName", title: "供应商" },
       attr: {
         is: "el-popover-select-v2",
         referName: "SUPPLIER_PARAM",
-        valuewidth:100,key: "name",
+        valueKey: "name",
         dataMapping: {
           supplier: "id",
           supplierName: "name",
@@ -105,15 +125,15 @@ export default function useColumns() {
       },
     },
     {
-      item: { width:100,key: "applyCode", title: "来源单据" },
+      item: { width: 100, key: "applyCode", title: "来源单据" },
       attr: { is: "el-input" },
     },
     {
-      item: { width:100,key: "materialCode", title: "物料编码" },
+      item: { width: 100, key: "materialCode", title: "物料编码" },
       attr: {
         is: "el-popover-select-v2",
         referName: "MATERIAL_PARAM",
-        valuewidth:100,key: "code",
+        valueKey: "code",
         dataMapping: {
           material: "id",
           materialCode: "code",
@@ -121,11 +141,11 @@ export default function useColumns() {
       },
     },
     {
-      item: { width:100,key: "status", title: "有效状态" },
+      item: { width: 100, key: "status", title: "有效状态" },
       attr: { is: "el-select", dictName: "is_effective" },
     },
     {
-      item: { width:100,key: "enableStatus", title: "启用状态" },
+      item: { width: 100, key: "enableStatus", title: "启用状态" },
       attr: { is: "el-select", dictName: "is_effective" },
     },
   ];

+ 7 - 13
src/views/purchase/catalogue/export/index.vue

@@ -2,12 +2,8 @@
 export default {
   name: "ExportDialog",
   props: {
-    data: {
-      type: Object,
-      require: true,
-    },
-    page: {
-      type: Object,
+    selectData: {
+      type: Array,
       require: true,
     },
   },
@@ -29,14 +25,12 @@ export default {
             instance.confirmButtonText = "下载中...";
             try {
               // try
-              const {
-                data,
-                page: { pageNum, pageSize },
-              } = this.$props;
+              const { selectData } = this.$props;
+              const ids = selectData.map((item) => item.id);
               await this.download(
-                "pu/price/catalogue/export",
-                { ...data, pageNum, pageSize },
-                `catalogue_${new Date().getTime()}.xlsx`
+                "/pu/price/catalogue/exportByIds",
+                { ids: ids },
+                `价格目录_${new Date().getTime()}.xlsx`
               );
               await done();
             } catch (err) {

+ 2 - 2
src/views/purchase/catalogue/index.vue

@@ -132,8 +132,7 @@ export default {
       <el-button-group>
         <exp-button
           :size="size"
-          :page="page"
-          :data="params"
+          :select-data="selectData"
           @success="useQuery(params, page)"
         ></exp-button>
       </el-button-group>
@@ -148,6 +147,7 @@ export default {
       checkbox
       pagination
       convenitentOperation
+      storage-key="PuchaseCatalogueSuperTable1"
       @row-dblclick="useSee"
       @selection-change="useSelect"
       @pagination="useQuery(params, page)"

+ 2 - 2
src/views/purchase/catalogue/see/columns.js

@@ -22,7 +22,7 @@ export default function useColumns() {
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          return (prop * 1);
         },
       },
     },
@@ -36,7 +36,7 @@ export default function useColumns() {
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          return (prop * 1);
         },
       },
     },

+ 2 - 2
src/views/purchase/contract/add/columns.js

@@ -414,7 +414,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { qty = 0, taxPrice = 0 } = prop;
-              prop.taxMoney = (qty * taxPrice * 1).toFixed(CONFIG.precision);
+              prop.taxMoney = (qty * taxPrice * 1);
               return prop.taxMoney;
             },
           },
@@ -440,7 +440,7 @@ export default function useColumns() {
                 qty *
                 (taxPrice / (tax / 100 + 1)) *
                 1
-              ).toFixed(CONFIG.precision);
+              );
               return prop.taxFreeMoney;
             },
           },

+ 93 - 66
src/views/purchase/contract/columns.js

@@ -2,240 +2,266 @@ import CONFIG from "@/config";
 
 export default function useColumns() {
   const TableColumns = [
-    { item: { width:100,key: "puOrgName", title: "采购组织" }, attr: {} },
-    { item: { width:100,key: "code", title: "合同编码" }, attr: {} },
+    { item: { width: 100, key: "puOrgName", title: "采购组织" }, attr: {} },
+    { item: { width: 100, key: "code", title: "合同编码" }, attr: {} },
     {
-      item: { width:100,key: "status", title: "状态" },
+      item: { width: 100, key: "status", title: "状态" },
       attr: { is: "el-dict-tag", dictName: "documents_status" },
     },
     {
-      item: { width:100,key: "lastPuMoney", title: "上年度采购额" },
+      item: { width: 100, key: "lastPuMoney", title: "上年度采购额" },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { lastPuMoney = 0 } = prop;
+          return (lastPuMoney * 1);
         },
       },
     },
-    { item: { width:100,key: "buyerName", title: "采购员" }, attr: {} },
-    { item: { width:100,key: "supplierName", title: "供应商" }, attr: {} },
+    { item: { width: 100, key: "buyerName", title: "采购员" }, attr: {} },
+    { item: { width: 100, key: "supplierName", title: "供应商" }, attr: {} },
     {
-      item: { width:100,key: "contractType", title: "合同类型" },
+      item: { width: 100, key: "contractType", title: "合同类型" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_contract_type",
       },
     },
     {
-      item: { width:100,key: "puMoneyYear", title: "本年度采购额" },
+      item: { width: 100, key: "puMoneyYear", title: "本年度采购额" },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { puMoneyYear = 0 } = prop;
+          return (puMoneyYear * 1);
         },
       },
     },
-    { item: { width:100,key: "puDeptName", title: "采购部门" }, attr: {} },
+    { item: { width: 100, key: "puDeptName", title: "采购部门" }, attr: {} },
     {
-      item: { width:100,key: "supplierTier", title: "供应商层级" },
+      item: { width: 100, key: "supplierTier", title: "供应商层级" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_supplier_tier",
       },
     },
     {
-      item: { width:100,key: "contractName", title: "合同名称" },
+      item: { width: 100, key: "contractName", title: "合同名称" },
       attr: {},
     },
     {
-      item: { width:100,key: "grossRateAverage", title: "平均毛利率 (%)" },
+      item: { width: 100, key: "grossRateAverage", title: "平均毛利率 (%)" },
       attr: {
         is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { grossRateAverage = 0 } = prop;
+          return (grossRateAverage * 1).toFixed(2);
         },
       },
     },
     {
-      item: { width:100,key: "approveFlow", title: "审批流程" },
+      item: { width: 100, key: "approveFlow", title: "审批流程" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_approve_flow",
       },
     },
     {
-      item: { width:100,key: "consumableClass", title: "耗材类别" },
+      item: { width: 100, key: "consumableClass", title: "耗材类别" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_consumable_class",
       },
     },
     {
-      item: { width:100,key: "effectiveDate", title: "合同生效日期" },
+      item: { width: 100, key: "effectiveDate", title: "合同生效日期" },
       attr: {},
     },
     {
-      item: { width:100,key: "brandGrossRate", title: "同类品牌及毛利率 (%)" },
+      item: {
+        width: 100,
+        key: "brandGrossRate",
+        title: "同类品牌及毛利率 (%)",
+      },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { brandGrossRate = 2 } = prop;
+          return (brandGrossRate * 1).toFixed(2);
         },
       },
     },
     {
-      item: { width:100,key: "contractFormat", title: "合同格式" },
+      item: { width: 100, key: "contractFormat", title: "合同格式" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_contract_format",
       },
     },
     {
-      item: { width:100,key: "productName", title: "产品类别&名称" },
+      item: { width: 100, key: "productName", title: "产品类别&名称" },
       attr: {},
     },
-    { item: { width:100,key: "endDate", title: "合同终止日期" }, attr: {} },
+    { item: { width: 100, key: "endDate", title: "合同终止日期" }, attr: {} },
     {
-      item: { width:100,key: "invoiceTax", title: "发票税率 (%)" },
+      item: { width: 100, key: "invoiceTax", title: "发票税率 (%)" },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return (prop * 1).toFixed(CONFIG.precision);
+          const { invoiceTax } = prop;
+          return (invoiceTax * 1).toFixed(2);
         },
       },
     },
     {
-      item: { width:100,key: "emergencyDegree", title: "紧急程度" },
+      item: { width: 100, key: "emergencyDegree", title: "紧急程度" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_emergency_degree",
       },
     },
-    { item: { width:100,key: "project", title: "项目医院" }, attr: {} },
+    { item: { width: 100, key: "project", title: "项目医院" }, attr: {} },
     {
-      item: { width:100,key: "deliveryType", title: "交货方式" },
+      item: { width: 100, key: "deliveryType", title: "交货方式" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_delivery_type",
       },
     },
-    { item: { width:100,key: "source", title: "合同来源" }, attr: {} },
+    { item: { width: 100, key: "source", title: "合同来源" }, attr: {} },
     {
-      item: { width:100,key: "contractPartycName", title: "合同丙方" },
+      item: { width: 100, key: "contractPartycName", title: "合同丙方" },
       attr: {},
     },
     {
-      item: { width:100,key: "guaranteePeriodEnd", title: "质保期限" },
+      item: { width: 100, key: "guaranteePeriodEnd", title: "质保期限" },
       attr: {},
     },
     {
-      item: { width:100,key: "freightMethods", title: "运费承担方式" },
+      item: { width: 100, key: "freightMethods", title: "运费承担方式" },
       attr: {
         is: "el-dict-tag",
         dictName: "puarchase_contract_freight_methods",
       },
     },
     {
-      item: { width:100,key: "signDate", title: "合同创建时间" },
+      item: { width: 100, key: "signDate", title: "合同创建时间" },
       attr: {},
     },
     {
-      item: { width:100,key: "isTarget", title: "是否有指标" },
+      item: { width: 100, key: "isTarget", title: "是否有指标" },
       attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
     },
     {
-      item: { width:100,key: "contractTarget", title: "合同指标" },
+      item: { width: 100, key: "contractTarget", title: "合同指标" },
       attr: {},
     },
     {
-      item: { width:100,key: "exemptionPostageCondtion", title: "包邮条件" },
+      item: { width: 100, key: "exemptionPostageCondtion", title: "包邮条件" },
       attr: {},
     },
     {
-      item: { width:100,key: "isRebate", title: "是否有返利" },
+      item: { width: 100, key: "isRebate", title: "是否有返利" },
       attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
     },
     {
-      item: { width:100,key: "rebatePolicy", title: "返利政策" },
+      item: { width: 100, key: "rebatePolicy", title: "返利政策" },
       attr: {},
     },
     {
-      item: { width:100,key: "externalContract", title: "外部合同号" },
+      item: { width: 100, key: "externalContract", title: "外部合同号" },
       attr: {},
     },
     {
-      item: { width:100,key: "rollbackPolicy", title: "退换货政策" },
+      item: { width: 100, key: "rollbackPolicy", title: "退换货政策" },
       attr: {},
     },
-    { item: { width:100,key: "enquiryCode", title: "询价单号" }, attr: {} },
+    { item: { width: 100, key: "enquiryCode", title: "询价单号" }, attr: {} },
     {
-      item: { width:100,key: "contractContent", title: "合同主要内容" },
+      item: { width: 100, key: "contractContent", title: "合同主要内容" },
       attr: {},
     },
     {
-      item: { width:100,key: "refusalReasons", title: "拒绝理由" },
+      item: { width: 100, key: "refusalReasons", title: "拒绝理由" },
       attr: {},
     },
     {
-      item: { width:100,key: "pigeonhole", title: "是否归档" },
+      item: { width: 100, key: "pigeonhole", title: "是否归档" },
       attr: { is: "el-dict-tag", dictName: "sys_yes_no" },
     },
     {
-      item: { width:100,key: "pigeonholeFile", title: "归档附件" },
+      item: {
+        width: 100,
+        key: "pigeonholeFile",
+        title: "归档附件",
+        filterabled: false,
+      },
       attr: { is: "el-file-preview" },
     },
     {
-      item: { width:100,key: "externalFile", title: "对外附件" },
+      item: {
+        width: 100,
+        key: "externalFile",
+        title: "对外附件",
+        filterabled: false,
+      },
       attr: { is: "el-file-preview" },
     },
     {
-      item: { width:100,key: "puFile", title: "采购商盖章合同附件" },
+      item: {
+        width: 100,
+        key: "puFile",
+        title: "采购商盖章合同附件",
+        filterabled: false,
+      },
       attr: { is: "el-file-preview" },
     },
     {
-      item: { width:100,key: "supplierFile", title: "供应商盖章合同附件" },
+      item: {
+        width: 100,
+        key: "supplierFile",
+        title: "供应商盖章合同附件",
+        filterabled: false,
+      },
       attr: { is: "el-file-preview" },
     },
-    { item: { width:100,key: "projectCode", title: "项目编号" }, attr: {} },
-    { item: { width:100,key: "projectName", title: "项目名称" }, attr: {} },
-    { item: { width:100,key: "area", title: "区域" }, attr: {} },
+    { item: { width: 100, key: "projectCode", title: "项目编号" }, attr: {} },
+    { item: { width: 100, key: "projectName", title: "项目名称" }, attr: {} },
+    { item: { width: 100, key: "area", title: "区域" }, attr: {} },
     {
-      item: { width:100,key: "consigneePhone", title: "收货人联系方式" },
+      item: { width: 100, key: "consigneePhone", title: "收货人联系方式" },
       attr: {},
     },
     {
-      item: { width:100,key: "paymentAgreement", title: "付款协议" },
+      item: { width: 100, key: "paymentAgreement", title: "付款协议" },
       attr: {},
     },
     {
-      item: { width:100,key: "taxPrice", title: "价税合计" },
+      item: { width: 100, key: "taxPrice", title: "价税合计" },
       attr: {
-        is: "el-computed-input-v2",
         formatter: (prop) => {
-          return prop ? (prop * 1).toFixed(CONFIG.precision) : "0.000000";
+          const { taxPrice = 0 } = prop;
+          return (taxPrice * 1);
         },
       },
     },
-    { item: { width:100,key: "currencyName", title: "币种" }, attr: {} },
+    { item: { width: 100, key: "currencyName", title: "币种" }, attr: {} },
     {
-      item: { width:100,key: "guaranteePeriod", title: "质保期" },
+      item: { width: 100, key: "guaranteePeriod", title: "质保期" },
       attr: {},
     },
   ].map(({ item, attr }) => ({
     attr,
     item: {
-      ...item,
       sortabled: true,
       fixedabled: true,
       filterabled: true,
       hiddenabled: true,
+      ...item,
     },
   }));
 
   const SearchColumns = [
     {
       item: {
-        width:100,key: "contractName",
+        width: 100,
+        key: "contractName",
         title: "合同名称",
       },
       attr: {
@@ -243,7 +269,7 @@ export default function useColumns() {
       },
     },
     {
-      item: { width:100,key: "status", title: "状态" },
+      item: { width: 100, key: "status", title: "状态" },
       attr: {
         is: "el-select",
         dictName: "documents_status",
@@ -251,7 +277,8 @@ export default function useColumns() {
     },
     {
       item: {
-        width:100,key: "pigeonhole",
+        width: 100,
+        key: "pigeonhole",
         title: "是否归档",
       },
       attr: {

+ 2 - 2
src/views/purchase/contract/edit/columns.js

@@ -413,7 +413,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { qty = 0, taxPrice = 0 } = prop;
-              prop.taxMoney = (qty * taxPrice * 1).toFixed(CONFIG.precision);
+              prop.taxMoney = (qty * taxPrice * 1);
               return prop.taxMoney;
             },
           },
@@ -439,7 +439,7 @@ export default function useColumns() {
                 qty *
                 (taxPrice / (tax / 100 + 1)) *
                 1
-              ).toFixed(CONFIG.precision);
+              );
               return prop.taxFreeMoney;
             },
           },

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

@@ -38,7 +38,7 @@ export default {
               await this.download(
                 "pu/contract/export",
                 { ...data, pageNum, pageSize },
-                `contract_${new Date().getTime()}.xlsx`
+                `采购合同_${new Date().getTime()}.xlsx`
               );
               await done();
             } catch (err) {

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

@@ -182,6 +182,7 @@ export default {
       checkbox
       pagination
       convenitentOperation
+      storage-key="PuchaseContractSuperTable1"
       @row-dblclick="useSee"
       @selection-change="useSelect"
       @pagination="useQuery(params, page)"

+ 2 - 2
src/views/purchase/contract/see/columns.js

@@ -411,7 +411,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { qty = 0, taxPrice = 0 } = prop;
-              prop.taxMoney = (qty * taxPrice * 1).toFixed(CONFIG.precision);
+              prop.taxMoney = (qty * taxPrice * 1);
               return prop.taxMoney;
             },
           },
@@ -437,7 +437,7 @@ export default function useColumns() {
                 qty *
                 (taxPrice / (tax / 100 + 1)) *
                 1
-              ).toFixed(CONFIG.precision);
+              );
               return prop.taxFreeMoney;
             },
           },

+ 3 - 3
src/views/purchase/task/xie-yi-zhi-cai/column.js

@@ -44,7 +44,7 @@ export const TableColumns = [
     attr: {
       is: "el-computed-input-v2",
       formatter: (prop) => {
-        return (prop * 1).toFixed(CONFIG.precision);
+        return (prop * 1);
       },
     },
   },
@@ -53,7 +53,7 @@ export const TableColumns = [
     attr: {
       is: "el-computed-input-v2",
       formatter: (prop) => {
-        return (prop * 1).toFixed(CONFIG.precision);
+        return (prop * 1);
       },
     },
   },
@@ -62,7 +62,7 @@ export const TableColumns = [
     attr: {
       is: "el-computed-input-v2",
       formatter: (prop) => {
-        return (prop * 1).toFixed(CONFIG.precision);
+        return (prop * 1);
       },
     },
   },