浏览代码

Merge branch 'purchaseDev' into 'dev'

Purchase dev

See merge request new-business/drp-web!598
黄梓星 1 年之前
父节点
当前提交
3381d7c451

+ 2 - 1
src/api/business/purchase/apply.js

@@ -28,7 +28,8 @@ export function SUBMIT(data) {
   return request({
     url: `/pu/priceApply/submit`,
     method: "POST",
-    data: {submitIds:data},
+    // data: {submitIds:data},
+    data,
   });
 }
 

+ 47 - 152
src/views/material/basicFile/details.vue

@@ -41,12 +41,9 @@
             <!-- 新增、修改、删除、复制 -->
             <el-col :span="1.5">
               <el-button-group>
-                <!-- <el-button :size="size" @click="handleInster">新增</el-button> -->
                 <el-button :size="size" @click="handleBasicEdit"
                   >修改</el-button
                 >
-                <!-- <el-button :size="size" @click="handleDel">删除</el-button> -->
-                <!-- <el-button :size="size" @click="handleCopy">复制</el-button> -->
               </el-button-group>
             </el-col>
 
@@ -82,7 +79,7 @@
             </el-col>
 
             <!-- 维护新版本 -->
-            <el-col :span="1.5">
+            <!-- <el-col :span="1.5">
               <el-button-group>
                 <el-button
                   :size="size"
@@ -91,7 +88,7 @@
                   >维护新版本
                 </el-button>
               </el-button-group>
-            </el-col>
+            </el-col> -->
           </el-row>
         </div>
 
@@ -140,7 +137,6 @@
 
       <div class="md-content" :key="basicData.value.id">
         <el-form :inline="true" label-position="right" :model="basicData.value">
-          <!-- <el-form-item label="所属组织"></el-form-item> -->
           <el-form-item label="物料编码">
             <el-input
               v-model="basicData.value.code"
@@ -162,7 +158,6 @@
               size="mini"
             ></el-input>
           </el-form-item>
-          <!-- <el-form-item label="版本号"></el-form-item> -->
         </el-form>
 
         <dr-tabs :tabList="detailsTabs" :handleTabClick="handleMainTabClick">
@@ -733,11 +728,6 @@
               <div slot="empty"></div>
             </el-select>
 
-            <!-- <el-select size="mini" v-else-if="mt.attribute == 'select' && mt.dictId"  placeholder="请选择"
-              :disabled="!(materialType.isEdit && mt.edit)" v-model="scope.row[mt.prop]" :key="scope.row[mt.prop]">
-              <el-option v-if="mt.dictId" v-for="d in mt.dictId" :key="d.dictValue" :label="d.dictLabel"
-                :value="d.dictValue"></el-option></el-select> -->
-
             <!-- 其他类型 -->
             <el-input
               v-else
@@ -785,7 +775,6 @@
               <el-button :size="size" @click="handleOtherEdit('form')"
                 >修改</el-button
               >
-              <!-- <el-button :size="size" @click="handleOtherDel">删除</el-button> -->
             </el-button-group>
             <el-button-group>
               <el-button :size="size" @click="handleOtherRefresh"
@@ -1311,27 +1300,6 @@ export default {
       //   path: `/basic/material/basicFile`,
       // });
     },
