Преглед изворни кода

Merge remote-tracking branch 'origin/purchaseDev' into purchaseDev

002637 пре 1 година
родитељ
комит
07667d8670

+ 12 - 3
src/api/business/purchase/apply.js

@@ -9,9 +9,9 @@ export function LIST(data, params) {
   });
 }
 
-export function ITEM(data) {
+export function ITEM(data, isCopy) {
   return request({
-    url: `/pu/priceApply/${data}`,
+    url: `/pu/priceApply/${data}/${isCopy}`,
     method: "GET",
   });
 }
@@ -42,7 +42,16 @@ export function REMOVE(data) {
 // 模板下载
 export function mbDownload(data) {
   return request({
-    url: `/pu/demand/download`,
+    url: `/pu/priceApply/download`,
+    method: 'post',
+    data: data,
+    responseType: 'blob'
+  })
+}
+// 导入失败文件下载
+export function failDownload(data) {
+  return request({
+    url: `/pu/priceApply/downloadFailData`,
     method: 'post',
     data: data,
     responseType: 'blob'

+ 9 - 0
src/api/system/role.js

@@ -117,3 +117,12 @@ export function deptTreeSelect(roleId) {
     method: 'get'
   })
 }
+
+// 角色列表
+export function listOptionselect(query) {
+  return request({
+    url: '/system/role/optionselect',
+    method: 'get',
+    params: query
+  })
+}

+ 144 - 0
src/components/BatchImport/index.vue

@@ -0,0 +1,144 @@
+
+
+<script>
+export default {
+  name:'BatchImport',
+  props:{
+    disabled:{
+      type:Boolean,
+      default:false,
+    },
+    limit:{
+      type:Number,
+      default:1,
+    },
+    fileType:{
+      type:Array,
+      default:()=>['xls', 'xlsx'],
+    },
+    size:{
+      type:String,
+      default:'mini',
+    },
+    isShowTip:{
+      type:Boolean,
+      default:true,
+    },
+    isTemplate:{
+      type:Boolean,
+      default:true,
+    },
+    fileSize: {
+      type: Number,
+      default: 100,
+    },
+  },
+  computed:{
+    tips:{
+      get(){
+        // this.accept.
+      },
+      set(){},
+    },
+     // 是否显示提示
+     showTip() {
+      return this.isShowTip && (this.fileType || this.fileSize);
+    },
+  },
+  data(){
+    return {
+      title:'批量导入',
+      visible:false,
+      loading:false,
+      fileList:[],
+
+    }
+  },
+  methods:{
+    // 确认上传
+    async submitUpload(){
+
+    },
+    // 模板下载
+    async templateDownload(){
+      // 放父组件
+      // this.download('/system/material/download', {}, `物料基本信息模板.xlsx`);
+    },
+    // 
+    beforeClose(done){
+      // 关闭前清空
+      done();
+    },
+    // 预览
+    handlePreview(){},
+    // 移除
+    handleRemove(file, fileList){
+      this.fileList = fileList;
+    },
+    // 文件改变
+    onChange(file, fileList){
+      this.fileList = fileList;
+    },
+    // 取消
+    cancal(){
+      this.visible = false;
+    },
+    
+  },
+  created(){},
+}
+</script>
+
+<template>
+  <el-button :disabled="disabled">
+    {{ title }}
+    <el-dialog 
+      :title="title" 
+      :visible.sync="visible"
+      v-loading="loading"
+      width="35%" 
+      center
+      :before-close="beforeClose"
+    >
+      <el-upload
+        ref="upload"
+        :accept="accept"
+        action="#"
+        :on-preview="handlePreview"
+        :on-remove="handleRemove"
+        :file-list="fileList"
+        :auto-upload="false"
+        :on-change="onChange" 
+        :limit="limit"
+        append-to-body
+      >
+        <el-button 
+          slot="trigger" 
+          :size="size" 
+          type="primary"
+        >选取文件</el-button>
+        <el-button 
+          v-if="isTemplate"
+          style="margin-left: 10px;" 
+          :size="size" 
+          type="success" 
+          @click="templateDownload"
+        >下载模板</el-button>
+        <div slot="tip" class="el-upload__tip" v-if="isShowTip">
+          请上传
+          <template v-if="fileSize">
+            大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b>
+          </template>
+          <template v-if="fileType">
+            格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b>
+          </template>
+        </div>
+      </el-upload>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancal">取 消</el-button>
+        <el-button type="primary" @click="submitUpload">确 定</el-button>
+      </div>
+    </el-dialog>
+  </el-button>
+</template>

+ 12 - 12
src/components/popover-select/components/MATERIAL_PARAM.js

@@ -43,18 +43,18 @@ export default [
       },
     },
   },
-  {
-    item: {
-      key: "oriRegistrationNo",
-      title: "注册证号/备案凭证编号",
-      width: "auto",
-    },
-    attr: {
-      formatter: (prop) => {
-        return prop.materialMedcine.oriRegistrationNo;
-      },
-    },
-  },
+  // {
+  //   item: {
+  //     key: "oriRegistrationNo",
+  //     title: "注册证号/备案凭证编号",
+  //     width: "auto",
+  //   },
+  //   attr: {
+  //     formatter: (prop) => {
+  //       return prop.materialMedcine.oriRegistrationNo;
+  //     },
+  //   },
+  // },
   {
     item: { key: "dosageFrom", title: "剂型", width: "auto" },
     attr: {

+ 3 - 1
src/views/business/spd/task_management/visitingPlan/add.vue → src/views/business/spd/bo/plan/add.vue

@@ -168,7 +168,7 @@
           <el-table-column show-overflow-tooltip label="联系人" prop="contactName" min-width="230" :render-header="addRedStar">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'mkBoPlanItemList.' + scope.$index + '.' + 'contactName'" :rules="{ required: true, message: '请选择联系人', trigger: 'blur' }">
-                <el-select clearable size="mini" v-model="scope.row.contactName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'LINKMAN_PARAM', true, '请选择联系人', {customer: scope.row.customer, charger: basicForm.charger})" style="width: 200px">
+                <el-select clearable size="mini" v-model="scope.row.contactName" :disabled="sonDisable" @focus="chooseSon(scope.$index, 'LINKMAN_PARAM', true, '请选择联系人', {customer: scope.row.customer})" style="width: 200px">
                   <el-option v-for="item in linkOptions" :key="item.id" :label="item.name" :value="item.code" />
                 </el-select>
               </el-form-item>
@@ -508,9 +508,11 @@ export default {
       console.log('删除的数组',this.delPlanItemList)
     },
     edit() {
+      this.getDetails(this.row)
       this.isFlag = true;
       this.sonPageStu = 'edit'
       this.sonDisable = false
+      //调整日期格式
       this.basicForm.startDate = this.basicForm.startDate + ' 00:00:00'
       this.basicForm.deadlineTime = this.basicForm.deadlineTime + ' 00:00:00'
       this.basicForm.mkBoPlanItemList.forEach(item => {

+ 0 - 0
src/views/business/spd/task_management/visitingPlan/index.vue → src/views/business/spd/bo/plan/index.vue


+ 1 - 0
src/views/business/spd/bo/task/taskList.vue

@@ -338,6 +338,7 @@ import {
   delTask,
   addTask,
   updateTask,
+  submit
 } from "@/api/business/spd/bo/task";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import StaffRef from "@/views/business/spd/bo/refer/staff/index.vue";

+ 1 - 1
src/views/material/changeApply/add/column.js

@@ -129,7 +129,7 @@ export default function useColumns(){
             require: true,
           },
           attr:{
-            readonly:true,
+            // readonly:true,
             is: "el-popover-select-v2",
             valueKey: "code",
             referName: "MATERIAL_PARAM",

+ 3 - 0
src/views/material/requisition/add.vue

@@ -1297,6 +1297,9 @@
 
               this.basicForm.updateTime = '';
 
+              this.basicForm.auditTime = '';
+              
+              this.basicForm.applyBillInfo.auditTime = '';
 
             }
 

+ 8 - 0
src/views/material/requisition/columns.js

@@ -87,6 +87,14 @@
         clearable:true,
       },
     },
+   {
+     item: { key: "materialCodes", title: "物料编码" },
+     attr: {
+       clearable: true,
+       is: "el-input",
+       placeholder: '多物料编码使用 , 隔开',
+     },
+   },
     {
       item: { key: "classifySearchList", title: "品类" },
       attr: {

+ 13 - 17
src/views/purchase/apply/add/columns.js

@@ -119,6 +119,7 @@ export default function useColumns() {
           attr: {
             is: "el-popover-select-v2",
             checkbox: true,
+            clearable: true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -326,8 +327,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { taxPrice = 0, recentlyPrice = 0 } = prop;
-              return (prop.priceDiffer =
-                Number(taxPrice) - Number(recentlyPrice));
+              return (prop.priceDiffer = Number(recentlyPrice) !== 0 ? Number(taxPrice) - Number(recentlyPrice) : 0);
             },
           },
         },
@@ -337,40 +337,36 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice
-                ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
-                    2
-                  )
-                : "0.00");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0.0%");
             },
           },
         },
 
         {
-          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "ypurchaseQuantity", title: "预计年采购量" },
           attr: {
-            is: "el-computed-input-v2",
+            // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : prop * 1;
+              return prop.ypurchaseQuantity
             },
           },
         },
         {
-          item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
+          item: { width: 100, key: "ypurchaseVolume", title: "预计年采购额" },
           attr: {
             formatter: (prop) => {
-              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
+              const { taxPrice = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.ypurchaseVolume = (Number(taxPrice) * Number(ypurchaseQuantity)).toFixed(2));
             },
           },
         },
         {
-          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
+          item: { width: 100, key: "yaffectedAmount", title: "预计年影响金额" },
           attr: {
             formatter: (prop) => {
-              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yAffectedAmount =
-                Number(priceDiffer) * Number(yPurchaseQuantity));
+              const { priceDiffer = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.yaffectedAmount =
+                Number(priceDiffer) * Number(ypurchaseQuantity));
             },
           },
         },

