Explorar o código

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

001295 hai 1 ano
pai
achega
484e5eeb84

+ 8 - 0
src/api/expend/expendMx.js

@@ -46,4 +46,12 @@ export function toOAs(data) {
     method: 'post',
     data: data
   })
+}
+// 导出
+export function exportMx(data) {
+  return request({
+    url: `/pu/doc/pullToCcd`,
+    method: 'post',
+    data: data
+  })
 }

+ 2 - 1
src/components/computed-input-v2/index.vue

@@ -1,5 +1,6 @@
 <template>
-  <span v-on="$listeners">{{ innerValue || "--" }}</span>
+  <!-- <span v-on="$listeners">{{ innerValue || "--" }}</span> -->
+  <span v-on="$listeners">{{ innerValue }}</span>
 </template>
 
 <script>

+ 37 - 40
src/components/super-table/index.vue

@@ -56,9 +56,9 @@ export default {
     storageKey: {
       type: String,
     },
-    showSummary:{
-      type:Boolean,
-      default:false,
+    showSummary: {
+      type: Boolean,
+      default: false,
     },
   },
   components: {
@@ -98,7 +98,6 @@ export default {
       // 过滤
       filterData: [],
       filterState: false,
-      
     };
   },
   computed: {
@@ -152,15 +151,15 @@ export default {
         this.filterData = multiFilter(this.$props.value, newValue);
       },
     },
-    value:{
+    value: {
       handler: function (newValue) {
-        if(this.value.length > 0){
-          this.$refs.superTable&& this.$refs.superTable.clearSelection();
+        if (this.value.length > 0) {
+          this.$refs.superTable && this.$refs.superTable.clearSelection();
         }
       },
       immediate: true,
-      deep:true
-    }
+      deep: true,
+    },
   },
   methods: {
     //
@@ -274,47 +273,47 @@ export default {
         }
       }
     },
-    getSummaries(param){
-      if(this.showSummary){
+    getSummaries(param) {
+      if (this.showSummary) {
         const { columns, data } = param;
-				const sums = [];
-				columns.forEach((column, index) => {
+        const sums = [];
+        columns.forEach((column, index) => {
+          if (index === 0 && !column.property) {
+            sums[index] = "合计";
+            return;
+          }
 
-				if (index === 0 && !column.property) {
-				   sums[index] = '合计';
-				   return;
-				}
+          const values = data.map((item) => Number(item[column.property]));
+          //  if (column.property == 'businessProportion' ||column.property =='rankMagnitude' ) {
 
-				const values = data.map(item => Number(item[column.property]));
-        //  if (column.property == 'businessProportion' ||column.property =='rankMagnitude' ) {
+          let sumColumn = this.showColumns.filter(
+            ({ item, attr }) => attr.isSummary && item.key === column.property
+          );
 
-        let sumColumn = this.showColumns.filter(({item,attr}) => attr.isSummary && item.key === column.property);
-        
-        if (sumColumn.length) {
-          sums[index] = values.reduce((prev, curr) => {
-            const value = Number(curr);
-            if (!isNaN(value)) {
-              return prev + curr;
-            } else {
-              return prev + 0;
-            }
-          }, 0);
-          sums[index] = sums[index] && sums[index].toFixed(2) // 保留2位小数,解决小数合计列;
+          if (sumColumn.length) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr);
+              if (!isNaN(value)) {
+                return prev + curr;
+              } else {
+                return prev + 0;
+              }
+            }, 0);
+            sums[index] = sums[index] && sums[index].toFixed(2); // 保留2位小数,解决小数合计列;
           }
-				});
-				return sums;
-
+        });
+        return sums;
       }
-    }
+    },
   },
   created() {},
   mounted() {
     this.extendMethod();
   },
   updated() {
-    this.$nextTick(()=>{
+    this.$nextTick(() => {
       this.$refs.superTable.doLayout();
-    })
+    });
   },
   destroyed() {},
 };
