Browse Source

【修改】bug

howie 2 năm trước cách đây
mục cha
commit
4d072d5701
1 tập tin đã thay đổi với 157 bổ sung141 xóa
  1. 157 141
      src/views/supply/price/difference_modify_list.vue

+ 157 - 141
src/views/supply/price/difference_modify_list.vue

@@ -36,28 +36,28 @@
                   ></el-input>
                 </el-form-item>
               </el-col>
-<!--              <el-col :xs="24" :sm="12" :lg="6">-->
-<!--                <el-form-item label="生效日期" prop="startDate">-->
-<!--                  <el-date-picker-->
-<!--                    v-model="screenForm.startDate"-->
-<!--                    type="datetime"-->
-<!--                    placeholder="请输入生效日期"-->
-<!--                    value-format="yyyy-MM-dd HH:mm:ss"-->
-<!--                  >-->
-<!--                  </el-date-picker>-->
-<!--                </el-form-item>-->
-<!--              </el-col>-->
-<!--              <el-col :xs="24" :sm="12" :lg="6">-->
-<!--                <el-form-item label="失效日期" prop="endDate">-->
-<!--                  <el-date-picker-->
-<!--                    v-model="screenForm.endDate"-->
-<!--                    type="datetime"-->
-<!--                    placeholder="请输入生效日期"-->
-<!--                    value-format="yyyy-MM-dd HH:mm:ss "-->
-<!--                  >-->
-<!--                  </el-date-picker>-->
-<!--                </el-form-item>-->
-<!--              </el-col>-->
+              <!--              <el-col :xs="24" :sm="12" :lg="6">-->
+              <!--                <el-form-item label="生效日期" prop="startDate">-->
+              <!--                  <el-date-picker-->
+              <!--                    v-model="screenForm.startDate"-->
+              <!--                    type="datetime"-->
+              <!--                    placeholder="请输入生效日期"-->
+              <!--                    value-format="yyyy-MM-dd HH:mm:ss"-->
+              <!--                  >-->
+              <!--                  </el-date-picker>-->
+              <!--                </el-form-item>-->
+              <!--              </el-col>-->
+              <!--              <el-col :xs="24" :sm="12" :lg="6">-->
+              <!--                <el-form-item label="失效日期" prop="endDate">-->
+              <!--                  <el-date-picker-->
+              <!--                    v-model="screenForm.endDate"-->
+              <!--                    type="datetime"-->
+              <!--                    placeholder="请输入生效日期"-->
+              <!--                    value-format="yyyy-MM-dd HH:mm:ss "-->
+              <!--                  >-->
+              <!--                  </el-date-picker>-->
+              <!--                </el-form-item>-->
+              <!--              </el-col>-->
               <el-col :xs="24" :sm="12" :lg="6">
                 <el-form-item label="销售类型" prop="saleTypeId">
                   <el-select
@@ -79,7 +79,7 @@
               <el-col :xs="24" :sm="12" :lg="6">
                 <el-form-item label="产品类别" prop="k3CategoryNumber">
                   <el-select
-                  style="width:100%"
+                    style="width: 100%"
                     placeholder="请选择产品类别"
                     v-model="screenForm.k3CategoryNumber"
                   >
@@ -110,24 +110,35 @@
               </el-col>
               <el-col :xs="24" :sm="24" :lg="24" class="tr">
                 <el-form-item label="">
-                  <el-button size="mini" @click="resetScreenForm">清空</el-button>
-                  <el-button size="mini" type="primary" @click="submitScreenForm"
-                  >搜索</el-button
+                  <el-button size="mini" @click="resetScreenForm"
+                    >清空</el-button
+                  >
+                  <el-button
+                    size="mini"
+                    type="primary"
+                    @click="submitScreenForm"
+                    >搜索</el-button
                   >
                 </el-form-item>
               </el-col>
             </el-row>
           </el-form>
-      </div>
+        </div>
       </div>
       <!-- 按钮 -->
       <div class="btn-group clearfix">
         <div class="fl">
-         <el-button type="primary" v-if="$checkBtnRole('add', $route.meta.roles)"   icon="el-icon-plus" size="mini" @click="addFn">新增</el-button>
+          <el-button
+            type="primary"
+            v-if="$checkBtnRole('add', $route.meta.roles)"
+            icon="el-icon-plus"
+            size="mini"
+            @click="addFn"
+            >新增</el-button
+          >
           <!-- <el-button type="primary" size="mini">编辑</el-button> -->
           <el-upload
-
-            style="margin-bottom: 10px;"
+            style="margin-bottom: 10px"
             class="import-btn"
             :action="baseURL + 'student/import'"
             :http-request="handleImport"
@@ -136,27 +147,19 @@
             :disabled="importLoading"
             v-loading="importLoading"
           >