+ 2 - 2
src/views/purchase/apply/add/index.vue

@@ -86,7 +86,7 @@
           const {
             recentlyPrice = "0",
             isApprovalFirst = "N",
-          } = await fetchExist({puOrg, customer, supplier, materialCode, customerName: ""});
+          } = await fetchExist({puOrg, customer, supplier, materialCode, customerName: "", priceType: prop.row.priceType});
           this.loading = false;
           await this.onRowAdd(this.tabName, {
             ...item,
@@ -122,7 +122,7 @@
           recentlyPrice,
           isApprovalFirst,
           purchasequantity
-          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName});
+          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName, priceType: prop.row.priceType});
           prop.row.yPurchaseQuantity = purchasequantity
           prop.row.recentlyPrice = recentlyPrice
           prop.row.isApprovalFirst = isApprovalFirst

+ 13 - 14
src/views/purchase/apply/copy/columns.js

@@ -119,6 +119,7 @@ export default function useColumns() {
           attr: {
             is: "el-popover-select-v2",
             checkbox: true,
+            clearable: true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -326,9 +327,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { taxPrice = 0, recentlyPrice = 0 } = prop;
-              return (prop.priceDiffer = (
-                Number(taxPrice) - Number(recentlyPrice)
-              ));
+              return (prop.priceDiffer = Number(recentlyPrice) !== 0 ? Number(taxPrice) - Number(recentlyPrice) : 0);
             },
           },
         },