@@ -470,9 +469,7 @@ export default {
               <component v-if="attr.formatter" is="span">{{
                 attr.formatter(scope.row)
               }}</component>
-              <component v-else is="span">{{
-                scope.row[item.key] || "--"
-              }}</component>
+              <component v-else is="span">{{ scope.row[item.key] }}</component>
             </template>
           </slot>
         </template>

+ 2 - 3
src/components/super-ux-table/index.vue

@@ -527,9 +527,8 @@ export default {
               <component v-if="attr.formatter" is="span">{{
                 attr.formatter(scope.row)
               }}</component>
-              <component v-else is="span">{{
-                scope.row[item.key] || "--"
-              }}</component>
+              <component v-else is="span">{{ scope.row[item.key] }}</component>
+              <!-- scope.row[item.key] || "--" -->
             </template>
           </slot>
         </template>

+ 8 - 1
src/views/expend/customerExpend/columns.js

@@ -176,7 +176,6 @@ export default function useColumns() {
         dictName: "sys_yes_no",
       }
     },
-
     {
       item: { key: "isOpen", title: "单据打开状态", width: 100, },
       attr: {
@@ -185,6 +184,14 @@ export default function useColumns() {
         clearable: true,
       }
     },
+    {
+      item: { key: "isWhether", title: "是否带量", width: 100, },
+      attr: {
+        is: "el-dict-tag",
+        dictName: "carry_or_not",
+        clearable: true,
+      }
+    },
   ].map(({ item, attr }) => ({
     attr,
     item: {

+ 8 - 0
src/views/expend/customerExpend/edit/columns.js

@@ -163,6 +163,14 @@ export default function useColumns() {
         disabled: true,
       }
     },
+    {
+      item: { key: "isWhether", title: "是否带量", width: 100, },
+      attr: {
+        is: "el-select",
+        dictName: "carry_or_not",
+        disabled: true,
+      }
+    },
 
   ].map(({ item, attr }) => ({
     attr,

+ 75 - 20
src/views/expend/expendMx.vue

@@ -19,6 +19,29 @@
           </el-col>
 
           <el-col :span="1.5">
+            <el-form-item label="医院编码">
+                <el-input
+                  v-model.trim="params.custCode"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
+            <el-form-item label="供应商编码">
+                <el-input
+                  v-model.trim="params.supplierCode"
+                  size="mini"
+                  clearable
+                  style="width: 200px"
+                />
+              </el-form-item>
+          </el-col>
+
+
+          <el-col :span="1.5">
             <el-form-item label="结算开始日期">
               <el-date-picker
                 v-model="params.startDate"
@@ -57,6 +80,19 @@
           </el-col>
 
           <el-col :span="1.5">
+            <el-form-item label="是否汇总">
+              <el-select style="width: 200px" size="mini" clearable v-model="params.isSum" placeholder="请选择">
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+              </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
             <el-form-item label-width="80px">
               <el-button type="primary" size="mini" icon="el-icon-search" @click="searchList">搜索</el-button>
               <el-button size="mini" plain icon="el-icon-refresh" @click="resetList">重置</el-button>
@@ -113,9 +149,9 @@
 </template>
 
 <script>
-import { mxList, pullMx, huizongMX } from '@/api/expend/expendMx.js'
+import { mxList, pullMx, huizongMX, exportMx } from '@/api/expend/expendMx.js'
 export default {
-  dicts: ['sys_status'],
+  dicts: ['sys_status', 'sys_number_yes_no'],
   components: {
     Add: () => import("./expendMxDetail.vue"),
     ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
@@ -130,8 +166,11 @@ export default {
       rowDetail: {},
       size: "mini",
       loading: false,
+      options: [{value: '0', label: '是'}, {value: '2', label: '否'}],
       params: {
         code: '',
+        custCode: '',
+        supplierCode: '',
         startDate: '',
         endDate: '',
         settleNo: '',
@@ -145,28 +184,26 @@ export default {
       selectData: [],
       // SearchColumns: SearchColumns,
       TableColumns: [
+        { item: { key: "code", title: "编码"}, attr: {} },
+        { item: { key: "verifyState", title: "单据状态"}, attr: {
+          is: "el-dict-tag",
+          dictName: "sys_status",
+          }
+        },
         { item: { key: "serviceFee", title: "服务费合计" }, attr: {} },
+        { item: { key: "custName", title: "医院名称" }, attr: {} },
         { item: { key: "custCode", title: "医院编码" }, attr: {} },
         { item: { key: "supplierCode", title: "供应商编码" }, attr: {} },
         { item: { key: "supplierName", title: "供应商名称" }, attr: {} },
         { item: { key: "isSum", title: "是否汇总" }, attr: {
-          formatter: (prop) => {
-              return prop.isSum == '0' ? '是' : '否'
-            },
+          is: 'el-dict-tag',
+          dictName: "sys_number_yes_no",
         } },
         { item: { key: "settleNo", title: "结算单号"}, attr: {} },
         { item: { key: "startDate", title: "结算开始日期" }, attr: {} },
         { item: { key: "endDate", title: "结算截止日期" }, attr: {} },
         { item: { key: "totalAmount", title: "合计金额" }, attr: {} },
-        // { item: { key: "isProjectOrFactoryEmpower", title: "是否项目/厂家年度授权" }, attr: {is: "el-dict-tag", dictName: "sys_equipment_type"} },
-        // { item: { key: "parameters", title: "参数" }, attr: {} },
         { item: { key: "remark", title: "备注"}, attr: {} },
-        { item: { key: "code", title: "编码"}, attr: {} },
-        { item: { key: "verifyState", title: "单据状态"}, attr: {
-          is: "el-dict-tag",
-          dictName: "sys_status",
-          } 
-        },
       ].map(({ item, attr }) => ({
       attr,
       item: {
@@ -190,6 +227,8 @@ export default {
     resetList() {
       this.params = {
         code: '',
+        custCode: '',
+        supplierCode: '',
         startDate: '',
         endDate: '',
         settleNo: '',
@@ -234,16 +273,32 @@ export default {
       })
     },
     huizong() {
+      console.log('ids', this.ids);
       if (this.ids.length <= 0) {
         this.$modal.notifyWarning("至少勾选一条数据");
       } else {
-        huizongMX(this.ids).then(res => {
-          if(res.code === 200) {
-            this.$modal.notifySuccess(res.msg);
-          }
-       })
+        let map = {
+          ids: this.ids.map(s => s.id)
+        }
+        this.download('/pu/doc/pullToCcd', {...map}, `汇总明细_${new Date().getTime()}.xlsx`)
       }
-      // huizongMX()
+    },
+    huizongDC(arr) {
+      this.download('/pu/doc/pullToCcd', {...arr}, `汇总明细_${new Date().getTime()}.xlsx`)
+      // exportMx(arr).then(res => {
+      //   console.log('111',res)
+      //   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 = '消耗单明细'; // 下载后文件名
+      //   document.body.appendChild(downloadElement);
+      //   downloadElement.click(); // 点击下载
+      //   document.body.removeChild(downloadElement); // 下载完成移除元素
+      //   window.URL.revokeObjectURL(href); // 释放blob对象
+      // })
     },
     check(row) {
       this.isList = false
@@ -272,4 +327,4 @@ export default {
   display: flex;
   justify-content: flex-end;
 }
-</style>
+</style>

+ 19 - 2
src/views/expend/expendMxDetail.vue

@@ -93,6 +93,19 @@
           </el-col>
 
           <el-col :span="1.5">
+            <el-form-item label="是否汇总" prop="isSum">
+              <el-select style="width: 200px" size="mini" :disabled="sonDisable" clearable v-model="basicForm.isSum" placeholder="请选择">
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="1.5">
             <el-form-item label="备注" prop="remark">
               <el-input style="width: 200px" clearable :disabled="sonDisable" size="mini" v-model="basicForm.remark">
               </el-input>
@@ -183,9 +196,11 @@ export default {
         startDate: '',
         endDate: '',
         totalAmount: '',
+        isSum: '',
         remark: '',
         itemList: []
       },
+      options: [{value: '0', label: '是'}, {value: '2', label: '否'}],
       basicRules: {},
       ids:[],
     }
@@ -278,9 +293,11 @@ export default {
     hangStatus(row) {
       switch (row.row.isWhether) {
         case "0":
-          return "是";
-        case "2":
           return "否";
+        case "":
+          return "否";
+        case "1":
+          return "是";
       }
     },
   }

+ 48 - 48
src/views/purchase/DemandSummary/add/columns.js

@@ -263,54 +263,54 @@ export default function useColumns() {
         dictName: "sys_price_type",
       },
     },
-    {
-      item: { key: "", title: "需求客户近1月用量", },
-      attr: {},
-    },
-    {
-      item: { key: "", title: "需求客户近3月月均用量", },
-      attr: {},
-    },
-    {
-      item: { key: "", title: "近1月均销售量", },
-      attr: {},
-    },
-    {
-      item: { key: "", title: "近3月均销售量", },
-      attr: {},
-    },
-    {
-      item: { key: "", title: "在途数量", },
-      attr: {},
-    },
-    {
-      item: { key: "", title: "中心公共库存", },
-      attr: {},
-    },
-    {
-      item: { key: "", title: "中心仓专属货位", },
-      attr: {},
-    },
-    {
-      item: { key: "", title: "客户专属货位库存", },
-      attr: {},
-    },
-    {
-      item: { key: "", title: "呆滞库存", },
-      attr: {},
-    },
-    {
-      item: { key: "", title: "项目仓库存", },
-      attr: {},
-    },
-    {
-      item: { key: "", title: "电商库存", },
-      attr: {},
-    },
-    {
-      item: { key: "", title: "近效期数量", },
-      attr: {},
-    },
+    // {
+    //   item: { key: "", title: "需求客户近1月用量", },
+    //   attr: {},
+    // },
+    // {
+    //   item: { key: "", title: "需求客户近3月月均用量", },
+    //   attr: {},
+    // },
+    // {
+    //   item: { key: "", title: "近1月均销售量", },
+    //   attr: {},
+    // },
+    // {
+    //   item: { key: "", title: "近3月均销售量", },
+    //   attr: {},
+    // },
+    // {
+    //   item: { key: "", title: "在途数量", },
+    //   attr: {},
+    // },
+    // {
+    //   item: { key: "", title: "中心公共库存", },
+    //   attr: {},
+    // },
+    // {
+    //   item: { key: "", title: "中心仓专属货位", },
+    //   attr: {},
+    // },
+    // {
+    //   item: { key: "", title: "客户专属货位库存", },
+    //   attr: {},
+    // },
+    // {
+    //   item: { key: "", title: "呆滞库存", },
+    //   attr: {},
+    // },
+    // {
+    //   item: { key: "", title: "项目仓库存", },
+    //   attr: {},
+    // },
+    // {
+    //   item: { key: "", title: "电商库存", },
+    //   attr: {},
+    // },
+    // {
+    //   item: { key: "", title: "近效期数量", },
+    //   attr: {},
+    // },
   ];
 
   return { TableColumns }

+ 17 - 16
src/views/purchase/DemandSummary/columns.js

@@ -7,6 +7,7 @@ export default function useColumns() {
         dictName: "sys_row_status",
         multiple: true,
         clearable: true,
+        collapseTags: true,
       },
     },
     {
@@ -240,14 +241,14 @@ export default function useColumns() {
         }
       },
     },
-    {
-      item: { key: "", title: "需求客户近1月用量", width: 150, },
-      attr: {},
-    },
-    {
-      item: { key: "", title: "需求客户近3月月均用量", width: 150, },
-      attr: {},
-    },
+    // {
+    //   item: { key: "", title: "需求客户近1月用量", width: 150, },
+    //   attr: {},
+    // },
+    // {
+    //   item: { key: "", title: "需求客户近3月月均用量", width: 150, },
+    //   attr: {},
+    // },
     {
       item: { key: "netDemandNum", title: "总最终净需求量", width: 120, },
       attr: {
@@ -290,10 +291,10 @@ export default function useColumns() {
       item: { key: "centralWarehouse", title: "中心仓专属货位", },
       attr: {},
     },
-    {
-      item: { key: "", title: "客户专属货位库存", },
-      attr: {},
-    },
+    // {
+    //   item: { key: "", title: "客户专属货位库存", },
+    //   attr: {},
+    // },
     {
       item: { key: "commerceWarehouse", title: "电商仓库", },
       attr: {},
@@ -302,10 +303,10 @@ export default function useColumns() {
       item: { key: "buyTransit", title: "采购在途", },
       attr: {},
     },
-    {
-      item: { key: "", title: "近效期库存数量", },
-      attr: {},
-    },
+    // {
+    //   item: { key: "", title: "近效期库存数量", },
+    //   attr: {},
+    // },
     {
       item: { key: "lendTransit", title: "借出在途", },
       attr: {},

+ 4 - 2
src/views/purchase/purchase-order/add/column.js

@@ -353,6 +353,7 @@ const PurColumns = [
     rows: 1,
     inputType: "Textarea",
     isShow: true,
+    maxlength: 180,
   },
   {
     key: "sysFileRecordList",
@@ -617,7 +618,7 @@ const PurchaseTabColumns = [
         title: "交货日期",
         inputType: "DatePicker",
         type: 'date',
-        disabled: true,
+        // disabled: true,
         isShow: true,
         width: 180,
       },
@@ -1183,6 +1184,7 @@ const CauseColumns = [
     rows: 1,
     inputType: "Textarea",
     isShow: true,
+    maxlength: 180,
   },
   {
     key: "sysFileRecordList",
@@ -1445,7 +1447,7 @@ const CauseTabColumns = [
         title: "交货日期",
         inputType: "DatePicker",
         type: 'date',
-        disabled: true,
+        // disabled: true,
         isShow: true,
         width: 180,
       },

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

@@ -1000,6 +1000,8 @@ export default {
                 :placeholder="column.placeholder"
                 :clearable="column.clearable"
                 :disabled="column.disabled"
+                :maxlength="column.maxlength"
+                show-word-limit
                 style="width: 100%"
               ></el-input>
 

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

@@ -1056,6 +1056,8 @@ export default {
                 :placeholder="column.placeholder"
                 :clearable="column.clearable"
                 :disabled="column.disabled"
+                :maxlength="column.maxlength"
+                show-word-limit
                 style="width: 100%"
               ></el-input>
               <el-input-number

+ 66 - 29
src/views/purchase/purchase-order/print/index.vue

@@ -36,43 +36,43 @@
       id="PurchaseOrderPdf"
       style="
         position: relative;
-        width: 210mm;
         font-size: 12px;
-        line-height: 1.0;
+        line-height: 1;
         font-family: '宋体';
         z-index: -1;
       "
     >
+      <!-- width: 210mm; -->
       <img
         :src="src"
         :alt="company"
-        style="position: absolute; top: 10px; left: 10px; z-index: 1"
+        style="position: absolute; top: 10px; left: 10px; z-index: 2"
       />
       <div style="position: absolute; top: 0; left: 0; z-index: 2">
         <h1>湖南德荣医疗集团 - 采购订单</h1>
         <p style="display: flex">
-          <span style="width: 60%">甲方(购货方):{{ params.puOrgName }}</span>
-          <span style="width: 40%">签订日期:{{ params.billDate }}</span>
+          <span style="width: 50%">甲方(购货方):{{ params.puOrgName }}</span>
+          <span style="width: 25%">订单编号:{{ params.code }}</span>
+          <span style="width: 25%">签订日期:{{ params.billDate }}</span>
         </p>
         <p style="display: flex">
-          <span style="width: 60%">订单编号:{{ params.code }}</span>
-          <span style="width: 40%">采购部门:{{ params.puDeptName }}</span>
+          <!-- <span style="width: 50%">采购部门:{{ params.puDeptName }}</span> -->
+          <span style="width: 50%">甲方收票地址:{{ params.address }}</span>
+          <span style="width: 25%">采购员:{{ params.buyerName }}</span>
+          <!-- <span style="width: 25%">联系方式:{{ params.contactsPhone }}</span> -->
+          <span style="width: 25%">E-mail:</span>
         </p>
+        <div style="border-bottom: 1px dashed black"></div>
         <p style="display: flex">
-          <span style="width: 60%">采购员:{{ params.buyerName }}</span>
-          <span style="width: 40%"> 采购项目: </span>
+          <span style="width: 50%"
+            >乙方(供货方):{{ params.supplierName }}</span
+          >
+          <span style="width: 25%">ATTN:</span>
+          <span style="width: 25%">E-mail:</span>
         </p>
         <p style="display: flex">
-          <span style="width: 60%">E-mail:</span>
-          <span style="width: 40%">联系方式:{{ params.contactsPhone }}</span>
+          <span>甲方收货地址及联系人:</span>
         </p>
-        <P style="color: #ff4949"> 甲方收票地址:{{ params.address }} </P>
-        <div style="border-bottom: 1px dashed black"></div>
-        <p>乙方(供货方):{{ params.supplierName }}</p>
-        <p>ATTN:</p>
-        <p>E-MAIL:</p>
-        <p>收货地址:</p>
-        <p>收货联系人:</p>
 
         <el-table
           show-summary
@@ -163,20 +163,21 @@ export default {
       type: [String, Number],
       require: true,
     },
-    value:{
-      type:Object,
-      require:true
-    }
+    value: {
+      type: Object,
+      require: true,
+    },
   },
   data() {
-    console.log(this.value,'this.value');
+    console.log(this.value, "this.value");
     return {
+      size: "mini",
       visible: false,
       disabled: false,
       company: "湖南德荣医疗器械有限公司",
       print: {
         id: "PurchaseOrderPdf",
-        popTitle: "配置页眉标题", // 打印配置页上方的标题
+        popTitle: "&nbsp;", // 打印配置页上方的标题
         extraHead: "", // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割
         preview: false, // 是否启动预览模式,默认是false
         previewTitle: "预览的标题", // 打印预览的标题
@@ -221,11 +222,11 @@ export default {
       },
       set: function () {},
     },
-    params:{
-      get:function(){
+    params: {
+      get: function () {
         return this.value;
-      }
-    }
+      },
+    },
   },
   watch: {},
   methods: {
@@ -276,4 +277,40 @@ export default {
   destroyed() {},
 };
 </script>
-<style scoped></style>
+<style lang="scss" media="print">
+@media print {
+  #PurchaseOrderPdf {
+    width: 100%;
+  }
+  p {
+    margin: 4px 0;
+  }
+  .el-table > .el-table__header-wrapper > .el-table__header > thead > tr > th,
+  .el-table
+    > .el-table__body-wrapper
+    > .el-table__body
+    > tbody
+    > .el-table__row
+    > td {
+    padding: 0;
+  }
+  table {
+    table-layout: auto !important;
+  }
+  .el-table__header,
+  .el-table__body,
+  .el-table__footer {
+    width: 100% !important;
+    color: #000 !important;
+  }
+  .el-table .cell,
+  .el-table th.el-table__cell > .cell {
+    line-height: 18px !important;
+  }
+  .el-table__footer-wrapper tbody td.el-table__cell,
+  .el-table__header-wrapper tbody td.el-table__cell,
+  .el-table th.el-table__cell > .cell {
+    color: #000 !important;
+  }
+}
+</style>

+ 2 - 0
src/views/purchase/purchase-order/see/index.vue

@@ -324,6 +324,8 @@ export default {
                 :placeholder="column.placeholder"
                 :clearable="column.clearable"
                 readonly
+                :maxlength="column.maxlength"
+                show-word-limit
                 style="width: 100%"
               ></el-input>