-            <el-button
-              type="primary"
-              size="mini"
-            >导入调价单
-            </el-button>
+            <el-button type="primary" size="mini">导入调价单 </el-button>
           </el-upload>
-          <el-button
-
-            type="primary"
-            size="mini"
-            @click="hanleDownloadFiles"
-          >下载模板
+          <el-button type="primary" size="mini" @click="hanleDownloadFiles"
+            >下载模板
           </el-button>
           <el-popconfirm
-           v-if="$checkBtnRole('del', $route.meta.roles)"
+            v-if="$checkBtnRole('del', $route.meta.roles)"
             confirm-button-text="好的"
             cancel-button-text="不用了"
             icon="el-icon-info"
             icon-color="red"
             title="内容确定删除吗?"
-            style="margin-right:10px"
+            style="margin-right: 10px"
             @onConfirm="hanleDeleteAll"
           >
             <el-button
@@ -168,10 +171,20 @@
               >删除</el-button
             >
           </el-popconfirm>
-          <el-button size="mini"  v-if="$checkBtnRole('examine', $route.meta.roles)" type="warning" icon="el-icon-finished" @click="batchExamine" >批量审批</el-button>
+          <el-button
+            size="mini"
+            v-if="$checkBtnRole('examine', $route.meta.roles)"
+            type="warning"
+            icon="el-icon-finished"
+            @click="batchExamine"
+            >批量审批</el-button
+          >
         </div>
         <div class="fr">
-            <ExportButton :exUrl="'product-upd-price/export'" :exParams="exParams" />
+          <ExportButton
+            :exUrl="'product-upd-price/export'"
+            :exParams="exParams"
+          />
           <!-- <el-button type="primary" size="mini">导入</el-button>
           <el-button type="primary" size="mini">导出</el-button>
           <el-button type="primary" size="mini">打印</el-button> -->
@@ -190,7 +203,6 @@
             @select-all="hanleSelectAll"
             @select="hanleSelectAll"
             :row-class-name="tableRowClassName"
-
           >
             <el-table-column
               type="selection"
@@ -206,7 +218,7 @@
             >
               <template slot-scope="scope">
                 <CopyButton :copyText="scope.row.updPriceBillId" />
-                <span>{{scope.row.updPriceBillId}}</span>
+                <span>{{ scope.row.updPriceBillId }}</span>
               </template>
             </el-table-column>
             <el-table-column
@@ -240,7 +252,7 @@
             >
               <template slot-scope="scope">
                 <CopyButton :copyText="scope.row.materialNumber" />
-                <span>{{scope.row.materialNumber}}</span>
+                <span>{{ scope.row.materialNumber }}</span>
               </template>
             </el-table-column>
             <el-table-column
@@ -252,7 +264,7 @@
             >
               <template slot-scope="scope">
                 <CopyButton :copyText="scope.row.materialName" />
-                <span>{{scope.row.materialName}}</span>
+                <span>{{ scope.row.materialName }}</span>
               </template>
             </el-table-column>
             <el-table-column
@@ -264,7 +276,7 @@
             >
               <template slot-scope="scope">
                 <CopyButton :copyText="scope.row.materialOldNumber" />
-                <span>{{scope.row.materialOldNumber}}</span>
+                <span>{{ scope.row.materialOldNumber }}</span>
               </template>
             </el-table-column>
             <el-table-column
@@ -276,7 +288,7 @@
             >
               <template slot-scope="scope">
                 <CopyButton :copyText="scope.row.specification" />
-                <span>{{scope.row.specification}}</span>
+                <span>{{ scope.row.specification }}</span>
               </template>
             </el-table-column>
             <el-table-column
@@ -329,7 +341,7 @@
               min-width="200"
               show-overflow-tooltip
             ></el-table-column>
-           <!-- <el-table-column
+            <!-- <el-table-column
               align="left"
               label="是否促销价"
               prop="isPromote"
@@ -435,7 +447,10 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <el-tag size="mini" type="success" v-if="scope.row.examineStatus == 'SAVE'"
+                <el-tag
+                  size="mini"
+                  type="success"
+                  v-if="scope.row.examineStatus == 'SAVE'"
                   >保存</el-tag
                 >
                 <el-tag
@@ -485,10 +500,10 @@
                   >
                 </template>
                 <el-button
-                 v-if="scope.row.examineStatus == 'SAVE'"
+                  v-if="scope.row.examineStatus == 'SAVE'"
                   type="text"
                   class="textColor"
-                  @click="editFn(scope.row.updPriceBillId,scope.row)"
+                  @click="editFn(scope.row.updPriceBillId, scope.row)"
                   >编辑</el-button
                 >
                 <el-button
@@ -516,35 +531,38 @@
         </div>
       </div>
     </div>