@@ -338,36 +337,36 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(2) : "0.00");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0.0%");
             },
           },
         },
 
         {
-          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "ypurchaseQuantity", title: "预计年采购量" },
           attr: {
-            is: "el-computed-input-v2",
+            // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              return prop.ypurchaseQuantity
             },
           },
         },
         {
-          item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
+          item: { width: 100, key: "ypurchaseVolume", title: "预计年采购额" },
           attr: {
             formatter: (prop) => {
-              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
+              const { taxPrice = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.ypurchaseVolume = (Number(taxPrice) * Number(ypurchaseQuantity)).toFixed(2));
             },
           },
         },
         {
-          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
+          item: { width: 100, key: "yaffectedAmount", title: "预计年影响金额" },
           attr: {
             formatter: (prop) => {
-              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yAffectedAmount = (
-                Number(priceDiffer) * Number(yPurchaseQuantity)
+              const { priceDiffer = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.yaffectedAmount = (
+                Number(priceDiffer) * Number(ypurchaseQuantity)
               ));
             },
           },

+ 4 - 3
src/views/purchase/apply/copy/index.vue

@@ -102,7 +102,7 @@ export default {
         const {
           recentlyPrice = "0",
           isApprovalFirst = "N",
-        } = await fetchExist({ puOrg, customer, supplier, materialCode });
+        } = await fetchExist({ puOrg, customer, supplier, materialCode, priceType: prop.row.priceType });
         this.loading = false;
         await this.onRowAdd(this.tabName, {
           ...item,
@@ -138,7 +138,7 @@ export default {
           recentlyPrice,
           isApprovalFirst,
           purchasequantity
-          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName});
+          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName, priceType: prop.row.priceType});
           prop.row.yPurchaseQuantity = purchasequantity
           prop.row.recentlyPrice = recentlyPrice
           prop.row.isApprovalFirst = isApprovalFirst
@@ -152,7 +152,8 @@ export default {
         const { TableColumns } = TabColumns.find(
           ({ item: { key } }) => key === tabName
         );
-        const { code, data } = await ITEM(prop);
+        console.log('看看prop', prop)
+        const { code, data } = await ITEM(prop, true);
         if (code === 200) {
           this.params = data;
           this.params.priceApplyItems = data.priceApplyItems.map((item) => ({

+ 14 - 19
src/views/purchase/apply/edit/columns.js

@@ -87,7 +87,7 @@ export default function useColumns() {
     },
     {
       item: { key: "sourceType", title: "来源单据类型" },
-      attr: { is: "el-input", disabled: true, readonly: true },
+      attr: { is: "el-select", dictName: "price_source", disabled: true, readonly: true },
     },
     {
       item: { key: "status", title: "单据状态" },
@@ -119,6 +119,7 @@ export default function useColumns() {
           attr: {
             is: "el-popover-select-v2",
             checkbox: true,
+            clearable:true,
             valueKey: "name",
             referName: "MATERIAL_PARAM",
             dataMapping: {
@@ -326,9 +327,7 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { taxPrice = 0, recentlyPrice = 0 } = prop;
-              return (prop.priceDiffer = (
-                Number(taxPrice) - Number(recentlyPrice)
-              ));
+              return (prop.priceDiffer = Number(recentlyPrice) !== 0 ? Number(taxPrice) - Number(recentlyPrice) : 0 );
             },
           },
         },
@@ -338,40 +337,36 @@ export default function useColumns() {
           attr: {
             formatter: (prop) => {
               const { priceDiffer = 0, recentlyPrice = 0 } = prop;
-              return (prop.increase = recentlyPrice
-                ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(
-                    2
-                  )
-                : "0.00");
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%': "0.0%");
             },
           },
         },
 
         {
-          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "ypurchaseQuantity", title: "预计年采购量" },
           attr: {
-            is: "el-computed-input-v2",
+            // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              return prop.ypurchaseQuantity
             },
           },
         },
         {
-          item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
+          item: { width: 100, key: "ypurchaseVolume", title: "预计年采购额" },
           attr: {
             formatter: (prop) => {
-              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
+              const { taxPrice = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.ypurchaseVolume = (Number(taxPrice) * Number(ypurchaseQuantity)).toFixed(2));
             },
           },
         },
         {
-          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
+          item: { width: 100, key: "yaffectedAmount", title: "预计年影响金额" },
           attr: {
             formatter: (prop) => {
-              const { priceDiffer = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yAffectedAmount = (
-                Number(priceDiffer) * Number(yPurchaseQuantity)
+              const { priceDiffer = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.yaffectedAmount = (
+                Number(priceDiffer) * Number(ypurchaseQuantity)
               ));
             },
           },

+ 3 - 3
src/views/purchase/apply/edit/index.vue

@@ -131,7 +131,7 @@
           const {
             recentlyPrice = "0",
             isApprovalFirst = "N",
-          } = await fetchExist({puOrg, customer, supplier, materialCode, customerName: ""});
+          } = await fetchExist({puOrg, customer, supplier, materialCode, customerName: "",priceType: prop.row.priceType});
           this.loading = false;
           await this.onRowAdd(this.tabName, {
             ...item,
@@ -168,7 +168,7 @@
           recentlyPrice,
           isApprovalFirst,
           purchasequantity
-          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName});
+          } = await fetchExist({puOrg, supplier, materialCode: prop.row.materialCode, customer:prop.row.customer,customerName: prop.row.customerName, priceType: prop.row.priceType});
           prop.row.yPurchaseQuantity = purchasequantity
           prop.row.recentlyPrice = recentlyPrice
           prop.row.isApprovalFirst = isApprovalFirst
@@ -182,7 +182,7 @@
           const {TableColumns} = TabColumns.find(
             ({item: {key}}) => key === tabName
           );
-          const {code, data} = await ITEM(prop);
+          const {code, data} = await ITEM(prop, false);
           if (code === 200) {
             this.params = data;
             this.params.priceApplyItems = data.priceApplyItems.map((item) => ({

+ 104 - 3
src/views/purchase/apply/index.vue

@@ -1,7 +1,9 @@
 <script>
 import { dicts } from "./dicts";
 import useColumns from "./columns";
-import { LIST, mbDownload } from "@/api/business/purchase/apply";
+import { LIST, mbDownload, failDownload} from "@/api/business/purchase/apply";
+// 导入的token
+import { getToken } from "@/utils/auth";
 
 export default {
   name: "PuchaseApply",
@@ -21,6 +23,21 @@ export default {
     const page = this.$init.page();
     const params = this.$init.params(SearchColumns);
     return {
+      // 导入参数
+      upload: {
+        // 是否显示弹出层(导入)
+        open: false,
+        // 弹出层标题(导入)
+        title: "数据导入",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 1,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/pu/priceApply/import"
+      },
       size: "mini",
       loading: false,
       params: params,
@@ -83,14 +100,68 @@ export default {
     downLoadMb() {
       this.$modal.loading("正在下载模板,请稍后...");
       mbDownload().then(res => {
-
+        this.$modal.closeLoading();
+        const blob = new Blob([res], {
+          type: "application/vnd.ms-excel;charset=UTF-8",
+        });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+        const downloadElement = document.createElement("a"); //创建a标签
+        const href = window.URL.createObjectURL(blob); // 创建下载的链接
+        downloadElement.href = href;  //下载地址
+        downloadElement.download = '价格申报单导入模板' + this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
+        document.body.appendChild(downloadElement);
+        downloadElement.click(); // 点击下载
+        document.body.removeChild(downloadElement); // 下载完成移除元素
+        window.URL.revokeObjectURL(href); // 释放blob对象
       }).catch(err => {
         this.$modal.closeLoading();
       })
     },
+    // 文件上传中处理
+    handleFileUploadProgress(event, file, fileList) {
+      this.upload.isUploading = true;
+      this.$modal.loading("正在导入数据,请稍后...");
+    },
+    // 文件上传成功处理
+    handleFileSuccess(response, file, fileList) {
+      this.$modal.closeLoading();
+      this.upload.open = false;
+      this.upload.isUploading = false;
+      this.$refs.upload.clearFiles();
+      this.$alert(response.data.msg, "导入结果", { dangerouslyUseHTMLString: true });
+      // 有失败的再次下载下来
+      if(response.data.flag) {
+        this.$modal.loading("正在下载导入失败数据,请稍后...");
+        failDownload({failDatas:response.data.datas}).then(res => {
+          this.$modal.closeLoading();
+          const blob = new Blob([res], {
+            type: "application/vnd.ms-excel;charset=UTF-8",
+          });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+          const downloadElement = document.createElement("a"); //创建a标签
+          const href = window.URL.createObjectURL(blob); // 创建下载的链接
+          downloadElement.href = href;  //下载地址
+          downloadElement.download = '价格申报单导入失败数据' + this.parseTime(new Date().getTime()) + ".xlsx"; // 下载后文件名
+          document.body.appendChild(downloadElement);
+          downloadElement.click(); // 点击下载
+          document.body.removeChild(downloadElement); // 下载完成移除元素
+          window.URL.revokeObjectURL(href); // 释放blob对象
+        }).catch(err => {
+          this.$modal.closeLoading();
+        })
+      }
+      this.useQuery(this.params, this.page);
+    },
+    errorFile(err) {
+      this.$modal.closeLoading();
+      this.$modal.notifyError("文件已变动,请重新上传");
+    },
+    // 提交上传文件
+    submitFileForm() {
+      this.$refs.upload.submit();
+    },
     // 导入数据
     importMb() {
-      
+      this.upload.title = "文件导入"
+      this.upload.open = true
     },
   },
 };
@@ -179,6 +250,36 @@ export default {
       @pagination="useQuery(params, page)"
     >
     </el-super-table>
+    <!-- 文件导入对话框 -->
+    <el-dialog title="文件导入" :visible.sync="upload.open" width="400px">
+      <el-upload
+      ref="upload"
+      :limit="1"
+      accept=".xlsx, .xls"
+      :headers="upload.headers"
+      :action="upload.url + '?updateSupport=' + upload.updateSupport"
+      :disabled="upload.isUploading"
+      :on-progress="handleFileUploadProgress"
+      :on-success="handleFileSuccess"
+      :on-error="errorFile"
+      :auto-upload="false"
+      drag
+      >
+      <i class="el-icon-upload"></i>
+      <div class="el-upload__text">
+        将文件拖到此处,或
+        <em>点击上传</em>
+      </div>
+      <!-- <div class="el-upload__tip" slot="tip">
+        <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+      </div> -->
+      <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
+      </el-upload>
+      <div slot="footer">
+      <el-button size="mini" type="primary" @click="submitFileForm">确 定</el-button>
+      <el-button size="mini" @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
   </el-card>
 </template>
 <style scoped lang="scss">

+ 13 - 11
src/views/purchase/apply/see/columns.js

@@ -51,7 +51,10 @@ export default function useColumns() {
     },
     {
       item: { width: 100, key: "sourceType", title: "来源单据类型" },
-      attr: {},
+      attr: {
+        is: "el-dict-tag",
+        dictName: "price_source",
+      },
     },
     {
       item: { width: 100, key: "status", title: "单据状态" },
@@ -169,7 +172,6 @@ export default function useColumns() {
         {
           item: { width: 100, key: "isPriceAdjustmentName", title: "调价类型" },
           attr: {
-            is: "el-dict-tag",
           },
         },
         {
@@ -214,33 +216,33 @@ export default function useColumns() {
         {
           item: { width: 100, key: "increase", title: "涨幅" },
           attr: {
-            is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              const { priceDiffer = 0, recentlyPrice = 0 } = prop;
+              return (prop.increase = recentlyPrice ? ((Number(priceDiffer) / Number(recentlyPrice)) * 100).toFixed(1) + '%' : "0.0%");
             },
           },
         },
 
         {
-          item: { width: 100, key: "yPurchaseQuantity", title: "预计年采购量" },
+          item: { width: 100, key: "ypurchaseQuantity", title: "预计年采购量" },
           attr: {
-            is: "el-computed-input-v2",
+            // is: "el-computed-input-v2",
             formatter: (prop) => {
-              return prop == null ? 0 : (prop * 1);
+              return prop.ypurchaseQuantity
             },
           },
         },
         {
-          item: { width: 100, key: "yPurchaseVolume", title: "预计年采购额" },
+          item: { width: 100, key: "ypurchaseVolume", title: "预计年采购额" },
           attr: {
             formatter: (prop) => {
-              const { taxPrice = 0, yPurchaseQuantity = 0 } = prop;
-              return (prop.yPurchaseVolume = (Number(taxPrice) * Number(yPurchaseQuantity)).toFixed(2));
+              const { taxPrice = 0, ypurchaseQuantity = 0 } = prop;
+              return (prop.ypurchaseVolume = (Number(taxPrice) * Number(ypurchaseQuantity)).toFixed(2));
             },
           },
         },
         {
-          item: { width: 100, key: "yAffectedAmount", title: "预计年影响金额" },
+          item: { width: 100, key: "yaffectedAmount", title: "预计年影响金额" },
           attr: {
             is: "el-computed-input-v2",
             formatter: (prop) => {

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

@@ -67,7 +67,7 @@ export default {
           total,
           rows: [{ id }],
         } = await LIST({ ...model }, { pageNum: prop, pageSize: 1 });
-        const { code, data } = await ITEM(id);
+        const { code, data } = await ITEM(id, false);
         if (code === 200) {
           this.params = data;
           this.params.$index = prop;

+ 8 - 0
src/views/purchase/catalogue/columns.js

@@ -137,6 +137,14 @@ export default function useColumns() {
         referName: "MATERIAL_PARAM",
       },
     },
+    {
+      item: { key: "materialCodes", title: "物料编码"},
+      attr: {
+        clearable: true,
+        is: "el-input",
+        placeholder: '多物料编码使用 , 隔开',
+      },
+    },
     // {
     //   item: { width: 100, key: "materialCodeList", title: "物料编码" },
     //   attr: {

+ 4 - 1
src/views/purchase/catalogue/see/columns.js

@@ -30,7 +30,10 @@ export default function useColumns() {
     { 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: "source", title: "来源单据" }, attr: {} },
+    { item: { width:100,key: "source", title: "来源单据" }, attr: {
+      is: "el-dict-tag",
+      dictName: "price_source",
+    } },
     {
       item: { width:100,key: "convertRate", title: "换算率" },
       attr: {

+ 5 - 1
src/views/purchase/contract/columns.js

@@ -274,6 +274,7 @@ export default function useColumns() {
       item: { key: "buyerName", title: "采购员", width: 100 },
       attr: {
         is: "el-popover-select-v2",
+        clearable: true,
         valueKey: "name",
         referName: "CONTACTS_PARAM",
         dataMapping: {
@@ -289,6 +290,7 @@ export default function useColumns() {
       },
       attr: {
         is: "el-popover-select-v2",
+        clearable: true,
         valueKey: "name",
         referName: "ORG_PARAM",
         dataMapping: {
@@ -330,9 +332,10 @@ export default function useColumns() {
       },
     },
     {
-      item: { width: 100, key: "status", title: "合同号" },
+      item: { width: 100, key: "code", title: "合同编码" },
       attr: {
         is: "el-input",
+        clearable: true,
       },
     },
     {
@@ -342,6 +345,7 @@ export default function useColumns() {
       },
       attr: {
         is: "el-popover-select-v2",
+        clearable: true,
         valueKey: "name",
         referName: "SUPPLIER_PARAM",
         dataMapping: {

+ 1 - 0
src/views/purchase/purchase-order/add/index.vue

@@ -756,6 +756,7 @@ export default {
                       @change="handleInputChange(scope.row, cColumn.key)"
                       :clearable="cColumn.clearable"
                       :disabled="cColumn.disabled"
+                      :min="cColumn.key === 'reservedQty' ? 0 : -Infinity"
                       size="mini"
                       style="width: 100%"
                     ></el-input-number>

+ 1 - 0
src/views/purchase/purchase-order/edit/index.vue

@@ -725,6 +725,7 @@ export default {
                     :precision="cColumn.precision"
                     :controls-position="cColumn.controlsPosition"
                     :max="getInputNumberMax(cColumn.key, scope.row)"
+                    :min="cColumn.key === 'reservedQty' ? 0 : -Infinity"
                     @change="handleInputChange(scope.row, cColumn.key)" 
                     :placeholder="cColumn.placeholder"
                     :clearable="cColumn.clearable" 

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

@@ -19,7 +19,15 @@ export const TableColumns = [
      
     },
   },
-  
+  {
+    item: { key: "taxPrice", title: "主含税单价", width: 150 },
+    attr: {
+      is: "el-computed-input-v2",
+      formatter: (prop) => {
+        return (prop * 1);
+      },
+    },
+  },
   
   // {
   //   item: { key: "customerName", title: "客户" },
@@ -56,15 +64,6 @@ export const TableColumns = [
     },
   },
   {
-    item: { key: "taxPrice", title: "主含税单价",width:150 },
-    attr: {
-      is: "el-computed-input-v2",
-      formatter: (prop) => {
-        return (prop * 1);
-      },
-    },
-  },
-  {
     item: { key: "purchaseQuantity", title: "本次采购数量", fixed: true ,width:160},
     attr: {
       is: "el-input-number",

+ 11 - 5
src/views/system/table-template/auth-dialog.vue

@@ -1,6 +1,7 @@
 <script>
 import { role, auth } from "@/api/system/table-template";
-import { listRole } from "@/api/system/role";
+// import { listRole } from "@/api/system/role";
+import { listOptionselect } from "@/api/system/role";
 export default {
   name: "AuthDialog",
   data() {
@@ -19,10 +20,15 @@ export default {
       this.form.id = id;
       this.loading = true;
       this.dialogFormVisible = true;
-      listRole({ id })
+      listOptionselect({ id })
         .then((res) => {
-          let { rows, total } = res;
-          this.roleList = rows.map((item) => ({
+          // let { rows, total } = res;
+          // this.roleList = rows.map((item) => ({
+          //   key: item.roleId,
+          //   label: item.roleName,
+          // }));
+          let { data } = res;
+          this.roleList = data.map((item) => ({
             key: item.roleId,
             label: item.roleName,
           }));
@@ -65,7 +71,7 @@ export default {
   <el-dialog
     width="fit-content"
     destroy-on-close
-    title="权"
+    title="权"
     :visible.sync="dialogFormVisible"
   >
     <el-transfer