-    // 附件按钮
-    handleFile() {
-      console.log("附件按钮");
-    },
-    // 改变分页情况
-    handleChangePage(type) {
-      switch (type) {
-        case "first":
-          console.log("第一页");
-          break;
-        case "pre":
-          console.log("上一页");
-          break;
-        case "next":
-          console.log("下一页");
-          break;
-        case "end":
-          console.log("最后页");
-          break;
-      }
-    },
     // 切换主信息标签
     handleMainTabClick(e) {
       this.activeMainTab = detailsTabs[e.index].code;
@@ -1344,7 +1312,6 @@ export default {
     },
     // 切换副表信息
     handleViceTabClick(e) {
-      // console.log(this.basicMessage[e.index], '切换标签');
       this.activeViceTab = this.basicMessage[e.index].code;
 
       switch (this.activeViceTab) {
@@ -1384,7 +1351,6 @@ export default {
       let activeTab = this.detailsTabs.filter(
         (item) => item.code == this.activeMainTab
       )[0];
-      console.log(activeTab, "activeTab");
       this.otherDeatils.title = activeTab.label;
 
       this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
@@ -1491,54 +1457,6 @@ export default {
         }
       });
     },
-    // 添加参照中的label
-    // handleAddReferLabel(dataName) {
-    //   let _this = this;
-    //   this[dataName].form.map(item => {
-    //     // 查参照
-    //     if (item.apiUrl && item.apiUrl != '') {
-
-    //       let param = {};
-
-    //       if (item.relevance && item.relevance != '') {
-    //         let reList = item.relevance.split(',');
-    //         console.log(reList, 'reList-------------------');
-    //         reList.forEach(i => {
-    //           param[i] = this.basicData.value[i]
-    //         })
-    //         console.log(param, 'param/////////////////////////');
-    //       }
-
-    //       _this.getExecuteMethods(item.apiUrl, param, (data) => {
-    //         let { tableBody } = data;
-
-    //         // 维护物料类别  --- 属于列表中获取label
-    //         if (dataName == 'materialType') {
-
-    //           _this[dataName].value.length && (_this[dataName].value = _this[dataName].value.map(d => {
-
-    //             let Blabel = tableBody.filter((t) => t.id == d[item.prop])[0];
-    //             console.log(Blabel, 'Blabel``````````````````````````');
-    //             d[`${item.prop}Label`] = (Blabel && Blabel.name) || Blabel || '';
-    //             return d;
-    //           }))
-
-    //         } else {
-
-    //           let Blabel = tableBody.filter((t) => t.id == _this[dataName].value[item.prop])[0];
-    //           console.log(Blabel, 'Blabel``````````````````````````');
-    //           _this[dataName].value[`${item.prop}Label`] = (Blabel && Blabel.name) || Blabel || '';
-    //         }
-
-    //         // this.count++;
-    //         this.loading = false;
-    //         console.log(_this[dataName].value, `${dataName}//////////////////////`);
-    //       })
-    //     }
-    //   })
-    //   this.materialType.loading = false;
-
-    // },
 
     // 查询财务信息列表
     async getFinanceList(materialId) {
@@ -1812,41 +1730,55 @@ export default {
     },
     // 获取物料列表表头
     async getTagList(templateCode, cb) {
-      let _this = this;
-      await materialApi.tagList({ templateCode }).then(async (res) => {
-        console.log(res, `获取${templateCode}表头`);
-        let dictIdList = [];
-        if (res.code == 200) {
-          res.data.map(async (item) => {
-            // 查字典
-            if (item.dictId && item.dictId != "") {
-              // 通过接口获取有dict的对应的数据
-              await getDicts(item.dictId).then((dict) => {
-                if (dict.data) {
-                  item["dictValue"] = dict.data;
-                }
-              });
-            }
+      let dictIdList = [];
+      try {
+        let { code, data } = await materialApi.tagList({ templateCode });
+        if (code == 200) {
+          dictIdList = _.cloneDeep(data);
+          let promiseArray = data.map((item, index) => {
+            return new Promise((resolve, reject) => {
+              if (item.dictId && item.dictId != "") {
+                getDicts(item.dictId).then((dict) => {
+                  if (dict.data) {
+                    dictIdList[index]["dictValue"] = dict.data;
+                    resolve();
+                  }
+                });
+              } else {
+                resolve();
+              }
+            });
           });
+          Promise.all(promiseArray)
+            .then(async () => {
+              return cb(dictIdList);
+            })
+            .catch(() => {
+              console.log("promise.all执行失败");
+            });
+        }
+      } catch (error) {
+      } finally {
+      }
 
-          return cb(res.data);
-
-          // 动态更改dict
-          // res.data.forEach(item => {
-          //   if (item.dictId) {
-          //     // 请求接口
-          //     dictIdList.push(item.dictId);
-          //   }
-          // })
-          // console.log(dictIdList, 'dictIdList');
-          // _this.dict = [..._this.dict, ...dictIdList];
-          // _this.dict = Array.from(new Set([..._this.dict, ...dictIdList]));
+      // await materialApi.tagList({ templateCode }).then(async (res) => {
+      //   console.log(res, `获取${templateCode}表头`);
+      //   let dictIdList = [];
+      //   if (res.code == 200) {
 
-          // console.log(_this.dict, 'dicts');
+      //     res.data.map(async (item) => {
+      //       // 查字典
+      //       if (item.dictId && item.dictId != "") {
+      //         // 通过接口获取有dict的对应的数据
+      //         await getDicts(item.dictId).then((dict) => {
+      //           if (dict.data) {
+      //             item["dictValue"] = dict.data;
+      //           }
+      //         });
+      //       }
+      //     });
 
-          // return cb(res.data);
-        }
-      });
+      //     return cb(res.data);
     },
     // 根据物料id获取物料类别维护列表
     getMedcineitemList(materialId) {
@@ -2021,16 +1953,6 @@ export default {
       // })
       console.log(this.detailsTabs, "this.detailsTabs ");
     },
-    // 删除
-    handleDel() {
-      console.log("删除----基本信息");
-    },
-    // 复制
-    handleCopy() {
-      console.log("复制");
-    },
-    //查询
-    handleQuery() {},
     // 刷新
     handleRefresh() {
       console.log("刷新");
@@ -2039,15 +1961,6 @@ export default {
       this.$refs.medcineRef.clearValidate();
       this.handleRest();
     },
-    // 过滤
-    handleFilter(e) {
-      console.log(e, "过滤");
-    },
-    filterCondition(type) {
-      return {
-        type,
-      };
-    },
     // 维护物料类别
     handleMaterialType() {
       console.log("维护物料类别");
@@ -2127,9 +2040,6 @@ export default {
     // 保存修改
     handleSave() {
       console.log("保存修改");
-      // this.$refs['basicMessageRef'].validate(async (valid) => {
-
-      //   if (valid) {
       this.loading = true;
       // 普通保存修改
       this.updateButtonGroup &&
@@ -2144,16 +2054,6 @@ export default {
           this.maintainNewVersion = false;
           this.handleRefresh();
         });
-      //   } else {
-      //     this.$notify.error({
-      //       title: '错误',
-      //       message: '存在必填项未填写!'
-      //     });
-
-      //     console.log('error submit!!');
-      //     return false;
-      //   }
-      // })
     },
     // 物料类别列表选中
     handleSelectionType(list) {
@@ -2339,10 +2239,6 @@ export default {
     handleCollapseChange(val) {
       console.log(val, "折叠菜单改变");
     },
-    // 更新导入
-    handleUpdateImport() {
-      console.log("更新导入");
-    },
     // 确认弹窗操作
     async handleComfirmOption() {
       console.log("确认弹窗操作");
@@ -2536,7 +2432,6 @@ export default {
     },
     // 取消-关闭参照弹窗
     handleConcalRefer() {
-      console.log("关闭参照弹窗");
       this.MoreDataDialog.show = false;
       this.MoreDataDialog.key = "";
     },

+ 58 - 26
src/views/purchase/apply/submit/index.vue

@@ -41,38 +41,70 @@ export default {
   methods: {
     //
     open() {
+      let _this = this;
       this.$confirm(`是否提交数据项至OA系统?`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "info",
-        beforeClose: async (action, instance, done) => {
-          if (action === "confirm") {
-            instance.confirmButtonLoading = true;
-            instance.confirmButtonText = "执行中...";
-            try {
-              // try
-              const { selectData } = this.$props;
-              const ids = selectData.map((item) => item.id);
-              const { msg, code } = await SUBMIT(ids);
-              if (code === 200) {
-                done();
-                this.$emit("success");
-                this.$notify.success(msg);
-              }
-            } catch (err) {
-              // catch
-              console.error(err);
-              instance.confirmButtonText = "确认";
-            } finally {
-              // finally
-              instance.confirmButtonLoading = false;
+      })
+        .then(async () => {
+          try {
+            const { selectData } = this.$props;
+            const ids = selectData.map((item) => item.id);
+            const { msg, code } = await SUBMIT({
+              submitIds: ids,
+              checkAmount: true,
+            });
+            if (code === 200) {
+              this.$emit("success");
+              this.$notify.success(msg);
+            }
+            if (code === 10000) {
+              _this.$alert(
+                "<div style='overflow: auto;overflow-x: hidden;max-height: 65vh;padding: 10px 20px 0;'>" +
+                  msg +
+                  "</div>",
+                "提示",
+                {
+                  showCancelButton: true,
+                  dangerouslyUseHTMLString: true,
+                  confirmButtonText: "确认",
+                  cancelButtonText: "取消",
+                  beforeClose: async (action, instance, done) => {
+                    if (action === "confirm") {
+                      instance.confirmButtonLoading = true;
+                      instance.confirmButtonText = "执行中...";
+                      try {
+                        let { code, msg } = await SUBMIT({
+                          submitIds: ids,
+                          checkAmount: false,
+                        });
+                        if (code == 200) {
+                          done();
+                          _this.$emit("success");
+                          _this.$notify.success(msg);
+                        }
+                      } catch (error) {
+                        instance.confirmButtonText = "确认";
+                      } finally {
+                        instance.confirmButtonLoading = false;
+                      }
+                    } else {
+                      done();
+                    }
+                  },
+                }
+              );
             }
-          } else {
-            done();
+          } catch (err) {
+            // catch
+            console.error(err);
+            instance.confirmButtonText = "确认";
+          } finally {
+            // finally
+            instance.confirmButtonLoading = false;
           }
-        },
-      })
-        .then(() => {})
+        })
         .catch(() => {});
     },
   },

+ 24 - 21
src/views/purchase/catalogue/index.vue

@@ -93,25 +93,28 @@ export default {
     // 导出全部
     exportAll() {
       this.$modal.loading("正在导出数据,请稍后...");
-      exportAll(this.params).then(res => {
-        this.$modal.closeLoading();
-        const blob = new Blob([res], {
-          type: "application/vnd.ms-excel;charset=UTF-8",
-        });// 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
-        const downloadElement = document.createElement("a"); //创建a标签
-        const href = window.URL.createObjectURL(blob); // 创建下载的链接
-        // var temp = res.headers["content-disposition"]; 
-        // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
-        // var name = fileName.split(";")[0]; //切割成文件名
-        downloadElement.href = href;  //下载地址
-        downloadElement.download = '价格目录全部导出' + this.parseTime(new Date().getTime()) + ".xlsx"; 
-        document.body.appendChild(downloadElement);
-        downloadElement.click(); // 点击下载
-        document.body.removeChild(downloadElement); // 下载完成移除元素
-        window.URL.revokeObjectURL(href); // 释放blob对象
-      }).catch(err => {
-        this.$modal.closeLoading();
-      })
+      exportAll(this.params)
+        .then((res) => {
+          this.$modal.closeLoading();
+          const blob = new Blob([res], {
+            type: "application/vnd.ms-excel;charset=UTF-8",
+          }); // 创建一个类文件对象:Blob对象表示一个不可变的、原始数据的类文件对象
+          const downloadElement = document.createElement("a"); //创建a标签
+          const href = window.URL.createObjectURL(blob); // 创建下载的链接
+          // var temp = res.headers["content-disposition"];
+          // var fileName = decodeURIComponent(temp.split("filename=")[1]); // 中文需要转码 (前端乱码)
+          // var name = fileName.split(";")[0]; //切割成文件名
+          downloadElement.href = href; //下载地址
+          downloadElement.download =
+            "价格目录全部导出" + this.parseTime(new Date().getTime()) + ".xlsx";
+          document.body.appendChild(downloadElement);
+          downloadElement.click(); // 点击下载
+          document.body.removeChild(downloadElement); // 下载完成移除元素
+          window.URL.revokeObjectURL(href); // 释放blob对象
+        })
+        .catch((err) => {
+          this.$modal.closeLoading();
+        });
     },
   },
 };
@@ -143,12 +146,12 @@ export default {
           status="Y"
           @success="useQuery(params, page)"
         ></ena-button>
-        <ena-button
+        <!-- <ena-button
           :size="size"
           :select-data="selectData"
           status="N"
           @success="useQuery(params, page)"
-        ></ena-button>
+        ></ena-button> -->
       </el-button-group>
       <el-button-group>
         <inv-button

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

@@ -741,10 +741,10 @@ export default {
             :key="checkedList.length"
             @click="handlePurchaseReturn"
           >采购退货</el-button> -->
-          <el-button size="mini" @click="handlePaymentRequest"
+          <el-button :size="size" @click="handlePaymentRequest"
             >付款申请</el-button
           >
-          <el-button size="mini" @click="handleDownload">批量导出</el-button>
+          <el-button :size="size" @click="handleDownload">批量导出</el-button>
         </el-button-group>
         <el-button-group>
           <zp-button

+ 355 - 227
src/views/purchase/workSpace/index.vue

@@ -1,32 +1,45 @@
 <template>
   <div id="workSpace">
-    <el-card style="position: relative;">
+    <el-card style="position: relative">
       <el-form label-width="100px">
         <el-row :gutter="10">
           <el-col :span="1.5">
-              <el-form-item label="单据标题">
-                <el-input
-                  v-model.trim="queryParams.docSubject"
-                  size="mini"
-                  clearable
-                  style="width: 200px"
-                />
-              </el-form-item>
-            </el-col>
+            <el-form-item label="单据标题">
+              <el-input
+                v-model.trim="queryParams.docSubject"
+                size="mini"
+                clearable
+                style="width: 200px"
+              />
+            </el-form-item>
+          </el-col>
 
           <el-col :span="1.5">
-              <el-form-item label="单据类型">
-                <el-select multiple v-model="queryParams.modelIds" size="mini" style="width: 200px" clearable>
-                  <el-option v-for="dict in dict.type.oa_templete_id" :key="dict.value" :label="dict.label" :value="dict.value">
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
+            <el-form-item label="单据类型">
+              <el-select
+                multiple
+                v-model="queryParams.modelIds"
+                size="mini"
+                style="width: 200px"
+                clearable
+              >
+                <el-option
+                  v-for="dict in dict.type.oa_templete_id"
+                  :key="dict.value"
+                  :label="dict.label"
+                  :value="dict.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
         </el-row>
       </el-form>
 
-      <div style="position: absolute;top: 18px;right: 10px;">
-        <el-button type="primary" size="mini" @click="searchList">搜索</el-button>
+      <div style="position: absolute; top: 18px; right: 10px">
+        <el-button type="primary" size="mini" @click="searchList"
+          >搜索</el-button
+        >
         <el-button size="mini" plain @click="resetList">重置</el-button>
       </div>
 
@@ -36,7 +49,7 @@
 
       <el-table
         v-loading="loading"
-        :data="tableList" 
+        :data="tableList"
         fit
         :cell-style="{ borderColor: '#c0c0c0' }"
         :header-cell-style="{ borderColor: '#c0c0c0' }"
@@ -44,25 +57,40 @@
         max-height="410"
         border
         highlight-current-row
-        style="font-size: 12px;"
+        style="font-size: 12px"
         @selection-change="handleSelectionChange"
         @row-click="rowSelect"
         @row-dblclick="doubleClick"
         ref="tables"
       >
         <!-- <el-table-column type="selection" width="55" /> -->
-        <el-table-column label="序号" type="index" align="center" width="50px"/>
-        <el-table-column show-overflow-tooltip label="标题" align="center" prop="docSubject"/>
-        <el-table-column show-overflow-tooltip label="创建人" align="center" prop="docCreate" width="100px"/>
         <el-table-column
-          fixed="right"
-          label="操作"
+          label="序号"
+          type="index"
           align="center"
-          width="180"
-          >
+          width="50px"
+        />
+        <el-table-column
+          show-overflow-tooltip
+          label="标题"
+          align="center"
+          prop="docSubject"
+        />
+        <el-table-column
+          show-overflow-tooltip
+          label="创建人"
+          align="center"
+          prop="docCreate"
+          width="100px"
+        />
+        <el-table-column fixed="right" label="操作" align="center" width="180">
           <template slot-scope="scope">
-            <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
-            <el-button type="text" size="mini" @click="audit(scope.row)">审批</el-button>
+            <el-button type="text" size="mini" @click="check(scope.row)"
+              >查看</el-button
+            >
+            <el-button type="text" size="mini" @click="audit(scope.row)"
+              >审批</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -75,15 +103,16 @@
         :page-sizes="[10, 20, 50, 100, 200, 500]"
         :page-size="20"
         layout="total, sizes, prev, pager, next, jumper"
-        :total=total>
+        :total="total"
+      >
       </el-pagination>
 
-      <el-card class="box-card" style="margin-top: 10px;">
-        <div slot="header" class="clearfix">
+      <el-card class="box-card" style="margin-top: 10px">
+        <div slot="header" class="clearfix" style="line-height: 38px">
           <span>单据概述</span>
         </div>
         <el-table
-          :data="sonTableList" 
+          :data="sonTableList"
           fit
           :cell-style="{ borderColor: '#c0c0c0' }"
           :header-cell-style="{ borderColor: '#c0c0c0' }"
@@ -91,17 +120,44 @@
           max-height="410"
           border
           highlight-current-row
-          style="font-size: 12px;"
+          style="font-size: 12px"
         >
-          <el-table-column v-if="cols.length !== 0" label="序号" type="index" align="center" width="50px"/>
-            <el-table-column v-for="(col,index) in cols" :key="index"
-              align="center"
-              :prop="col.prop"
-              :label="col.label"
-              :width="col.width"
-              :formatter="col.formatter"
-            >
-            </el-table-column>
+          <el-table-column
+            v-if="cols.length !== 0"
+            label="序号"
+            type="index"
+            align="center"
+            width="50px"
+          />
+          <el-table-column
+            v-for="(col, index) in cols"
+            :key="index"
+            align="center"
+            :prop="col.prop"
+            :label="col.label"
+            :width="col.width"
+            :formatter="col.formatter"
+          >
+            <template slot-scope="scope">
+              <template v-if="col.attr">
+                <component
+                  v-if="col.attr.is === 'el-dict-tag'"
+                  v-bind="col.attr"
+                  :size="$attrs.size"
+                  :value="scope.row[col.prop]"
+                  :options="dict.type[col.attr.dictName]"
+                ></component>
+              </template>
+              <template v-else>
+                <component v-if="col.formatter" is="span">{{
+                  col.formatter(scope.row)
+                }}</component>
+                <component v-else is="span">{{
+                  scope.row[col.prop]
+                }}</component>
+              </template>
+            </template>
+          </el-table-column>
         </el-table>
 
         <el-pagination
@@ -112,26 +168,33 @@
           :page-sizes="[10, 20, 50, 100, 200, 500]"
           :page-size="10"
           layout="total, sizes, prev, pager, next, jumper"
-          :total=sonTotal>
+          :total="sonTotal"
+        >
         </el-pagination>
       </el-card>
-
     </el-card>
   </div>
 </template>
 
 <script>
-import { getWorkSpaceList, auditWork, getWorkDetailList } from '@/api/purchase/workSpace.js'
+import {
+  getWorkSpaceList,
+  auditWork,
+  getWorkDetailList,
+} from "@/api/purchase/workSpace.js";
 export default {
-  name: 'workSpace',
-  dicts: ['oa_templete_id'],
+  name: "workSpace",
+  dicts: ["oa_templete_id", "sys_price_type"],
+  components: {
+    ElDictTag: () => import("@/components/DictTag/index.vue"),
+  },
   data() {
     return {
       queryParams: {
-        modelIds:[],
-        docSubject: '',
+        modelIds: [],
+        docSubject: "",
         pageNum: 1,
-        pageSize: 20
+        pageSize: 20,
       },
       loading: false,
       tableList: [],
@@ -140,54 +203,57 @@ export default {
       sonTableList: [],
       sonQuery: {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
       },
       sonTotal: 0,
       checkRow: {
-        billCode: '',
-        type: ''
+        billCode: "",
+        type: "",
       },
       cols: [],
       // 记录点击行的下标
-      recordIndex: '',
-    }
+      recordIndex: "",
+    };
   },
   created() {
-    this.getList(this.queryParams)
+    this.getList(this.queryParams);
   },
   methods: {
-    getList(params){
-      getWorkSpaceList(params).then(res => {
-        if (res.code === 200) {
-          this.tableList = res.rows
-          this.total = res.total
-        }
-      }).then(() => {
-        this.loading = false
-      }).catch(err => {
-        this.loading = false
-      })
+    getList(params) {
+      getWorkSpaceList(params)
+        .then((res) => {
+          if (res.code === 200) {
+            this.tableList = res.rows;
+            this.total = res.total;
+          }
+        })
+        .then(() => {
+          this.loading = false;
+        })
+        .catch((err) => {
+          this.loading = false;
+        });
     },
     searchList() {
-      this.getList(this.queryParams)
+      this.getList(this.queryParams);
     },
     resetList() {
       this.queryParams = {
-        modelIds:[],
-        docSubject: '',
+        modelIds: [],
+        docSubject: "",
         pageNum: 1,
-        pageSize: 20
-      }
-      this.searchList()
+        pageSize: 20,
+      };
+      this.searchList();
     },
     handleSelectionChange(selection) {
-      console.log('选中', selection)
-      this.ids = selection
+      console.log("选中", selection);
+      this.ids = selection;
       // console.log('选中数组', this.ids.join())
     },
     doubleClick(row) {
       // this.$refs.tables.toggleRowSelection(row);
-      this.rowSelect(row)
+      this.rowSelect(row);
     },
     rowSelect(row, column, event) {
       // console.log('行信息', row)
@@ -197,207 +263,269 @@ export default {
       // console.log('下标:', this.recordIndex)
       // this.check(row)
       // 选择行存储便于子表分页
-      this.checkRow = row
+      this.checkRow = row;
       // 采购需求单
-      if(row.type == 'PU_DEMAND_RULE') {
+      if (row.type == "PU_DEMAND_RULE") {
         this.cols = [
-          {label: '物料编码',  prop: 'materialCode'},
-          {label: '物料名称',  prop: 'materialName'},
-          {label: '规格',  prop: 'specification'},
-          {label: '单位',  prop: 'unitName',width: 50},
-          {label: '生产厂家/代理人',  prop: 'manufacturerName'},
-          {label: '实际(业务)需求量',  prop: 'qty', width: 130},
-          {label: '月均销量',  prop: 'averageQtyMonth', width: 80},
-          {label: '需求可用周期',  prop: 'demandPeriod', width: 80},
-          {label: '业务备注',  prop: 'remark'},
-          {label: '紧急标识',  prop: 'isUrgency',
-            formatter: function(row, column, cellValue, index) {
-              return row.isUrgency == 'Y' ? '是' : '否'
+          { label: "物料编码", prop: "materialCode" },
+          { label: "物料名称", prop: "materialName" },
+          { label: "规格", prop: "specification" },
+          { label: "单位", prop: "unitName", width: 50 },
+          { label: "生产厂家/代理人", prop: "manufacturerName" },
+          { label: "实际(业务)需求量", prop: "qty", width: 130 },
+          { label: "月均销量", prop: "averageQtyMonth", width: 80 },
+          { label: "需求可用周期", prop: "demandPeriod", width: 80 },
+          { label: "业务备注", prop: "remark" },
+          {
+            label: "紧急标识",
+            prop: "isUrgency",
+            formatter: function (row, column, cellValue, index) {
+              return row.isUrgency == "Y" ? "是" : "否";
             },
-            width: 80
+            width: 80,
           },
-          {label: '补单标识',  prop: 'isReplenishment',
-            formatter: function(row, column, cellValue, index) {
-              return row.isReplenishment == 'Y' ? '是' : '否'
+          {
+            label: "补单标识",
+            prop: "isReplenishment",
+            formatter: function (row, column, cellValue, index) {
+              return row.isReplenishment == "Y" ? "是" : "否";
             },
-            width: 80
+            width: 80,
           },
-        ]
+        ];
         // 调拨订单
-      } else if (row.type == 'ALLOT_RULE') {
+      } else if (row.type == "ALLOT_RULE") {
         this.cols = [
-          {label: '物料编码',  prop: 'materialCode', width: 120},
-          {label: '物料名称',  prop: 'materialName'},
-          {label: '规格',  prop: 'specification'},
-          {label: '单位',  prop: 'unitName'},
-          {label: '生产厂家/代理人',  prop: 'manufacturerName'},
-          {label: '调出仓库',  prop: 'deliveryWarehouseName'},
-          {label: '调出货位',  prop: 'deliveryAllocationName'},
-          {label: '数量',  prop: 'qty', width: 50},
-          {label: '调入仓库',  prop: 'storageWarehouseName'},
-          {label: '调入货位',  prop: 'storageAllocationName'},
-        ]
+          { label: "物料编码", prop: "materialCode", width: 120 },
+          { label: "物料名称", prop: "materialName" },
+          { label: "规格", prop: "specification" },
+          { label: "单位", prop: "unitName" },
+          { label: "生产厂家/代理人", prop: "manufacturerName" },
+          { label: "调出仓库", prop: "deliveryWarehouseName" },
+          { label: "调出货位", prop: "deliveryAllocationName" },
+          { label: "数量", prop: "qty", width: 50 },
+          { label: "调入仓库", prop: "storageWarehouseName" },
+          { label: "调入货位", prop: "storageAllocationName" },
+        ];
         // 物料申请单
-      } else if (row.type == 'MATERIAL_APPLY_RULE') {
+      } else if (row.type == "MATERIAL_APPLY_RULE") {
         this.cols = [
-          {label: '物料一级分类',  prop: 'classOneName', width: 120},
-          {label: '物料基本分类',  prop: 'classifyName', width: 120},
-          {label: '物料名称',  prop: 'materialName'},
-          {label: '规格',  prop: 'specification'},
-          {label: '生产厂家/代理人',  prop: 'manufacturerName'},
-          {label: '注册证号',  prop: 'registrationNo'},
-          {label: '注册人',  prop: 'registrant'},
-          {label: '存储条件',  prop: 'storageCondition'},
-          {label: '运输条件',  prop: 'transportationCondition', width: 80},
+          { label: "物料一级分类", prop: "classOneName", width: 120 },
+          { label: "物料基本分类", prop: "classifyName", width: 120 },
+          { label: "物料名称", prop: "materialName" },
+          { label: "规格", prop: "specification" },
+          { label: "生产厂家/代理人", prop: "manufacturerName" },
+          { label: "注册证号", prop: "registrationNo" },
+          { label: "注册人", prop: "registrant" },
+          { label: "存储条件", prop: "storageCondition" },
+          { label: "运输条件", prop: "transportationCondition", width: 80 },
           // {label: '是否医药物料',  prop: 'isMedicine',
           //   formatter: function(row, column, cellValue, index) {
           //     return row.isMedicine == '0' ? '是' : '否'
           //   }
           // },
-          {label: '是否药品',  prop: 'isDrug',
-            formatter: function(row, column, cellValue, index) {
-              return row.isDrug == '0' ? '是' : '否'
+          {
+            label: "是否药品",
+            prop: "isDrug",
+            formatter: function (row, column, cellValue, index) {
+              return row.isDrug == "0" ? "是" : "否";
             },
-            width: 80
+            width: 80,
           },
-        ]
+        ];
         // 价格申报单
-      } else if (row.type == 'PU_PRICE_APPLY_RULE') {
+      } else if (row.type == "PU_PRICE_APPLY_RULE") {
+        // 价格
         this.cols = [
-          {label: '物料编码',  prop: 'materialCode',width: 120},
-          {label: '物料名称',  prop: 'materialName'},
-          {label: '规格',  prop: 'specification'},
-          {label: '生产厂家/代理人',  prop: 'manufacturerName'},
-          {label: '含税单价',  prop: 'taxPrice', width: 80},
-          {label: '最近价格',  prop: 'recentlyPrice', width: 80},
-          {label: '单价差',  prop: 'priceDiffer', width: 80},
-          {label: '申请理由',  prop: 'explainStr'},
-          {label: '客户',  prop: 'customerName'},
-          {label: '供应商名称1',  prop: 'supplierName1'},
-          {label: '单价1',  prop: 'unitPrice1', width: 70},
-          {label: '供应商名称2',  prop: 'supplierName2'},
-          {label: '单价2',  prop: 'unitPrice2', width: 70},
-          {label: '供应商名称3',  prop: 'supplierName3'},
-          {label: '单价3',  prop: 'unitPrice3', width: 70},
-        ]
+          { label: "物料编码", prop: "materialCode", width: 120 },
+          { label: "物料名称", prop: "materialName" },
+          { label: "规格", prop: "specification" },
+          { label: "生产厂家/代理人", prop: "manufacturerName" },
+          { label: "含税单价", prop: "taxPrice", width: 80 },
+          { label: "最近价格", prop: "recentlyPrice", width: 80 },
+          { label: "单价差", prop: "priceDiffer", width: 80 },
+          { label: "申请理由", prop: "explainStr" },
+          { label: "客户", prop: "customerName" },
+          { label: "供应商名称1", prop: "supplierName1" },
+          { label: "单价1", prop: "unitPrice1", width: 70 },
+          { label: "供应商名称2", prop: "supplierName2" },
+          { label: "单价2", prop: "unitPrice2", width: 70 },
+          { label: "供应商名称3", prop: "supplierName3" },
+          { label: "单价3", prop: "unitPrice3", width: 70 },
+
+          {
+            label: "价格类型",
+            prop: "priceType",
+            attr: {
+              is: "el-dict-tag",
+              dictName: "sys_price_type",
+            },
+          },
+          {
+            label: "配送价",
+            prop: "isDistributionPrice",
+            formatter: function (row, column, cellValue, index) {
+              return row.isDistributionPrice == "Y" ? "是" : "否";
+            },
+          },
+          { label: "价格有效期(起)", prop: "periodBegin" },
+          { label: "价格有效期(止)", prop: "periodEnd" },
+          { label: "币种名称", prop: "currencyName" },
+          { label: "无税单价", prop: "price" },
+          { label: "采购换算率", prop: "conversionRate" },
+          { label: "采购单位名称", prop: "puUnitName" },
+          { label: "单位名称", prop: "unitName" },
+          { label: "调整类型", prop: "isPriceAdjustment" },
+          {
+            label: "首次报批",
+            prop: "isApprovalFirst",
+            formatter: function (row, column, cellValue, index) {
+              return row.isApprovalFirst == "Y" ? "是" : "否";
+            },
+          },
+          { label: "预计年采购量", prop: "yPurchaseQuantity" },
+          { label: "预计年影响量", prop: "yAffectedAmount" },
+          { label: "涨幅", prop: " increase" },
+        ];
         // 采购订单
-      } else if (row.type == 'PU_ORDER_RULE') {
+      } else if (row.type == "PU_ORDER_RULE") {
         this.cols = [
-          {label: '收货客户',  prop: 'customerName'},
-          {label: '物料编码',  prop: 'materialCode', width: 120},
-          {label: '物料名称',  prop: 'materialName'},
-          {label: '生产厂家',  prop: 'manufacturerName'},
+          { label: "收货客户", prop: "customerName" },
+          { label: "物料编码", prop: "materialCode", width: 120 },
+          { label: "物料名称", prop: "materialName" },
+          { label: "生产厂家", prop: "manufacturerName" },
           // {label: '医药物料',  prop: 'isMedcine'},
-          {label: '数量',  prop: 'qty', width: 60,},
-          {label: '含税单价',  prop: 'taxPrice', width: 80},
-          {label: '价税合计',  prop: 'money', width: 80,
-            formatter: function(row, column, cellValue, index) {
-              return row.money ? parseFloat(row.money).toFixed(2) : '0.00'
+          { label: "数量", prop: "qty", width: 60 },
+          { label: "含税单价", prop: "taxPrice", width: 80 },
+          {
+            label: "价税合计",
+            prop: "money",
+            width: 80,
+            formatter: function (row, column, cellValue, index) {
+              return row.money ? parseFloat(row.money).toFixed(2) : "0.00";
             },
           },
-          {label: '赠品',  prop: 'isGift', width: 50,
-            formatter: function(row, column, cellValue, index) {
-              return row.isGift == 'Y' ? '是' : '否'
-            }        
+          {
+            label: "赠品",
+            prop: "isGift",
+            width: 50,
+            formatter: function (row, column, cellValue, index) {
+              return row.isGift == "Y" ? "是" : "否";
+            },
           },
-          {label: '折扣%',  prop: 'nitemdiscountrate', width: 70,},
-          {label: '价格类型',  prop: 'priceType', width: 80},
-        ]
+          { label: "折扣%", prop: "nitemdiscountrate", width: 70 },
+          { label: "价格类型", prop: "priceType", width: 80 },
+
+          { label: "规格", prop: "specification" },
+          { label: "单位", prop: "unitName" },
+          { label: "税率", prop: "tax" },
+          { label: "注册证号", prop: "registration" },
+          { label: "需求单号", prop: "demandCode" },
+        ];
       }
-      this.getDetailList(this.checkRow)
+      this.getDetailList(this.checkRow);
     },
     audits() {
-      if(this.ids.length == 0) {
+      if (this.ids.length == 0) {
         this.$modal.notifyWarning("请选中至少一条数据");
       } else {
-        this.$modal.confirm('确认审批选中单据?').then(() => {
-        this.$modal.loading("审批中...");
-        auditWork(this.ids).then(res => {
-          if (res.code === 200) {
+        this.$modal
+          .confirm("确认审批选中单据?")
+          .then(() => {
+            this.$modal.loading("审批中...");
+            auditWork(this.ids).then((res) => {
+              if (res.code === 200) {
+                this.$modal.closeLoading();
+                this.$modal.notifySuccess("审批成功");
+                this.searchList();
+                this.sonTableList = [];
+              }
+            });
+          })
+          .catch(() => {
             this.$modal.closeLoading();
-            this.$modal.notifySuccess("审批成功");
-            this.searchList()
-            this.sonTableList = []
-          }
-        })
-        }).catch(() => {
-          this.$modal.closeLoading();
-          this.searchList()
-          this.sonTableList = []
-        })
-      } 
+            this.searchList();
+            this.sonTableList = [];
+          });
+      }
     },
     check(row) {
-      console.log(row)
-      this.$router.push({path: row.linkUrl ,query: {billCode: row.billCode}})
+      console.log(row);
+      this.$router.push({
+        path: row.linkUrl,
+        query: { billCode: row.billCode },
+      });
     },
     audit(row) {
       this.$modal.loading("审批中...");
-      auditWork([row]).then(res => {
-        if(res.code === 200) {
+      auditWork([row])
+        .then((res) => {
+          if (res.code === 200) {
+            this.$modal.closeLoading();
+            this.$modal.notifySuccess("审批成功");
+            this.searchList();
+            this.sonTableList = [];
+          }
+        })
+        // .then(() => {
+        //   this.$refs.tables.setCurrentRow(this.tableList[this.recordIndex])
+        //   let param = {
+        //     billCode: this.tableList[this.recordIndex].billCode,
+        //     type: this.tableList[this.recordIndex].type,
+        //     ...this.sonQuery
+        //   }
+        //   getWorkDetailList(param).then(res => {
+        //     if(res.code === 200) {
+        //       this.sonTableList = res.rows
+        //       this.sonTotal = res.total
+        //     }
+        //   }).catch(err => {
+        //   })
+        // })
+        .catch(() => {
           this.$modal.closeLoading();
-          this.$modal.notifySuccess("审批成功");
-          this.searchList()
-          this.sonTableList = []
-        }
-      })
-      // .then(() => {
-      //   this.$refs.tables.setCurrentRow(this.tableList[this.recordIndex])
-      //   let param = {
-      //     billCode: this.tableList[this.recordIndex].billCode,
-      //     type: this.tableList[this.recordIndex].type,
-      //     ...this.sonQuery
-      //   }
-      //   getWorkDetailList(param).then(res => {
-      //     if(res.code === 200) {
-      //       this.sonTableList = res.rows
-      //       this.sonTotal = res.total
-      //     }
-      //   }).catch(err => {
-      //   })
-      // })
-      .catch(() => {
-        this.$modal.closeLoading();
-        this.searchList()
-        this.sonTableList = []
-      })
+          this.searchList();
+          this.sonTableList = [];
+        });
     },
     handleSizeChange(val) {
-      this.queryParams.pageSize = val
-      this.getList(this.queryParams)
+      this.queryParams.pageSize = val;
+      this.getList(this.queryParams);
     },
     handleCurrentChange(val) {
-      this.queryParams.pageNum = val
-      this.getList(this.queryParams)
+      this.queryParams.pageNum = val;
+      this.getList(this.queryParams);
     },
     sonSizeChange(val) {
-      this.sonQuery.pageSize = val
-      this.getDetailList(this.checkRow)
+      this.sonQuery.pageSize = val;
+      this.getDetailList(this.checkRow);
     },
     sonCurrentChange(val) {
-      this.sonQuery.pageNum = val
-      this.getDetailList(this.checkRow)
+      this.sonQuery.pageNum = val;
+      this.getDetailList(this.checkRow);
     },
     // 获取单据概述列表
-    getDetailList (row) {
+    getDetailList(row) {
       this.$modal.loading("加载中...");
       let param = {
         billCode: row.billCode,
         type: row.type,
-        ...this.sonQuery
-      }
-      getWorkDetailList(param).then(res => {
-        if(res.code === 200) {
-          this.sonTableList = res.rows
-          this.sonTotal = res.total
+        ...this.sonQuery,
+      };
+      getWorkDetailList(param)
+        .then((res) => {
+          if (res.code === 200) {
+            this.sonTableList = res.rows;
+            this.sonTotal = res.total;
+            this.$modal.closeLoading();
+          }
+        })
+        .catch((err) => {
           this.$modal.closeLoading();
-        }
-      }).catch(err => {
-        this.$modal.closeLoading();
-      })
+        });
     },
-  }
-}
+  },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -423,4 +551,4 @@ export default {
 .el-table .el-table__header-wrapper th {
   font-size: 14px;
 }
-</style>
+</style>