Browse Source

问题修复

liangbowen 1 month ago
parent
commit
5b3be871ef

+ 9 - 9
src/views/components/printTable.vue

@@ -1,11 +1,14 @@
 <template>
   <div>
     <div v-for="(im, inx) in taData" :key="inx">
+      <div style="width:100%;height:50px;text-align:center;line-height:50px;">
+        {{ userName }}
+      </div>
       <table class="printTable" border="1" style="table-layout: auto">
         <thead>
-          <tr>
-            <td colspan="14">{{ userName }}</td>
-          </tr>
+          <!-- <tr>
+            <td colspan="14" stlye="border:none">{{ userName }}</td>
+          </tr> -->
         </thead>
         <thead>
           <tr>
@@ -36,9 +39,9 @@
           </tr>
           <tr>
             <td>合计</td>
-            <td colspan="6">{{ numBeroMount }}</td>
+            <td colspan="5">{{ numBeroMount }}</td>
             <td>{{ amtNumber(im) }}</td>
-            <td colspan="6"></td>
+            <td colspan="7"></td>
           </tr>
         </tbody>
       </table>
@@ -97,10 +100,7 @@ export default {
     }
   },
   mounted() {
-    let stopTime = moment(new Date())
-      .subtract(2, "months")
-      .startOf("month")
-      .format("YYYY-MM");
+    let stopTime = moment(new Date()).format("YYYY-MM-DD");
     this.time = stopTime;
     this.userName =
       this.$route.query.branchName +

+ 64 - 61
src/views/page/procurement-settlement/reconciliation/index.vue

@@ -2,7 +2,12 @@
   <!-- 业务对账 -->
   <div style="display: flex">
     <el-card style="width: 18%; margin-right: 18px; border-radius: 6px">
-      <el-tabs v-model="activeNametree" type="card" @tab-click="tabClick" stretch>
+      <el-tabs
+        v-model="activeNametree"
+        type="card"
+        @tab-click="tabClick"
+        stretch
+      >
         <!-- <el-tab-pane label="按分类" name="grp"></el-tab-pane> -->
         <el-tab-pane label="按机构" name="org"></el-tab-pane>
       </el-tabs>
@@ -33,10 +38,9 @@
               <p>暂无数据</p>
             </template>
             <el-table-column fixed type="index" label="序号" width="60" />
-            <el-table-column label="对账单号" prop="stmtNo">
-            </el-table-column>
-            <el-table-column label="客户名称" prop="branchName"  />
-            <el-table-column label="对账类型" prop="isFas"  >
+            <el-table-column label="对账单号" prop="stmtNo"> </el-table-column>
+            <el-table-column label="客户名称" prop="branchName" />
+            <el-table-column label="对账类型" prop="isFas">
               <template #default="{ row }">
                 <span v-if="row.isFas == '0'">非集采</span>
                 <span v-if="row.isFas == '1'">集采</span>
@@ -84,10 +88,9 @@
               <p>暂无数据</p>
             </template>
             <el-table-column fixed type="index" label="序号" width="60" />
-            <el-table-column label="对账单号" prop="stmtNo">
-            </el-table-column>
+            <el-table-column label="对账单号" prop="stmtNo"> </el-table-column>
             <el-table-column label="客户名称" prop="branchName" />
-            <el-table-column label="对账类型" prop="isFas" >
+            <el-table-column label="对账类型" prop="isFas">
               <template #default="{ row }">
                 <span v-if="row.isFas == '0'">非集采</span>
                 <span v-if="row.isFas == '1'">集采</span>
@@ -128,16 +131,14 @@
 <script>
 import ylPagination from "@/components/yl-pagination";
 import mcsInfo from "@/views/components/mcs-info.vue";
-import {
-  selectSpdList,
-} from "@/api/consumCataManage-sup/index";
-import {selectSetlStmtD} from "@/api/procurement-settlement/index"
+import { selectSpdList } from "@/api/consumCataManage-sup/index";
+import { selectSetlStmtD } from "@/api/procurement-settlement/index";
 import ylUpload from "@/components/yl-upload";
 export default {
   components: {
     ylPagination,
     ylUpload,
-    mcsInfo,
+    mcsInfo
   },
   data() {
     return {
@@ -146,17 +147,17 @@ export default {
       data: [],
       defaultProps: {
         children: "children",
-        label: "spdName",
+        label: "spdName"
       },
       listQuery: {
         current: 1,
         size: 10,
-        stas:"A"
+        stas: "A"
       },
       listQueryC: {
         current: 1,
         size: 10,
-        stas:"B"
+        stas: "B"
       },
       listLoading: false,
       list: [],
@@ -165,7 +166,7 @@ export default {
       totalC: 0,
       // tree
       activeNametree: "org",
-      routespdId:"",
+      routespdId: ""
     };
   },
   methods: {
@@ -185,12 +186,12 @@ export default {
       // this.spdId = this.$route.query.spdId;
       this.listQuery.spdId = this.spdId;
       selectSetlStmtD(this.listQuery)
-        .then((res) => {
+        .then(res => {
           this.list = res.data.records;
           this.total = res.data.total;
           this.listLoading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.listLoading = false;
         });
     },
@@ -199,12 +200,12 @@ export default {
       // this.spdId = this.$route.query.spdId;
       this.listQueryC.spdId = this.spdId;
       selectSetlStmtD(this.listQueryC)
-        .then((res) => {
+        .then(res => {
           this.listC = res.data.records;
           this.total = res.data.total;
           this.listLoading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.listLoading = false;
         });
     },
@@ -215,41 +216,40 @@ export default {
       this.spdId = data.spdId;
       this.listQuery.spdId = this.spdId;
       this.listQueryC.spdId = this.spdId;
-      if(this.activeNameTab=="first"){
+      if (this.activeNameTab == "first") {
         selectSetlStmtD(this.listQuery)
-        .then((res) => {
-          this.list = res.data.records;
-          this.total = res.data.total;
-          this.listLoading = false;
-        })
-        .catch((err) => {
-          this.listLoading = false;
-        });
-      }else{
+          .then(res => {
+            this.list = res.data.records;
+            this.total = res.data.total;
+            this.listLoading = false;
+          })
+          .catch(err => {
+            this.listLoading = false;
+          });
+      } else {
         selectSetlStmtD(this.listQueryC)
-        .then((res) => {
-          this.listC = res.data.records;
-          this.totalC = res.data.total;
-          this.listLoading = false;
-        })
-        .catch((err) => {
-          this.listLoading = false;
-        });
+          .then(res => {
+            this.listC = res.data.records;
+            this.totalC = res.data.total;
+            this.listLoading = false;
+          })
+          .catch(err => {
+            this.listLoading = false;
+          });
       }
-      
     },
     // 获取医院列表
     getData(type) {
       this.data = [];
       this.listLoading = true;
       selectSpdList()
-        .then((res) => {
+        .then(res => {
           this.listQuery.spdId = res.data[0].spdId;
           this.data = res.data;
           console.log(this.data, "dadad");
           this.listLoading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.listLoading = false;
         });
     },
@@ -263,7 +263,7 @@ export default {
     // 多选后选过的禁用
     selected(row, index) {
       if (
-        this.list.some((el) => {
+        this.list.some(el => {
           return el.hiCode === row.hiCode;
         })
       ) {
@@ -276,12 +276,12 @@ export default {
       console.log(tab.name, "name");
       if (tab.name == "first") {
         this.getList();
-      } else if(tab.name=="second") {
+      } else if (tab.name == "second") {
         this.getlistCom();
       }
     },
     // 详情
-    handleDetails(row){
+    handleDetails(row) {
       if (this.spdId) {
         this.routespdId = this.spdId;
       } else {
@@ -290,53 +290,56 @@ export default {
       this.$router.push({
         name: "supplierDetail",
         query: {
-          branchName:row.branchName,
+          branchName: row.branchName,
           stmtNo: row.stmtNo,
           branchName: row.branchName,
           isFas: row.isFas,
           amt: row.amt,
           stmtPrd: row.stmtPrd,
           stas: row.stas,
-          spdId:this.routespdId,
-          activeNameTab:this.activeNameTab,
-          detlCnt:row.detlCnt
-        },
+          spdId: this.routespdId,
+          activeNameTab: this.activeNameTab,
+          detlCnt: row.detlCnt
+        }
       });
     }
   },
   mounted() {
     this.getData();
-    if (this.$route.query.spdId && this.$route.query.activeNameTab=="first") {
+    if (this.$route.query.spdId && this.$route.query.activeNameTab == "first") {
       this.listQuery.spdId = this.$route.query.spdId;
-      this.activeNameTab ="first"
+      this.activeNameTab = "first";
       selectSetlStmtD(this.listQuery)
-        .then((res) => {
+        .then(res => {
           this.list = res.data.records;
           this.total = res.data.total;
           this.listLoading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.listLoading = false;
         });
-    }else if(this.$route.query.spdId && this.$route.query.activeNameTab=="second"){
-      this.activeNameTab ="second"
+    } else if (
+      this.$route.query.spdId &&
+      this.$route.query.activeNameTab == "second"
+    ) {
+      this.activeNameTab = "second";
       this.listQueryC.spdId = this.$route.query.spdId;
       selectSetlStmtD(this.listQueryC)
-        .then((res) => {
+        .then(res => {
           this.listC = res.data.records;
           this.totalC = res.data.total;
           this.listLoading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.listLoading = false;
         });
     }
-    if(this.$route.query.msgRouteUni && this.$route.query.spdId){
+    if (this.$route.query.msgRouteUni && this.$route.query.spdId) {
       this.listQuery.spdId = this.$route.query.spdId;
       this.listQuery.stmtNo = this.$route.query.msgRouteUni;
-      this.getList()
+      this.getList();
     }
-  },
+  }
 };
 </script>
 

+ 95 - 123
src/views/page/procurement-settlement/reconciliation/supplierDetail.vue

@@ -2,12 +2,16 @@
   <!-- 耗材退货管理————待确认 -->
   <div>
     <el-card>
-    <div style="text-align:right">
-      <el-button type="primary" @click.stop="printDataView()">打印</el-button>
-      <el-button type="primary" v-if="isShow" @click="handleConfirm" :loading="sureLoading"
-        >确 认</el-button
-      >
-    </div>
+      <div style="text-align: right">
+        <el-button type="primary" @click.stop="printDataView">打印</el-button>
+        <el-button
+          type="primary"
+          v-if="isShow"
+          @click="handleConfirm"
+          :loading="sureLoading"
+          >确 认</el-button
+        >
+      </div>
     </el-card>
     <div class="common-card">
       <h3>基本信息</h3>
@@ -58,8 +62,8 @@
     <div class="common-card">
       <h3>明细信息</h3>
       <div class="right-btn">
-          <el-button type="primary" @click.stop="exportExal()">导出</el-button>
-        </div>
+        <el-button type="primary" @click.stop="exportExal()">导出</el-button>
+      </div>
       <div>
         <el-table
           ref="table"
@@ -69,68 +73,65 @@
           show-summary
           :summary-method="getSummaries"
           :span-method="arraySpanMethod"
-          show-summary
           :header-cell-style="getRowClass"
           class="print-table"
-          >
+        >
           <template slot="empty">
             <img src="@/assets/nopage.png" alt />
             <p>暂无数据</p>
           </template>
-          <el-table-column
-            :label="tableLabel"
-            align="center"      
-            >
-          <!-- :header-cell-style="{background:'#ccc',borderColor:'#000'}" -->
-          <el-table-column type="index" label="序号" border  align="center"/>
-          <el-table-column label="耗材名称" prop="prodName" align="center"/>
-          <el-table-column label="规格" prop="spec"align="center" />
-          <el-table-column label="型号" prop="mol" align="center">
-          </el-table-column>
-          <el-table-column label="数量" prop="cnt" align="center"/>
-          <el-table-column label="单位" prop="unt" align="center"/>
-          <el-table-column label="单价" prop="pric" align="center"/>
-          <el-table-column label="总计" prop="amt" align="center"/>
-          <el-table-column label="类别" prop="mcsType" align="center">
-            <template #default="{ row }">
+          <el-table-column :label="tableLabel" align="center">
+            <!-- :header-cell-style="{background:'#ccc',borderColor:'#000'}" -->
+            <el-table-column type="index" label="序号" border align="center" />
+            <el-table-column label="耗材名称" prop="prodName" align="center" />
+            <el-table-column label="规格" prop="spec" align="center" />
+            <el-table-column label="型号" prop="mol" align="center">
+            </el-table-column>
+            <el-table-column label="数量" prop="cnt" align="center" />
+            <el-table-column label="单位" prop="unt" align="center" />
+            <el-table-column label="单价" prop="pric" align="center" />
+            <el-table-column label="总计" prop="amt" align="center" />
+            <el-table-column label="类别" prop="mcsType" align="center">
+              <template #default="{ row }">
                 <span v-if="row.mcsType == '0'">普通耗材</span>
                 <span v-if="row.mcsType == '1'">高值耗材</span>
                 <span v-if="row.mcsType == '2'">试剂</span>
               </template>
-          </el-table-column>
-          <el-table-column label="是否集采" prop="isFas" align="center">
+            </el-table-column>
+            <el-table-column label="是否集采" prop="isFas" align="center">
               <template #default="{ row }">
                 <span v-if="row.isFas == '0'">非集采</span>
                 <span v-if="row.isFas == '1'">集采</span>
               </template>
+            </el-table-column>
+            <el-table-column label="批次" prop="lotNum" align="center">
+            </el-table-column>
+            <el-table-column label="生产日期" prop="manuDate" align="center" />
+            <el-table-column label="有效期" prop="prodExpy" align="center" />
+            <el-table-column label="厂商" prop="prodEntp" align="center" />
           </el-table-column>
-          <el-table-column label="批次" prop="lotNum" align="center">
-          </el-table-column>
-          <el-table-column label="生产日期" prop="manuDate" align="center"/>
-          <el-table-column label="有效期" prop="prodExpy" align="center"/>
-          <el-table-column label="厂商" prop="prodEntp" align="center"/>
-          </el-table-column>
-          </el-table-column>
-          <p class="price-css">共计{{total}}条</p>
+          <p class="price-css">共计{{ total }}条</p>
         </el-table>
         <el-dialog
-      title="预览"
-      :visible.sync="comModal"
-      width="70%"
-      :before-close="comhandleClose"
-      destroy-on-close
-      append-to-body
-    >
-    <div id="printMe"> <printTable :tableHeader="tableHeader" :tableData="list" /></div>
-      <span slot="footer" class="dialog-footer">
-        <el-button type="primary" v-print="printObj">打印</el-button>
-      </span>
-    </el-dialog>
+          title="预览"
+          :visible.sync="comModal"
+          width="70%"
+          :before-close="comhandleClose"
+          destroy-on-close
+          append-to-body
+        >
+          <div id="printMe">
+            <printTable :tableHeader="tableHeader" :tableData="list" />
+          </div>
+          <span slot="footer" class="dialog-footer">
+            <el-button type="primary" v-print="printObj">打印</el-button>
+          </span>
+        </el-dialog>
       </div>
       <div class="foot-button">
-      <el-button type="info" @click="handleBack">返 回</el-button>
-    </div>
-        <!-- <p class="price-css">合计数量:{{}} <span></span>合计金额: {{}}</p> -->
+        <el-button type="info" @click="handleBack">返 回</el-button>
+      </div>
+      <!-- <p class="price-css">合计数量:{{}} <span></span>合计金额: {{}}</p> -->
     </div>
   </div>
 </template>
@@ -142,12 +143,12 @@ import mcsInfo from "@/views/components/mcs-info.vue";
 import printTable from "@/views/components/printTable.vue";
 import {
   selectRetnDetl,
-  acpRetnOrd,
+  acpRetnOrd
 } from "@/api/productreturnmanage-sup/returnList";
 import {
   selectSetlStmtDetlD,
   updateSetlStmtDStas,
-  exportAllSetlExcel,
+  exportAllSetlExcel
 } from "@/api/procurement-settlement/index";
 import { exportData } from "../../consumCataManage-sup/const.js";
 export default {
@@ -155,67 +156,67 @@ export default {
     ylStep,
     ylPagination,
     mcsInfo,
-    printTable,
+    printTable
   },
   data() {
     return {
       tableHeader: [
         {
           label: "序号",
-          value: "serial",
+          value: "serial"
         },
         {
           label: "耗材名称",
-          value: "prodName",
+          value: "prodName"
         },
         {
           label: "规格",
-          value: "spec",
-        },
-        {
-          label: "型号",
-          value: "mol",
+          value: "spec"
         },
+        // {
+        //   label: "型号",
+        //   value: "mol"
+        // },
         {
           label: "数量",
-          value: "cnt",
+          value: "cnt"
         },
         {
           label: "单位",
-          value: "unt",
+          value: "unt"
         },
         {
           label: "单价",
-          value: "pric",
+          value: "pric"
         },
         {
           label: "总计(元)",
-          value: "amt",
+          value: "amt"
         },
         {
           label: "类别",
-          value: "mcType",
+          value: "mcType"
         },
         {
           label: "是否集采",
-          value: "iFas",
+          value: "iFas"
         },
         {
           label: "批次",
-          value: "lotNum",
+          value: "lotNum"
         },
         {
           label: "生产日期",
-          value: "manuDate",
+          value: "manuDate"
         },
         {
           label: "有效期至",
-          value: "prodExpy",
+          value: "prodExpy"
         },
         {
           label: "厂商",
-          value: "prodEntp",
-        },
+          value: "prodEntp"
+        }
       ],
       total: "",
       comModal: false,
@@ -225,15 +226,15 @@ export default {
         isFas: "",
         amt: "",
         stmtPrd: "",
-        stas: "",
+        stas: ""
       },
       stasOptions: [
         { value: "A", lable: "待确认" },
-        { value: "B", lable: "已确认" },
+        { value: "B", lable: "已确认" }
       ],
       isFasOptions: [
         { value: "0", lable: "非集采" },
-        { value: "1", lable: "集采" },
+        { value: "1", lable: "集采" }
       ],
       listLoading: false,
       list: [],
@@ -250,35 +251,6 @@ export default {
         previewTitle: "", // 打印预览的标题(开启预览模式后出现),
         previewPrintBtnLabel: "", // 打印预览的标题的下方按钮文本,点击可进入打印(开启预览模式后出现)
         zIndex: "", // 预览的窗口的z-index,默认是 20002(此值要高一些,这涉及到预览模式是否显示在最上面)
-        beforeEntryIframe() {
-          const cells = document.querySelectorAll(".cell");
-          for (let k7 = 0; k7 < cells.length; k7++) {
-            const cell = cells[k7];
-            // 在这里添加样式只是修改了打印的样式,不会污染原页面的样式
-            // 为了让表格中的内容自动换行,不需要的话可以删掉
-            cell.style.whiteSpace = "pre-wrap";
-          }
-        },
-        // beforeEntryIframe(copy) {
-        //   console.log(copy,"copy")
-        //   // copy是ele对象的深度拷贝,修改copy对象不会更改页面中table表格的样式,只会更改打印预览生成的表格的样式
-        //   const cells = copy.querySelectorAll('.cell');
-        //   const tableNode = copy.querySelectorAll('.el-table__header,.el-table__body');
-        //   ;[].slice.call(cells).forEach(item => {
-        //     // 为了让表格中的内容自动换行,不需要的话可以删掉
-        //     item.style.whiteSpace = 'pre-wrap'
-        //   })
-        //   // el-table打印不全的问题
-        //   ;[].slice.call(tableNode).forEach(item => {
-        //     item.style.width = '100%';
-        //     const child = item.childNodes;
-        //     ;[].slice.call(child).forEach(element => {
-        //       if(element.localName === 'colgroup') {
-        //         element.innerHTML = ''
-        //       }
-        //     })
-        //   })
-        // },
         previewBeforeOpenCallback() {}, //预览窗口打开之前的callback(开启预览模式调用)
         previewOpenCallback() {}, // 预览窗口打开之后的callback(开启预览模式调用)
         beforeOpenCallback: () => {}, // 开启打印前的回调事件
@@ -286,8 +258,8 @@ export default {
         closeCallback() {}, //关闭打印的回调事件(无法确定点击的是确认还是取消)
         url: "",
         standard: "",
-        extraCss: "",
-      },
+        extraCss: ""
+      }
     };
   },
   created() {
@@ -301,12 +273,12 @@ export default {
     this.listForm.branchName = this.$route.query.branchName;
     this.listForm.amt = this.$route.query.amt;
     this.listForm.stmtPrd = this.$route.query.stmtPrd;
-    this.stasOptions.forEach((i) => {
+    this.stasOptions.forEach(i => {
       if (i.value == this.$route.query.stas) {
         this.listForm.stas = i.lable;
       }
     });
-    this.isFasOptions.forEach((i) => {
+    this.isFasOptions.forEach(i => {
       if (i.value == this.$route.query.isFas) {
         this.listForm.isFas = i.lable;
       }
@@ -321,8 +293,8 @@ export default {
       exportAllSetlExcel({
         stmtNo: this.$route.query.stmtNo,
         spdName: this.$route.query.branchName,
-        stmtPrd: this.$route.query.stmtPrd,
-      }).then((res) => {
+        stmtPrd: this.$route.query.stmtPrd
+      }).then(res => {
         const _res = res.data;
         exportData(_res, "对账明细");
       });
@@ -359,7 +331,7 @@ export default {
           return;
         }
         if (index === 7) {
-          const values = data.map((item) => Number(item[column.property]));
+          const values = data.map(item => Number(item[column.property]));
           sums[1] = values.reduce((prev, curr) => {
             return prev + curr;
           }, 0);
@@ -372,12 +344,12 @@ export default {
     getData() {
       this.listLoading = true;
       selectSetlStmtDetlD({ stmtNo: this.$route.query.stmtNo })
-        .then((res) => {
+        .then(res => {
           this.list = res.data;
           this.total = this.$route.query.detlCnt;
           this.listLoading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.listLoading = false;
         });
     },
@@ -386,16 +358,16 @@ export default {
       this.$confirm("确认对账", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       }).then(() => {
         this.sureLoading = true;
         let data = {
           stmtNo: this.$route.query.stmtNo,
           spdId: this.$route.query.spdId,
-          stas: "B",
+          stas: "B"
         };
         updateSetlStmtDStas(data)
-          .then((res) => {
+          .then(res => {
             if (res.success == true) {
               this.sureLoading = false;
               this.$message.success("操作成功");
@@ -403,15 +375,15 @@ export default {
                 name: "Reconciliation",
                 query: {
                   spdId: this.$route.query.spdId,
-                  activeNameTab: this.$route.query.activeNameTab,
-                },
+                  activeNameTab: this.$route.query.activeNameTab
+                }
               });
             } else {
               this.sureLoading = false;
               this.$message.error("确认失败");
             }
           })
-          .catch((err) => {
+          .catch(err => {
             this.sureLoading = false;
           });
       });
@@ -421,11 +393,11 @@ export default {
         name: "Reconciliation",
         query: {
           spdId: this.$route.query.spdId,
-          activeNameTab: this.$route.query.activeNameTab,
-        },
+          activeNameTab: this.$route.query.activeNameTab
+        }
       });
-    },
-  },
+    }
+  }
 };
 </script>