Browse Source

采购订单出库修改问题

liangbowen 10 months ago
parent
commit
4bc055344e

+ 33 - 17
src/utils/rules.js

@@ -37,7 +37,7 @@ export function checkInterNum(rule, value, callback) {
   }
 }
 
-// 汉字 
+// 汉字
 export function checkChinese(rule, value, callback) {
   const reg = /^[\u4e00-\u9fa5]+$/;
   if (!value) {
@@ -60,14 +60,27 @@ export function checkNatureNum(rule, value, callback) {
     callback();
   }
 }
+//耗材编码
+export function proCodeRule(rule, value, callback) {
+  const reg = new RegExp("^[C]+[0-9]{26}?$")
+  if (!value) {
+    return callback(new Error("请填写医保编码"));
+  } else if (!reg.test(value)) {
+    return callback(new Error("请输入正确的医保编码,27位,且必须为大写C开头,其余是数字"));
+  } else {
+    callback();
+  }
+}
 
 // 联系方式
 const checkPhoneNum = (rule, value, callback) => {
-  const reg = new RegExp('^1\\d{10}$|^(0\\d{2,3}-?|\\(0\\d{2,3}\\))?[1-9]\\d{4,7}(-\\d{1,8})?$');
+  const reg = new RegExp(
+    "^1\\d{10}$|^(0\\d{2,3}-?|\\(0\\d{2,3}\\))?[1-9]\\d{4,7}(-\\d{1,8})?$"
+  );
   if (!value) {
     return callback(new Error("请输入正确的联系方式"));
   } else if (!reg.test(value)) {
-    return callback(new Error('请输入正确的联系方式(手机号或电话号码)'));
+    return callback(new Error("请输入正确的联系方式(手机号或电话号码)"));
   } else {
     callback();
   }
@@ -77,11 +90,11 @@ const checkPhoneNum = (rule, value, callback) => {
 const checkEmail = (rule, value, callback) => {
   const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
   if (!value) {
-    callback(new Error('邮箱不能为空'));
+    callback(new Error("邮箱不能为空"));
   } else if (mailReg.test(value)) {
     callback();
   } else {
-    callback(new Error('请输入正确的邮箱格式'));
+    callback(new Error("请输入正确的邮箱格式"));
   }
 };
 
@@ -89,11 +102,11 @@ const checkEmail = (rule, value, callback) => {
 const checkCard = (rule, value, callback) => {
   const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
   if (!value) {
-    callback(new Error('证件号码不能为空'));
+    callback(new Error("证件号码不能为空"));
   } else if (reg.test(value)) {
     callback();
   } else {
-    callback(new Error('请输入正确的证件号码'));
+    callback(new Error("请输入正确的证件号码"));
   }
 };
 
@@ -103,23 +116,24 @@ export default {
       required: true,
       pattern: /^1[34578]\d{9}$/,
       message: "目前只支持中国大陆的手机号码",
-      trigger: "blur",
-    },
+      trigger: "blur"
+    }
   ],
-  numPotNo:[
+  numPotNo: [
     {
-      pattern:/^\d+(?:\.\d{1,4})?$/,
+      pattern: /^\d+(?:\.\d{1,4})?$/,
       message: "请输入正数,最多4位小数",
-      trigger: "blur",
+      trigger: "blur"
     }
   ],
-  InterEng:[
+  InterEng: [
     {
-      pattern:/^[a-zA-Z\s]+$/,
+      pattern: /^[a-zA-Z\s]+$/,
       message: "只包含英文字母和空格",
-      trigger: "blur",
+      trigger: "blur"
     }
   ],
+  proCodeRule:[{ required: true, validator: proCodeRule, trigger: "blur" }],
   numPot2: [{ required: true, validator: checkNumPot2, trigger: "blur" }],
   numPot4: [{ required: true, validator: checkNumPot4, trigger: "blur" }],
   InterNum: [{ required: true, validator: checkInterNum, trigger: "blur" }],
@@ -130,8 +144,10 @@ export default {
   card: [{ required: true, validator: checkCard, trigger: "blur" }],
   required: [{ required: true, message: "请输入", trigger: "blur" }],
   selectRequired: [{ required: true, message: "请选择", trigger: "change" }],
-  uploadRequired: [{ required: true, message: "请上传文件", trigger: "change" }],
-  dateRequired: [{ required: true, message: '请选择日期', trigger: 'blur' }],
+  uploadRequired: [
+    { required: true, message: "请上传文件", trigger: "change" }
+  ],
+  dateRequired: [{ required: true, message: "请选择日期", trigger: "blur" }],
   loginId: [{ required: true, message: "请填写账号", trigger: "blur" }],
   password: [{ required: true, message: "请填写密码", trigger: "blur" }],
   noRequire: [{ required: false }]

+ 9 - 13
src/views/page/consumCataManage-sup/catalogdetails.vue

@@ -562,15 +562,11 @@
           prop="quaName"
           :rules="rules.selectRequired"
         >
-          <el-select v-model.trim="addform.quaName" placeholder="请选择资质证书信息">
-            <el-option
-              v-for="item in qualData"
-              :key="item.id"
-              :label="item.dicVal"
-              :value="item.dicVal"
-              clearable
-            ></el-option>
-          </el-select>
+          <el-input
+            v-model="addform.quaName"
+            placeholder="请输入资质证书信息"
+            maxlength="50"
+          ></el-input>
         </el-form-item>
         <el-form-item label="资质证书编号" prop="quaCode" :rules="rules.required">
           <el-input
@@ -846,11 +842,11 @@ export default {
     } else {
       this.editCode = true;
     }
-     let qeryData = this.$route.query;
+    let qeryData = this.$route.query;
     if (qeryData.isPub == undefined || qeryData.isPub == "0") {
       this.infoData.isFas = "0";
-    }else{
-        this.infoData.isFas = "1";
+    } else {
+      this.infoData.isFas = "1";
     }
   },
   methods: {
@@ -1044,7 +1040,7 @@ export default {
               if (this.dialogStatus == "one") {
                 this.addform.splerId = this.$store.state.user.orgId;
                 this.addform.hiCode = this.infoData.hiCode;
-                this.addform.endDate = this.selectedDate;
+                // this.addform.endDate = this.selectedDate;
                 insertMcsQua(this.addform)
                   .then((response) => {
                     this.$message({

+ 1 - 1
src/views/page/consumCataManage-sup/catalogdetailsadd.vue

@@ -263,7 +263,7 @@
                 <el-form-item
                   label="医保编码"
                   prop="hiCode"
-                  :rules="rules.required"
+                  :rules="rules.proCodeRule"
                 >
                   <el-input
                     v-model="infoData.hiCode"

+ 58 - 46
src/views/page/orderManage-sup/purOrderAccept/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>
@@ -25,7 +30,10 @@
         <el-tab-pane label="待确认" name="first">
           <el-form :model="listQuery" ref="queryForm" :inline="true">
             <el-form-item label="采购单号" prop="id" class="long">
-              <el-input v-model="listQuery.id" placeholder="请输入采购单号"></el-input>
+              <el-input
+                v-model="listQuery.id"
+                placeholder="请输入采购单号"
+              ></el-input>
             </el-form-item>
             <el-form-item label="客户名称" prop="branchName" class="long">
               <el-input
@@ -52,7 +60,9 @@
               />
             </el-form-item>
             <el-form-item>
-              <el-button type="primary" @click="getorderData('search')">查询 </el-button>
+              <el-button type="primary" @click="getorderData('search')"
+                >查询
+              </el-button>
               <el-button @click="reset">重置</el-button>
             </el-form-item>
           </el-form>
@@ -87,16 +97,15 @@
               <template #default="{ row }">
                 <span v-if="row.stas == 'A'">未受理</span>
                 <span v-if="row.stas == 'B'">已受理</span>
-                <span v-if="row.stas == 'R'">被驳回</span>
-                <span v-if="row.stas == 'C'">已出库</span>
-                <span v-if="row.stas == 'D'">部分出库</span>
-                <span v-if="row.stas == 'Y'">已入库</span>
-                <span v-if="row.stas == 'P'">部分入库</span>
+                <span v-if="row.stas == 'C'">已退回</span>
+                <span v-if="row.stas == 'D'">已关闭</span>
               </template>
             </el-table-column>
             <el-table-column label="操作" width="100">
               <template slot-scope="scope">
-                <el-button type="text" @click="handleDetail(scope.row)">详情</el-button>
+                <el-button type="text" @click="handleDetail(scope.row)"
+                  >详情</el-button
+                >
               </template>
             </el-table-column>
           </el-table>
@@ -112,7 +121,10 @@
         <el-tab-pane label="已确认" name="second">
           <el-form :model="listQueryC" ref="queryFormC" :inline="true">
             <el-form-item label="采购单号" prop="id" class="long">
-              <el-input v-model="listQueryC.id" placeholder="请输入采购单号"></el-input>
+              <el-input
+                v-model="listQueryC.id"
+                placeholder="请输入采购单号"
+              ></el-input>
             </el-form-item>
             <el-form-item label="客户名称" prop="branchName" class="long">
               <el-input
@@ -139,7 +151,9 @@
               />
             </el-form-item>
             <el-form-item>
-              <el-button type="primary" @click="getorderDataC('search')">查询 </el-button>
+              <el-button type="primary" @click="getorderDataC('search')"
+                >查询
+              </el-button>
               <el-button @click="resetC">重置</el-button>
             </el-form-item>
           </el-form>
@@ -173,21 +187,19 @@
             </el-table-column>
             <el-table-column label="受理人" prop="acper" />
             <el-table-column label="受理时间" prop="acpDate" width="160" />
-            <el-table-column label="状态" prop="stas" width="100px"> 
+            <el-table-column label="状态" prop="stas" width="100px">
               <template #default="{ row }">
                 <span v-if="row.stas == 'A'">未受理</span>
                 <span v-if="row.stas == 'B'">已受理</span>
-                <span v-if="row.stas == 'R'">被驳回</span>
-                <span v-if="row.stas == 'C'">已出库</span>
-                <span v-if="row.stas == 'D'">部分出库</span>
-                <span v-if="row.stas == 'Y'">已入库</span>
-                <span v-if="row.stas == 'P'">部分入库</span>
-                <span v-if="row.stas == 'E'">订单已结束</span>
+                <span v-if="row.stas == 'C'">已退回</span>
+                <span v-if="row.stas == 'D'">已关闭</span>
               </template>
             </el-table-column>
             <el-table-column label="操作" width="100" fixed="right">
               <template slot-scope="scope">
-                <el-button type="text" @click="handleDetail1(scope.row)">详情</el-button>
+                <el-button type="text" @click="handleDetail1(scope.row)"
+                  >详情</el-button
+                >
               </template>
             </el-table-column>
           </el-table>
@@ -210,11 +222,11 @@ import ylPagination from "@/components/yl-pagination";
 import {
   getMcsOrdPageSpler,
   getMcsOrdPageYqrSpler,
-  selectSpdList,
+  selectSpdList
 } from "@/api/orderManage-sup/index";
 export default {
   components: {
-    ylPagination,
+    ylPagination
   },
   data() {
     return {
@@ -224,7 +236,7 @@ export default {
       spdId: null,
       defaultProps: {
         children: "children",
-        label: "spdName",
+        label: "spdName"
       },
       listQuery: {
         current: 1,
@@ -236,7 +248,7 @@ export default {
         docmkDate: [],
         stas: "",
         branchName: "",
-        spdId: "",
+        spdId: ""
       },
       listQueryC: {
         current: 1,
@@ -248,7 +260,7 @@ export default {
         docmkDate: [],
         stas: "",
         branchName: "",
-        spdId: "",
+        spdId: ""
       },
       stasOptions: [
         { value: "A", lable: "未受理" },
@@ -257,14 +269,14 @@ export default {
         { value: "C", lable: "已出库" },
         { value: "D", lable: "部分出库" },
         { value: "Y", lable: "已入库" },
-        { value: "P", lable: "部分入库" },
+        { value: "P", lable: "部分入库" }
       ],
       options: [],
       listLoading: false,
       list: [],
       listC: [],
       total: 0,
-      totalC: 0,
+      totalC: 0
     };
   },
   mounted() {
@@ -272,12 +284,12 @@ export default {
     if (this.$route.query.spdId && this.$route.query.activeName == "first") {
       this.listQuery.spdId = this.$route.query.spdId;
       getMcsOrdPageSpler(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;
         });
     }
@@ -285,19 +297,19 @@ export default {
       this.activeName = "second";
       this.listQueryC.spdId = this.$route.query.spdId;
       getMcsOrdPageYqrSpler(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){
+    if (this.$route.query.msgRouteUni) {
       this.listQuery.spdId = this.$route.query.spdId;
       this.listQuery.id = this.$route.query.msgRouteUni;
-      this.getorderData()
+      this.getorderData();
     }
   },
   methods: {
@@ -322,12 +334,12 @@ export default {
     getData(type) {
       this.data = [];
       selectSpdList()
-        .then((res) => {
+        .then(res => {
           this.listQuery.spdId = res.data[0].spdId;
           this.data = res.data;
           // console.log(this.data, "dadad");
         })
-        .catch((err) => {});
+        .catch(err => {});
     },
     getorderData(type) {
       if (type == "search") {
@@ -337,12 +349,12 @@ export default {
       this.listQuery.docmkDateStart = this.listQuery.docmkDate[0];
       this.listQuery.docmkDateEnd = this.listQuery.docmkDate[1];
       getMcsOrdPageSpler(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;
         });
       // getMcsOrdPageSpler().then(res =>{
@@ -358,13 +370,13 @@ export default {
       this.spdId = data.spdId;
       this.listQuery.spdId = this.spdId;
       getMcsOrdPageSpler(this.listQuery)
-        .then((res) => {
+        .then(res => {
           this.list = res.data.records;
           this.total = res.data.total;
           this.listLoading = false;
           // console.log(res, "医院目录");
         })
-        .catch((err) => {
+        .catch(err => {
           this.listLoading = false;
         });
     },
@@ -392,8 +404,8 @@ export default {
           oprtRoom: row.oprtRoom,
           oprtTime: row.oprtTime,
           atddr: row.atddr,
-          purcType: row.purcType,
-        },
+          purcType: row.purcType
+        }
       });
     },
     getorderDataC(type) {
@@ -405,12 +417,12 @@ export default {
       this.listQueryC.docmkDateStart = this.listQueryC.docmkDate[0];
       this.listQueryC.docmkDateEnd = this.listQueryC.docmkDate[1];
       getMcsOrdPageYqrSpler(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;
         });
       // getMcsOrdPageYqrSpler().then(res =>{
@@ -441,11 +453,11 @@ export default {
           oprtRoom: row.oprtRoom,
           oprtTime: row.oprtTime,
           atddr: row.atddr,
-          purcType: row.purcType,
-        },
+          purcType: row.purcType
+        }
       });
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 6 - 3
src/views/page/orderManage-sup/purOrderDelivery/deliveryDetail.vue

@@ -847,8 +847,8 @@ export default {
     this.getData();
   },
   methods: {
-    scopIndex(index){
-       console.log(index,'3303');
+    scopIndex(index) {
+      return index + 1;
     },
     lotNumCheck(row, ruleArray) {
       let rule = [];
@@ -1431,7 +1431,10 @@ export default {
             this.$router.push({
               name: "devsuccs",
               query: {
-                form: JSON.stringify(this.listForm),
+                form: JSON.stringify({
+                  ...this.listForm,
+                  delvOrdId: res.data.id,
+                }),
                 data: JSON.stringify(this.multipleSelection),
               },
             });

+ 27 - 9
src/views/page/orderManage-sup/purOrderDelivery/devsuccs.vue

@@ -2,7 +2,10 @@
   <div class="wrap-print">
     <h2 v-if="!listForm.delvOrdId">出库成功</h2>
     <div class="btn-wrap">
-      <el-button type="primary" @click="breakView()" v-if="!listForm.delvOrdId">返回待出库</el-button>
+      <el-button type="primary" @click="breakView()" v-if="!listForm.delvOrdId"
+        >返回待出库</el-button
+      >
+      <el-button type="primary" @click="detailsData()">出库详情</el-button>
       <el-button type="primary" v-print="printObj">打印出库单</el-button>
     </div>
     <el-card class="box-card">
@@ -12,10 +15,11 @@
 </template>
 <script>
 import printView from "./printView.vue";
+import { getSplerMcsDelvOrdPage } from "@/api/orderManage-sup/index";
 export default {
   name: "successView",
   components: {
-    printView,
+    printView
   },
   props: {},
   data() {
@@ -38,8 +42,8 @@ export default {
         closeCallback() {}, //关闭打印的回调事件(无法确定点击的是确认还是取消)
         url: "",
         standard: "",
-        extraCss: "",
-      },
+        extraCss: ""
+      }
     };
   },
   created() {
@@ -49,17 +53,31 @@ export default {
   },
   mounted() {},
   methods: {
+    //跳转出库详情
+    detailsData() {
+      getSplerMcsDelvOrdPage({
+        delvOrdId: this.listForm.delvOrdId,
+        purcOrdId: this.listForm.id
+      }).then(res => {
+        let data = res.data.records[0];
+        this.$router.push({
+          name: "alreadyDetail",
+          query: {
+            ...data,
+            spdId: this.$route.query.form.spdId
+          }
+        });
+      });
+    },
     //返回待出库
     breakView() {
       this.$router.push({
         path: "/orderManage-sup/purOrderDelivery",
-        query: {
-      
-        },
+        query: {}
       });
-    },
+    }
   },
-  watch: {},
+  watch: {}
 };
 </script>
 <style scoped lang="scss">

+ 31 - 31
src/views/page/orderManage-sup/purOrderDelivery/index.vue

@@ -108,8 +108,8 @@
               </template>
             </el-table-column>
             <el-table-column label="采购时间" prop="docmkDate" width="140" />
-            <el-table-column label="状态" prop="stas">
-              <!-- <template #default="{ row }">
+            <!-- <el-table-column label="状态" prop="stas">
+              <template #default="{ row }">
               <span v-if="row.stas == 'A'">未受理</span>
               <span v-if="row.stas == 'B'">未出库</span>
               <span v-if="row.stas == 'R'">被驳回</span>
@@ -117,8 +117,8 @@
               <span v-if="row.stas == 'D'">部分出库</span>
               <span v-if="row.stas == 'Y'">已入库</span>
               <span v-if="row.stas == 'P'">部分入库</span>
-            </template> -->
-            </el-table-column>
+            </template>
+            </el-table-column> -->
             <el-table-column label="操作" width="100" fixed="right">
               <template slot-scope="scope">
                 <el-button type="text" @click="handleDetail(scope.row)"
@@ -224,7 +224,7 @@
             </el-table-column>
             <el-table-column label="出库员" prop="docmker" />
             <el-table-column label="出库时间" prop="docmkDate" width="140" />
-            <el-table-column label="状态" prop="delvOrdStas" width="100">
+            <!-- <el-table-column label="状态" prop="delvOrdStas" width="100">
               <template #default="{ row }">
                 <span v-if="row.delvOrdStas == 'A'">未受理</span>
                 <span v-if="row.delvOrdStas == 'B'">已受理</span>
@@ -235,7 +235,7 @@
                 <span v-if="row.delvOrdStas == 'P'">部分入库</span>
                 <span v-if="row.delvOrdStas == 'E'">订单已结束</span>
               </template>
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column label="操作" width="100" fixed="right">
               <template slot-scope="scope">
                 <el-button type="text" @click="handleDetailC(scope.row)"
@@ -263,11 +263,11 @@ import ylPagination from "@/components/yl-pagination";
 import {
   getMcsOrdDck,
   getSplerMcsDelvOrdPage,
-  selectSpdList,
+  selectSpdList
 } from "@/api/orderManage-sup/index";
 export default {
   components: {
-    ylPagination,
+    ylPagination
   },
   data() {
     return {
@@ -276,7 +276,7 @@ export default {
       spdId: null,
       defaultProps: {
         children: "children",
-        label: "spdName",
+        label: "spdName"
       },
       activeName: "first",
       listQuery: {
@@ -288,7 +288,7 @@ export default {
         docmkDateEnd: "",
         docmkDate: [],
         stas: "",
-        spdId: "",
+        spdId: ""
       },
       listQueryC: {
         current: 1,
@@ -298,14 +298,14 @@ export default {
         docmkDate: "",
         delvOrdId: "",
         docmkDateEnd: "",
-        branchName: "",
+        branchName: ""
       },
       stasOptions: [
         // {value: 'A', lable: "未受理"},
         { value: "B", lable: "未出库" },
         // {value: 'R', lable: "被驳回"},
         { value: "C", lable: "已出库" },
-        { value: "D", lable: "部分出库" },
+        { value: "D", lable: "部分出库" }
         // {value: 'Y', lable: "已入库"},
         // {value: 'P', lable: "部分入库"}
       ],
@@ -314,7 +314,7 @@ export default {
       listC: [],
       total: 0,
       totalC: 0,
-      routespdId: "",
+      routespdId: ""
     };
   },
   mounted() {
@@ -322,12 +322,12 @@ export default {
     if (this.$route.query.spdId && this.$route.query.activeName == "first") {
       this.listQuery.spdId = this.$route.query.spdId;
       getMcsOrdDck(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;
         });
     }
@@ -335,12 +335,12 @@ export default {
       this.activeName = "second";
       this.listQueryC.spdId = this.$route.query.spdId;
       getSplerMcsDelvOrdPage(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;
         });
     }
@@ -374,13 +374,13 @@ export default {
     getData(type) {
       this.data = [];
       selectSpdList()
-        .then((res) => {
+        .then(res => {
           this.listQuery.spdId = res.data[0].spdId;
           this.listQueryC.spdId = res.data[0].spdId;
           this.data = res.data;
           this.getTableList(this.listQuery);
         })
-        .catch((err) => {});
+        .catch(err => {});
     },
     // 待出库列表
     getOutboundData(type) {
@@ -392,12 +392,12 @@ export default {
       this.listQuery.docmkDateStart = this.listQuery.docmkDate[0];
       this.listQuery.docmkDateEnd = this.listQuery.docmkDate[1];
       getMcsOrdDck(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;
         });
     },
@@ -412,12 +412,12 @@ export default {
     },
     getTableList(listQuery) {
       getMcsOrdDck(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;
         });
     },
@@ -452,8 +452,8 @@ export default {
           oprtRoom: row.oprtRoom,
           oprtTime: row.oprtTime,
           atddr: row.atddr,
-          purcType: row.purcType,
-        },
+          purcType: row.purcType
+        }
       });
     },
     // 已出库
@@ -466,12 +466,12 @@ export default {
       this.listQueryC.docmkDateStart = this.listQueryC.docmkDate[0];
       this.listQueryC.docmkDateEnd = this.listQueryC.docmkDate[1];
       getSplerMcsDelvOrdPage(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;
         });
     },
@@ -505,11 +505,11 @@ export default {
           oprtRoom: row.oprtRoom,
           oprtTime: row.oprtTime,
           atddr: row.atddr,
-          purcType: row.purcType,
-        },
+          purcType: row.purcType
+        }
       });
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 201 - 388
src/views/page/orderManage-sup/purOrderDelivery/purchaseDetails.vue

@@ -1,31 +1,42 @@
 <template>
   <!-- 采购明细出库 -->
   <div>
-    <div class="common-card">
+    <!-- <div class="common-card">
       <el-form :model="listForm" ref="planForm" :inline="true">
         <el-form-item label="采购单号" prop="dyntNo">
-          <el-input v-model="listForm.dyntNo" placeholder="请输入采购单号"></el-input>
+          <el-input
+            v-model="listForm.dyntNo"
+            placeholder="请输入采购单号"
+          ></el-input>
         </el-form-item>
         <el-form-item>
           <el-button type="primary" @click="getDetails('search')"
-            >提取采购明细
+            >查询
           </el-button>
         </el-form-item>
       </el-form>
-    </div>
+    </div> -->
     <div class="common-card">
-      <el-form :model="tableData" ref="tabledata">
+      <el-form :model="tableform" ref="tableform">
         <el-table
-          :data="tableData"
+          :data="tableform.tableData"
           v-loading="loding"
+          ref="tabelView"
           element-loading-text="加载中..."
           border
-          :span-method="handleSpan"
+          row-key="id"
+          height="500"
+          @selection-change="handleSelectionChange"
         >
           <template slot="empty">
             <img src="@/assets/nopage.png" alt />
             <p>暂无数据</p>
           </template>
+          <el-table-column
+            type="selection"
+            :reserve-selection="true"
+            width="55"
+          ></el-table-column>
           <el-table-column fixed type="index" label="序号" width="60" />
           <el-table-column label="采购单号" prop="purcOrdId" />
           <el-table-column label="耗材编码" prop="prodCode" />
@@ -44,16 +55,14 @@
               <el-form-item
                 label-width="0"
                 class="item"
-                :prop="scope.$index + '.lotNum'"
-                :rules="[
-                  {
-                    required: true,
-                    message: '请输入',
-                    trigger: 'blur',
-                  },
-                ]"
+                :prop="'tableData.' + scope.$index + '.lotNum'"
+                :rules="lotNumCheck(scope.row, lotNumRule)"
               >
-                <el-input placeholder="请输入" v-model="scope.row.lotNum"></el-input>
+                <el-input
+                  placeholder="请输入"
+                  v-model="scope.row.lotNum"
+                  @change="handleEDIT(scope.row, scope.$index)"
+                ></el-input>
               </el-form-item>
             </template>
           </el-table-column>
@@ -62,14 +71,8 @@
               <el-form-item
                 label-width="0"
                 class="item"
-                :prop="scope.$index + '.manuDate'"
-                :rules="[
-                  {
-                    required: true,
-                    message: '请选择生产日期',
-                    trigger: 'change',
-                  },
-                ]"
+                :prop="'tableData.' + scope.$index + '.manuDate'"
+                :rules="lotNumCheck(scope.row, manuDate)"
               >
                 <el-date-picker
                   style="width: 100%"
@@ -82,19 +85,13 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column label="有效期至" width="220" prop="prodExpy">
+          <el-table-column label="有效期至" width="220" props="prodExpy">
             <template slot-scope="scope">
               <el-form-item
                 label-width="0"
                 class="item"
-                :prop="scope.$index + '.prodExpy'"
-                :rules="[
-                  {
-                    required: true,
-                    message: '请选择有效期',
-                    trigger: 'change',
-                  },
-                ]"
+                :prop="'tableData.' + scope.$index + '.prodExpy'"
+                :rules="lotNumCheck(scope.row, prodExpyRule)"
               >
                 <el-date-picker
                   style="width: 100%"
@@ -107,28 +104,15 @@
               </el-form-item>
             </template>
           </el-table-column>
-          <!-- <el-table-column label="UDI码" prop="udid" >
-            <template slot-scope="scope">
-              <el-button type="text" @click="handleudi(scope.row)">10</el-button>
-              </template>
-          </el-table-column> -->
           <el-table-column label="需求数量" prop="purcCnt" />
-          <!-- <el-table-column label="已出库数量" prop="delvCntYck" width="90px" /> -->
           <el-table-column label="剩余出库量" prop="toDelvCnt" width="90px" />
-          <el-table-column label="出库数量" prop="delvCnt" width="150">
+          <el-table-column label="出库数量" props="delvCnt" width="150">
             <template slot-scope="scope">
               <el-form-item
                 label-width="0"
                 class="item"
-                :prop="scope.$index + '.delvCnt'"
-                :rules="[
-                  {
-                    required: true,
-                    pattern: /^[0-9]\d*$/,
-                    message: '请输入正整数',
-                    trigger: 'blur',
-                  },
-                ]"
+                :prop="'tableData.' + scope.$index + '.delvCnt'"
+                :rules="lotNumCheck(scope.row, delvCntRule)"
               >
                 <el-input-number
                   v-model="scope.row.delvCnt"
@@ -149,30 +133,29 @@
                 urlName="acco"
                 :index="scope.$index"
               >
-                <template v-slot:dec>只能上传pdf文件</template>
+                <template v-slot:dec
+                  >只能上传pdf文件</template
+                >
               </yl-upload>
             </template>
           </el-table-column>
-          <!-- <el-table-column label="随货单" prop="dyntFileId" width="200">
-            <template slot-scope="scope">
-                <yl-upload
-                :fileId="scope.row.dyntFileId"
-                @getUpload="getUpload"
-                urlName="acco"
-                :index="scope.$index"
-                >
-                <template v-slot:dec>只能上传pdf文件</template>
-                </yl-upload>
-            </template>
-          </el-table-column> -->
           <el-table-column label="备注" prop="memo" width="120">
             <template slot-scope="scope">
               <el-form-item label-width="0" class="item">
-                <el-input placeholder="请输入" v-model="scope.row.memo"></el-input>
+                <el-input
+                  placeholder="请输入"
+                  v-model="scope.row.memo"
+                ></el-input>
               </el-form-item>
             </template>
           </el-table-column>
-          <el-table-column align="center" fixed="right" label="操作" width="120">
+
+          <el-table-column
+            align="center"
+            fixed="right"
+            label="操作"
+            width="120"
+          >
             <template slot-scope="scope">
               <el-button
                 v-if="scope.row.showDeleteButton"
@@ -181,7 +164,10 @@
                 @click="handleDelete(scope.row, scope.$index)"
                 >删除</el-button
               >
-              <el-button v-else type="text" @click="handleBatch(scope.row, scope.$index)"
+              <el-button
+                v-else
+                type="text"
+                @click="handleBatch(scope.row, scope.$index)"
                 >添加批次
               </el-button>
             </template>
@@ -189,180 +175,17 @@
         </el-table>
       </el-form>
     </div>
+    <ylPagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="listQuery.current"
+      :limit.sync="listQuery.size"
+      @pagination="getdialog"
+    />
     <div class="foot-button" style="margin-top: 30px">
       <!-- <el-button type="success" @click="handleSave">保存</el-button> -->
       <el-button type="primary" @click="handleDelivery">出库</el-button>
     </div>
-    <el-dialog class="dialog-tq" title="提取采购单" :visible.sync="dialog" width="70%">
-      <template>
-        <el-form :model="listQuery" ref="listQuery" :inline="true" label-width="90px">
-          <el-form-item size="mini" label="采购单号" prop="purcOrdId" class="long">
-            <el-input v-model="listQuery.purcOrdId" placeholder="请输入采购单号"></el-input>
-          </el-form-item>
-          <el-form-item size="mini" label="耗材名称" prop="prodName" class="long">
-            <el-input
-              v-model="listQuery.prodName"
-              placeholder="请输入耗材名称"
-            ></el-input>
-          </el-form-item>
-          <el-form-item size="mini" label="医保编码" prop="hiCode" class="long">
-            <el-input v-model="listQuery.hiCode" placeholder="请输入医保编码"></el-input>
-          </el-form-item>
-          <el-form-item size="mini" label="生产企业" prop="prodEntp" class="long">
-          <el-input v-model="listQuery.prodEntp" placeholder="请输入生产企业"></el-input>
-        </el-form-item>
-
-        <el-form-item size="mini" label="是否集采" prop="isFas" class="long">
-          <el-select v-model="listQuery.isFas" placeholder="请选择是否集采" clearable>
-            <el-option
-              v-for="item in isFasData"
-              :key="item.value"
-              :label="item.name"
-              :value="item.value"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item size="mini" label="注册证号" prop="regcertno" class="long">
-          <el-input v-model="listQuery.regcertno" placeholder="请输入注册证号"></el-input>
-        </el-form-item>
-          <el-form-item>
-            <el-button type="primary" @click="getdialog('search')">查询</el-button>
-            <el-button @click="reset('consumable')">重置</el-button>
-          </el-form-item>
-        </el-form>
-        <el-table
-          ref="multipleTable"
-          v-loading="dialogLoading"
-          element-loading-text="加载中"
-          fit
-          stripe
-          border
-          :data="consumableData"
-          border
-          style="width: 100%"
-          row-key="id"
-          height="500"
-          @selection-change="handleSelectionChange"
-          highlight-current-row
-          :default-sort="{ prop: 'hiCode', order: 'descending' }"
-        >
-          <el-table-column
-            type="selection"
-            :reserve-selection="true"
-            width="55"
-          ></el-table-column>
-          <el-table-column label="采购单号" prop="purcOrdId"> </el-table-column>
-          <el-table-column label="耗材编码" prop="prodCode" />
-          <el-table-column label="医保编码" prop="hiCode" />
-          <el-table-column label="耗材信息" width="300">
-            <template slot-scope="scope">
-              <mcs-info :info="scope.row"></mcs-info>
-            </template>
-          </el-table-column>
-          <el-table-column label="规格" prop="spec" />
-          <el-table-column label="型号" prop="mol" />
-          <el-table-column label="材质" prop="matl" />
-          <el-table-column label="是否集采" prop="isFas">
-            <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="convrat" width="120px">
-            <template #default="{ row }">
-              <span>{{row.purcUnt}}  ({{row.convrat}}{{row.prcUnt}}/{{row.purcUnt}})</span>
-            </template>
-          </el-table-column>
-          <!-- <el-table-column label="单价" prop="purcPric" /> -->
-          <el-table-column label="需求数量" prop="purcCnt" />
-          <!-- <el-table-column label="已出库数量" prop="delvCntYck" width="90px" /> -->
-          <el-table-column label="剩余出库量" prop="toDelvCnt" width="90px" />
-        </el-table>
-        <div slot="footer" class="dialog-footer">
-          <el-button type="primary" @click="handleConfirm">确认</el-button>
-        </div>
-        <!--分页-->
-        <yl-pagination
-          v-show="total > 0"
-          :total="total"
-          :page.sync="listQuery.current"
-          :limit.sync="listQuery.size"
-          @pagination="getdialog"
-        />
-      </template>
-    </el-dialog>
-    <!-- UDI码 -->
-    <!-- <el-dialog
-      title="UDI码填写"
-      :visible.sync="udidialog"
-      width="70%"
-    >
-    <el-form :model="udiData" ref="udiData">
-    <el-table
-        element-loading-text="加载中"
-        :data="udiData"
-        fit
-        stripe
-        border
-      >
-        <template slot="empty">
-          <img src="@/assets/nopage.png" alt />
-          <p>暂无数据</p>
-        </template>
-        <el-table-column type="index" label="序号" width="60" />
-        <el-table-column label="耗材信息" width="230">
-            <template slot-scope="scope">
-                <mcs-info :info="scope.row"></mcs-info>
-            </template>
-          </el-table-column>
-          <el-table-column label="规格" prop="spec" />
-          <el-table-column label="型号" prop="mol" />
-          <el-table-column label="材质" prop="matl" />
-          <el-table-column label="是否集采" prop="isFas" >
-            <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">
-          </el-table-column>
-          <el-table-column label="生产日期" prop="manuDate">
-          </el-table-column>
-          <el-table-column label="有效期至" prop="prodExpy">
-          </el-table-column>
-          <el-table-column label="包装" prop="convrat" width="120px">
-            <template #default="{ row }">
-              <span>{{row.purcUnt}}  ({{row.convrat}}{{row.prcUnt}}/{{row.purcUnt}})</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="UDI码" prop="udid" width="120" fixed="right">
-            <template slot-scope="scope">
-              <el-form-item
-                label-width="0"
-                class="item"
-                :prop="scope.$index + '.udid'"
-                :rules="[
-                  {
-                    required: true,
-                    message: '请输入',
-                    trigger: 'blur',
-                  },
-                ]"
-              >
-                <el-input placeholder="请输入" v-model="scope.row.udid"></el-input>
-              </el-form-item>
-            </template>
-          </el-table-column>
-      </el-table>
-    </el-form>
-    <div class="foot-button" style="margin-top: 30px">
-        <el-button
-          type="primary"
-          click="clickUdi"
-          >确 认</el-button
-        >
-      </div>
-    </el-dialog> -->
   </div>
 </template>
 
@@ -371,86 +194,93 @@ import mcsInfo from "@/views/components/mcs-info.vue";
 import ylUpload from "@/components/yl-upload";
 import { countNumPrice, getTotalAmount } from "@/utils/utils";
 import rules from "@/utils/rules";
+import ylPagination from "@/components/yl-pagination";
 import { getMcsPurcOrdMx, submitMcsDelvOrd } from "@/api/orderManage-sup/index";
 export default {
   components: {
     mcsInfo,
     ylUpload,
+    ylPagination
   },
   data() {
     return {
+      lotNumRule: [
+        {
+          required: true,
+          message: "请输入",
+          trigger: "change"
+        }
+      ],
+      manuDate: [
+        {
+          required: true,
+          message: "请选择生产日期",
+          trigger: "change"
+        }
+      ],
+      prodExpyRule: [
+        {
+          required: true,
+          message: "请选择有效日期",
+          trigger: "change"
+        }
+      ],
+      delvCntRule: [
+        {
+          required: true,
+          pattern: /^[0-9]\d*$/,
+          message: "请输入正整数",
+          trigger: "blur"
+        }
+      ],
       rules,
       listForm: {
         dyntNo: "",
         current: 1,
-        size: 10,
+        size: 10
       },
+      total: 0,
       planForm: {},
       // 表格数据
       loding: false,
-      tableData: [],
+      tableform: {
+        tableData: []
+      },
       // 弹框表格数据
       dialog: false,
       listQuery: {
-        hiCode: "",
-        prodName: "",
-        purcOrdId: "",
         current: 1,
-        size: 10,
-        prodEntp:"",
-        isFas:"",
+        size: 10
       },
       consumableData: [],
       selectData: [],
       dialogLoading: false,
       Loading: false,
       cellList: [],
-      isFasData: [
-        { value: "1", name: "是" },
-        { value: "0", name: "否" },
-      ],
+      isFasData: [{ value: "1", name: "是" }, { value: "0", name: "否" }],
       TimeOption: {
         disabledDate(time) {
           return time.getTime() < Date.now();
-        },
+        }
       },
       TimeOption1: {
         disabledDate(time) {
           return time.getTime() > Date.now();
-        },
+        }
       },
-      udidialog:false,
+      udidialog: false
     };
   },
+  mounted() {
+    this.getDetails();
+  },
   methods: {
     getDetails() {
-      this.dialog = true;
-      this.getdialog();
-      this.$nextTick(() => {
-        this.$refs.multipleTable.clearSelection();
-        this.tableData.forEach((i) => {
-          this.consumableData.forEach((row) => {
-            if (i.id == row.id) {
-              this.$refs.multipleTable.toggleRowSelection(row, true);
-            }
-          });
-        });
-      });
-    },
-    // 列表数据
-    getData() {
-      this.Loading = true;
-      getPurcOrdDrugList(this.listForm)
-        .then((res) => {
-          this.tableData = res.data.records;
-          this.Loading = false;
-        })
-        .catch((err) => {
-          this.Loading = false;
-        });
+      this.getdialog("search");
     },
+
     // 重置
-    reset(){
+    reset() {
       this.$refs.listQuery.resetFields();
       this.getdialog();
     },
@@ -461,84 +291,65 @@ export default {
       }
       this.dialogLoading = true;
       getMcsPurcOrdMx(this.listQuery)
-        .then((res) => {
-          this.consumableData = res.data.records;
-          this.consumableData.forEach((i) => {
-            i.docmkDate = moment(i.docmkDate).format("YYYY-MM-DD HH:mm:ss");
-          });
+        .then(res => {
+          this.tableform.tableData = res.data.records;
+          // this.tableform.tableData.forEach(i => {
+          //   i.docmkDate = moment(i.docmkDate).format("YYYY-MM-DD HH:mm:ss");
+          // });
           this.total = res.data.total;
           this.dialogLoading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.dialogLoading = false;
         });
     },
+    //表格选中再进行校验
+    lotNumCheck(row, ruleArray) {
+      let rule = [];
+      let isId = this.selectData.filter(item => {
+        return item.id == row.id;
+      });
+      if (isId.length > 0) {
+        rule = ruleArray;
+      } else {
+        rule = [];
+      }
+      return rule;
+    },
     //删除
     handleDelete(row, i) {
-      const index = this.tableData.findIndex(
-        (item) => item.prodCode === row.prodCode
+      const index = this.tableform.tableData.findIndex(
+        item => item.prodCode === row.prodCode
       );
       if (index !== -1) {
-        let qwe = this.tableData.findIndex(function (item) {
+        let qwe = this.tableform.tableData.findIndex(function(item) {
           return item.prodCode == row.prodCode;
         });
-        this.tableData.splice(i, 1);
+        this.tableform.tableData.splice(i, 1);
         this.cellList.splice(i, 1);
         this.cellList[qwe]--;
       }
       row.showDeleteButton = false;
-
       this.shanchu3(row);
-      // if(this.number[index]){
-      //     this.shanchu2(row,index);
-      // }else{
-      //     this.shanchu(row);
-      // }
-      // this.number.splice(i,1);
-    },
-    // 合并列
-    handleSpan({ row, column, rowIndex, columnIndex }) {
-      if (
-        columnIndex === 1 ||
-        columnIndex === 2 ||
-        columnIndex === 3 ||
-        columnIndex === 4 ||
-        columnIndex === 5 ||
-        columnIndex === 6 ||
-        columnIndex === 7 ||
-        columnIndex === 8
-      ) {
-        // console.log("单元格数组,若下一项为0,则代表合并上一项", this.cellList);
-        const rowCell = this.cellList[rowIndex];
-        if (rowCell > 0) {
-          const colCell = 1;
-          // console.log(`动态竖向合并单元格, 第${colCell}列,竖向合并${rowCell}个单元格 `);
-          return {
-            rowspan: rowCell,
-            colspan: colCell,
-          };
-        } else {
-          // 清除原有的单元格,必须要加,否则就会出现单元格会被横着挤到后面了!!!
-          // 本例中数据是写死的不会出现,数据若是动态后端获取的,就会出现了!!!
-          return {
-            rowspan: 0,
-            colspan: 0,
-          };
-        }
+      if (this.number[index]) {
+        this.shanchu2(row, index);
+      } else {
+        this.shanchu(row);
       }
+      this.number.splice(i, 1);
     },
     //弹框选择
     handleSelectionChange(e) {
       this.selectData = e;
     },
-     // 判断一个数组对象的属性是否有重复
-     pf(arr) {
+    // 判断一个数组对象的属性是否有重复
+    pf(arr) {
       for (let i = 0; i < arr.length - 1; i++) {
         for (let j = i + 1; j < arr.length; j++) {
           console.log(arr[i].prodCode, arr[j].prodCode);
           if (arr[i].prodCode == arr[j].prodCode) {
             var set = new Set(); //创建个集合Set对象(用object对象也可以)
-            return arr.some(function (v, i) {
+            return arr.some(function(v, i) {
               //遍历 arr数组,当返回值为true时提前退出遍历。
               var f = set.has(v.lotNum); //判断每个对象里number属性的值是否在集合Set
               set.add(v.lotNum); //将number属性的值添加到集合Set中
@@ -552,38 +363,44 @@ export default {
     },
     // 出库
     handleDelivery() {
-      this.tableData.forEach((item) => {
-        // console.log(item, "item");
+      if (this.selectData.length <= 0) {
+        this.$message({
+          message: "请选择出库明细",
+          type: "warning"
+        });
+        return;
+      }
+      this.selectData.forEach(item => {
         if (item.delvCnt == "0") {
           this.$message({
             message: "本次出库数量必须大于0",
-            type: "warning",
+            type: "warning"
           });
           throw new Error("本次出库数量必须大于0");
         }
         if (item.prodSouc == "2" && !item.invoFileId) {
           this.$message({
             message: "请填写相应信息,并选择报关单",
-            type: "warning",
+            type: "warning"
           });
           throw new Error("请填写相应信息,并选择报关单");
         }
       });
-      let lotnum = this.pf(this.tableData);
+      let lotnum = this.pf(this.selectData);
       if (lotnum == true) {
         this.$message({
           message: "同一产品的批号不能重复",
-          type: "info",
+          type: "info"
         });
         throw new Error("同一产品的批号不能重复");
       }
-      this.$refs.tabledata.validate((valid) => {
+      this.$refs.tableform.validate(valid => {
         if (valid) {
-          let data = this.tableData.map((i) => {
+          let data = this.selectData.map(i => {
             return i.purcOrdId;
           });
           let data2 = data.slice(1);
-          let qwe = data2.some((item) => {
+          let qwe = data2.some(item => {
             if (item != data[0]) {
               return true;
             }
@@ -594,81 +411,81 @@ export default {
             this.$confirm("确认出库", "提示", {
               confirmButtonText: "确定",
               cancelButtonText: "取消",
-              type: "warning",
+              type: "warning"
             }).then(() => {
-              let data = this.tableData.map((i) => {
+              let data = this.selectData.map(i => {
                 return {
                   materialId: i.prodCode,
                   memo: i.memo,
                   delvCnt: i.delvCnt,
                   hiCode: i.hiCode,
-                  delvPric: i.purcPric,
+                  purcPric: i.purcPric,
                   lotNum: i.lotNum,
                   manuDate: i.manuDate,
                   prodExpy: i.prodExpy,
                   invoFileId: i.invoFileId,
                   dyntFileId: i.dyntFileId,
                   noRow: i.index,
+                  purcOrdId: this.selectData[0].purcOrdId
                 };
               });
               let data2 = {
                 delvOrdId: "",
                 spdId: "",
                 detlList: data,
-                dyntNo: this.listForm.dyntNo,
-                purcOrdId: this.tableData[0].purcOrdId,
+                dyntNo: ""
               };
               submitMcsDelvOrd(data2)
-                .then((res) => {
+                .then(res => {
                   this.getdialog();
-                  this.tableData = [];
                   this.selectData = [];
                   this.$message({
-                      message: '出库成功',
-                      type: 'success'
+                    message: "出库成功",
+                    type: "success"
                   });
-                  this.listForm.dyntNo = "";
+                  this.selectData = [];
+                  this.$refs.tabelView.clearSelection();
                 })
-                .catch((err) => {
-                  this.$message.error("出库失败")
+                .catch(err => {
+                  this.$message.error("出库失败");
                 });
             });
           }
         } else {
           this.$message({
             type: "warning",
-            message: "请填写必填项信息",
+            message: "请填写必填项信息"
           });
         }
       });
     },
     // 查看UDI码
-     // 填写UDI码
-     handleudi(row){
+    // 填写UDI码
+    handleudi(row) {
       this.udidialog = true;
-      let udiObj={
-        spec:row.spec,
-        mol:row.mol,
-        matl:row.matl,
-        isFas:row.isFas,
-        lotNum:row.lotNum,
-        manuDate:row.manuDate,
-        prodExpy:row.prodExpy,
-        convrat:row.convrat,
-        prcUnt:row.prcUnt,
-        purcUnt:row.purcUnt,
-        prodName:row.prodName,
-        regcertno:row.regcertno,
-        prodEntp:row.prodEntp,
-        fasBtch:row.fasBtch,
-      }
+      let udiObj = {
+        spec: row.spec,
+        mol: row.mol,
+        matl: row.matl,
+        isFas: row.isFas,
+        lotNum: row.lotNum,
+        manuDate: row.manuDate,
+        prodExpy: row.prodExpy,
+        convrat: row.convrat,
+        prcUnt: row.prcUnt,
+        purcUnt: row.purcUnt,
+        prodName: row.prodName,
+        regcertno: row.regcertno,
+        prodEntp: row.prodEntp,
+        fasBtch: row.fasBtch
+      };
       // const obj = { a: 1, b: 2 };
       const n = 5;
       // const copiedObjects = Array.from({ length: n }, () => ({ ...obj }));
       // const n = row.udid;
       const copiedObjects = Array.from({ length: n }, () => ({ ...udiObj }));
-      console.log(copiedObjects,"copiedObjects")
-      this.udiData = copiedObjects
+      console.log(copiedObjects, "copiedObjects");
+      this.udiData = copiedObjects;
     },
     // 添加批次
     handleBatch(row, index) {
@@ -700,21 +517,18 @@ export default {
         lotNum: "",
         manuDate: "",
         prodExpy: "",
-        dyntFileId: "",
+        dyntFileId: ""
       };
-      this.tableData.splice(index + 1, 0, list);
+      this.tableform.tableData.splice(index + 1, 0, list);
       list.showDeleteButton = true;
-      this.computeCell(this.tableData);
-      console.log(this.tableData, "tableData");
-      // const aa = this.tableData.findIndex((item) => item.id === row.id);
-      // this.number.splice(aa+1,0,this.number[aa])
+      this.computeCell(this.tableform.tableData);
     },
     getUpload1(id, index) {
-      this.tableData[index].invoFileId = id;
+      this.tableform.tableData[index].invoFileId = id;
       if (id) {
-        this.$refs.tabledata.clearValidate("invoFileId");
+        this.$refs.tableform.clearValidate("invoFileId");
       } else {
-        this.$refs.tabledata.validateField("invoFileId");
+        this.$refs.tableform.validateField("invoFileId");
       }
     },
     // 筛选合并项
@@ -744,7 +558,7 @@ export default {
     //获取出库数量和
     numAll(row) {
       let num = 0;
-      this.tableData.forEach((item) => {
+      this.tableform.tableData.forEach(item => {
         if (item.prodCode == row.prodCode) {
           num += item.delvCnt;
         }
@@ -752,14 +566,13 @@ export default {
       return num;
     },
     shanchu3(row) {
-      this.tableData.forEach(async (item) => {
+      this.tableform.tableData.forEach(async item => {
         await this.numAll(row);
-        console.log(this.numAll(row), "he");
         if (item.prodCode == row.prodCode) {
           if (this.numAll(row) > item.toDelvCnt) {
             this.$message.warning("出库数量不能大于待出库数量");
             row.delvCnt = 0;
-            row.price = 0;
+            row.purcPric = 0;
             return;
           }
         }
@@ -769,8 +582,8 @@ export default {
     },
     numOrPriceChange(index, row) {
       this.$set(
-        this.tableData[index],
-        "price",
+        this.tableform.tableData[index],
+        "purcPric",
         getTotalAmount(row.delvCnt, row.purcPric)
       );
       this.amount = countNumPrice(this.tableData);
@@ -788,11 +601,11 @@ export default {
     },
     // 确认
     handleConfirm() {
-      let data = this.selectData.map((i) => {
+      let data = this.selectData.map(i => {
         return i.purcOrdId;
       });
       let data2 = data.slice(1);
-      let qwe = data2.some((item) => {
+      let qwe = data2.some(item => {
         if (item != data[0]) {
           return true;
         }
@@ -800,12 +613,12 @@ export default {
       if (qwe == true) {
         this.$message.info("请勾选同一采购单明细");
       } else {
-        this.tableData = this.selectData;
-        this.computeCell(this.tableData);
+        this.tableform.tableData = this.selectData;
+        this.computeCell(this.tableform.tableData);
         this.dialog = false;
       }
-    },
-  },
+    }
+  }
 };
 </script>
 

+ 24 - 23
src/views/page/procurement-settlement/invoiceManage/index.vue

@@ -52,6 +52,7 @@
               <template #default="{ row }">
                 <span v-if="row.stas == 'B'">待录入</span>
                 <span v-if="row.stas == 'C'">已录入</span>
+                <span v-if="row.stas == 'R'">已撤回</span>
               </template>
             </el-table-column>
             <el-table-column fixed="right" label="操作" width="160">
@@ -138,7 +139,7 @@ export default {
   components: {
     ylPagination,
     ylUpload,
-    mcsInfo,
+    mcsInfo
   },
   data() {
     return {
@@ -147,17 +148,17 @@ export default {
       data: [],
       defaultProps: {
         children: "children",
-        label: "spdName",
+        label: "spdName"
       },
       listQuery: {
         current: 1,
         size: 10,
-        stas: "B",
+        stas: "B"
       },
       listQueryC: {
         current: 1,
         size: 10,
-        stas: "C",
+        stas: "C"
       },
       listLoading: false,
       list: [],
@@ -166,7 +167,7 @@ export default {
       totalC: 0,
       // tree
       activeNametree: "org",
-      routespdId: "",
+      routespdId: ""
     };
   },
   methods: {
@@ -186,12 +187,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;
         });
     },
@@ -200,12 +201,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;
         });
     },
@@ -216,23 +217,23 @@ export default {
       this.listQuery.spdId = this.spdId;
       this.listQueryC.spdId = this.spdId;
       if (this.activeNameTab == "first") {
-        selectSetlStmtD(this.listQuery)
-          .then((res) => {
+        selectSetlStmtD({ ...this.listQuery, stasList: ["B", "R"] })
+          .then(res => {
             this.list = res.data.records;
             this.total = res.data.total;
             this.listLoading = false;
           })
-          .catch((err) => {
+          .catch(err => {
             this.listLoading = false;
           });
       } else {
         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;
           });
       }
@@ -242,13 +243,13 @@ export default {
       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;
         });
     },
@@ -262,7 +263,7 @@ export default {
     // 多选后选过的禁用
     selected(row, index) {
       if (
-        this.list.some((el) => {
+        this.list.some(el => {
           return el.hiCode === row.hiCode;
         })
       ) {
@@ -298,8 +299,8 @@ export default {
           stas: row.stas,
           spdId: this.routespdId,
           activeNameTab: this.activeNameTab,
-          detlCnt: row.detlCnt,
-        },
+          detlCnt: row.detlCnt
+        }
       });
     },
     handleDetails1(row) {
@@ -326,10 +327,10 @@ export default {
           invoName: row.invoName,
           invoNo: row.invoNo,
           invoDate: row.invoDate,
-          invoAmt: row.invoAmt,
-        },
+          invoAmt: row.invoAmt
+        }
       });
-    },
+    }
   },
   mounted() {
     this.getData();
@@ -363,7 +364,7 @@ export default {
       //       this.listLoading = false;
       //     });
     }
-  },
+  }
 };
 </script>