-    <ModifyListApply v-else-if="show === 2 || show==5" :cid='cid'/>
-    <ModifyListApproval v-else-if="show === 3 " :detail="detail" />
+    <ModifyListApply v-else-if="show === 2 || show == 5" :cid="cid" />
+    <ModifyListApproval v-else-if="show === 3" :detail="detail" />
     <ModifyListDetail v-else :detail="detail" />
-       <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
+    <ExamineDialog
+      :isShow.sync="isShowExamineDialog"
+      :examineForm.sync="examineForm"
+    />
   </div>
 </template>
 
 <script>
-import ModifyListApply from './components/modify_list-apply.vue'
-import ModifyListApproval from './components/modify_list-approval.vue'
-import ModifyListDetail from './components/modify_list-detail.vue'
-import ExamineDialog from '@/components/Common/examine-dialog'
-import Mixin from '@/mixin/index'
+import ModifyListApply from "./components/modify_list-apply.vue";
+import ModifyListApproval from "./components/modify_list-approval.vue";
+import ModifyListDetail from "./components/modify_list-detail.vue";
+import ExamineDialog from "@/components/Common/examine-dialog";
+import Mixin from "@/mixin/index";
 import {
   getPriceSubmit,
   getProductRricedel,
   getProductRriceDetail,
   getProductRriceList,
   getTypeList,
-  examineData
-} from '@/api/basic_data/material'
-import {downloadFiles, handleImport} from '@/utils/util'
-import { getCategoryList } from '@/api/common'
+  examineData,
+} from "@/api/basic_data/material";
+import { downloadFiles, handleImport } from "@/utils/util";
+import { getCategoryList } from "@/api/common";
 
 export default {
   mixins: [Mixin],
   data() {
     return {
-      baseURL: '',
+      baseURL: "",
       importFileList: [],
       show: 1,
       currentPage: 1, // 当前页码
@@ -576,11 +594,11 @@ export default {
         materialName: "",
         materialNumber: "",
         startDate: "",
-        materialOldNumber:'',
-        saleTypeId:'',
-        k3CategoryNumber:'',
-        specification:'',
-        remark: ''
+        materialOldNumber: "",
+        saleTypeId: "",
+        k3CategoryNumber: "",
+        specification: "",
+        remark: "",
       },
       liDetail: {},
       detail: {},
@@ -604,14 +622,14 @@ export default {
         startDate: "",
         wallets: [],
       },
-      cid:'',
+      cid: "",
       typeList: [],
-      dictList:[],
-      importLoading:false,
-       isShowExamineDialog: false,
+      dictList: [],
+      importLoading: false,
+      isShowExamineDialog: false,
       examineForm: {
-        status: 'OK',
-        remark: '',
+        status: "OK",
+        remark: "",
       },
     };
   },
@@ -621,18 +639,18 @@ export default {
     ModifyListApproval,
     ModifyListDetail,
   },
-  computed:{
+  computed: {
     exParams() {
       return {
         materialName: this.screenForm.materialName,
         materialNumber: this.screenForm.materialNumber,
         startDate: this.screenForm.startDate,
-        materialOldNumber:this.screenForm.materialOldNumber,
-        saleTypeId:this.screenForm.saleTypeId,
-        k3CategoryNumber:this.screenForm.k3CategoryNumber,
-        specification:this.screenForm.specification,
+        materialOldNumber: this.screenForm.materialOldNumber,
+        saleTypeId: this.screenForm.saleTypeId,
+        k3CategoryNumber: this.screenForm.k3CategoryNumber,
+        specification: this.screenForm.specification,
         remark: this.screenForm.remark,
-        billType:'DIFF'
+        billType: "DIFF",
       };
     },
   },
@@ -647,10 +665,10 @@ export default {
     getTypeList(params).then((res) => {
       this.typeList = res.data.records;
     });
-   getCategoryList({ pageNum:1,pageSize:-1}).then((res) => {
-      this.dictList = res.data.records
-      console.log(this.dictList,777777)
-    })
+    getCategoryList({ pageNum: 1, pageSize: -1 }).then((res) => {
+      this.dictList = res.data.records;
+      console.log(this.dictList, 777777);
+    });
   },
   methods: {
     formatterType(row) {
@@ -664,43 +682,40 @@ export default {
       this.show = 2;
     },
     hanleDeleteAll(id) {
-
       this.hanleDeleteAllPromise(id).then((ids) => {
-
         getProductRricedel(ids).then((res) => {
           this.$successMsg("删除成功");
           this.getList();
         });
       });
     },
-      // 打开 批量审批
+    // 打开 批量审批
     batchExamine() {
       if (this.ids.length) {
         this.isShowExamineDialog = true;
-        return
+        return;
       }
-      this.$errorMsg('请选择审核项')
+      this.$errorMsg("请选择审核项");
     },
     // 提交 批量审批
     submitExamineForm() {
       // let ids = this.dis.map(item => {
       //   return item
       // });
-    const  ids = [...new Set(this.ids)]
+      const ids = [...new Set(this.ids)];
       examineData({
-        ids: ids.join(','),
+        ids: ids.join(","),
         examineStatus: this.examineForm.status,
         examineRemark: this.examineForm.remark,
-      })
-        .then((res) => {
-          this.isShowExamineDialog = false;
-          this.$successMsg("修改成功");
-          this.getList();
-        })
+      }).then((res) => {
+        this.isShowExamineDialog = false;
+        this.$successMsg("修改成功");
+        this.getList();
+      });
     },
     handleGetPriceSubmit(id) {
       console.log(id);
-      getPriceSubmit({ ids:id }).then((res) => {
+      getPriceSubmit({ ids: id }).then((res) => {
         this.$successMsg("已提审");
         this.getList();
       });
@@ -727,12 +742,12 @@ export default {
         materialName: this.screenForm.materialName,
         materialNumber: this.screenForm.materialNumber,
         startDate: this.screenForm.startDate,
-        materialOldNumber:this.screenForm.materialOldNumber,
-        saleTypeId:this.screenForm.saleTypeId,
-        k3CategoryNumber:this.screenForm.k3CategoryNumber,
-        specification:this.screenForm.specification,
+        materialOldNumber: this.screenForm.materialOldNumber,
+        saleTypeId: this.screenForm.saleTypeId,
+        k3CategoryNumber: this.screenForm.k3CategoryNumber,
+        specification: this.screenForm.specification,
         remark: this.screenForm.remark,
-        billType:'DIFF'
+        billType: "DIFF",
       };
       getProductRriceList(params).then((res) => {
         this.dataList = res.data.records;
@@ -741,9 +756,8 @@ export default {
       });
     },
     editFn(id, row) {
-          this.cid = id
-         this.show = 5;
-
+      this.cid = id;
+      this.show = 5;
 
       // this.diaLogForm = {
       //   id,
@@ -789,7 +803,7 @@ export default {
         freeDay: this.screenForm.freeDay,
         toll: this.screenForm.toll,
         remark: this.screenForm.remark,
-        billType:'DIFF'
+        billType: "DIFF",
       };
       downloadFiles("product-compose/export", screenData);
     },
@@ -806,53 +820,55 @@ export default {
     },
     // 导入
     async handleImport(param) {
-      this.importLoading = true
-      const file = param.file
-      const formData = new FormData()
-      formData.append('file', file)
-      formData.append('billType', 'DIFF')
+      this.importLoading = true;
+      const file = param.file;
+      const formData = new FormData();
+      formData.append("file", file);
+      formData.append("billType", "DIFF");
 
-      const result = await handleImport('/product-upd-price/material/import', formData)
-      this.importLoading = false
-      this.importFileList = []
+      const result = await handleImport(
+        "/product-upd-price/material/import",
+        formData
+      );
+      this.importLoading = false;
+      this.importFileList = [];
       if (result.code === 200) {
-        this.$alert('成功处理记录数:' + result.data, '导入成功', {
-          confirmButtonText: '确定'
-        })
-        this.getList()
+        this.$alert("成功处理记录数:" + result.data, "导入成功", {
+          confirmButtonText: "确定",
+        });
+        this.getList();
       } else {
-        this.$alert(result.message, '导入失败', {
-          confirmButtonText: '确定'
-        })
+        this.$alert(result.message, "导入失败", {
+          confirmButtonText: "确定",
+        });
       }
     },
     // 下载经销商模板
     hanleDownloadFiles() {
-      downloadFiles('product-upd-price/download',{
-        billType:'DIFF'
-      })
+      downloadFiles("product-upd-price/download", {
+        billType: "DIFF",
+      });
     },
-    tableRowClassName({row, rowIndex}) {
+    tableRowClassName({ row, rowIndex }) {
       // || row.examineStatus=='FAIL'
-     if (this.ids.includes(row.updPriceBillId)) {
-          return 'warning-row';
-        }
-        return '';
+      if (this.ids.includes(row.updPriceBillId)) {
+        return "warning-row";
+      }
+      return "";
     },
   },
 };
 </script>
 
 <style lang="scss" scoped>
-
-  ::v-deep .el-table .warning-row {
-    background:  oldlace;
-  }
+::v-deep .el-table .warning-row {
+  background: oldlace;
+}
 ::v-deep .el-select--small {
   width: 100%;
 }
-.import-btn{
+.import-btn {
   display: inline-block;
-    margin: 0 10px;
+  margin: 0 10px;
 }
 </style>