Jelajahi Sumber

feature: bug修改

chenqilong 2 tahun lalu
induk
melakukan
f4159590fd

+ 20 - 1
src/api/basic_data/taker.js

@@ -1,4 +1,23 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+
+// 提货人档案-列表
+export function v2TakerRecordList(data) {
+  return request({
+    url: `/v2/taker-record/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//提货人档案-导出
+export function v2TakerRecordListExport(data, name) {
+  return postBlob({
+    url: '/v2/taker-record/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
 
 //提货人档案列表
 export function getList(params) {

+ 121 - 163
src/views/basic_data/taker/taker_list.vue

@@ -1,161 +1,15 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div>
-      <Collapse :screen-form="searchForm">
-        <template #right_btn>
-          <el-button size="mini" @click="clearFn">清空</el-button>
-          <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="searchForm" :model="searchForm" label-width="100px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="经销商名称" prop="customerName">
-                  <el-input v-model="searchForm.customerName" placeholder="请输入经销商名称"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="提货人姓名" prop="takerName">
-                  <el-input v-model="searchForm.takerName" placeholder="请输入提货人姓名"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="电话" prop="phoneKeyword">
-                  <el-input v-model="searchForm.phoneKeyword" placeholder="请输入电话"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!-- 按钮 -->
-    <div class="btn-group clearfix">
-      <div class="fl">
-        <el-button v-if="$checkBtnRole('add', $route.meta.roles)" type="primary" size="mini" @click="addFn"
-          >新增</el-button
-        >
-      </div>
-      <div class="fr">
-        <ExportButton :exUrl="'taker-record/export'" :exParams="exParams" />
-      </div>
-    </div>
-    <!-- 列表 -->
-    <div class="mymain-container">
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-        >
-          <el-table-column align="left" label="经销商名称" prop="customerName" min-width="260" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.customerName" />
-              <span>{{ scope.row.customerName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column
-            align="left"
-            label="提货人姓名"
-            prop="takerName"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="身份证"
-            prop="identity"
-            min-width="170"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="联系电话"
-            prop="phone"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="备用电话"
-            prop="sparePhone"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="有效期"
-            prop="expireTime"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建人"
-            prop="createBy"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="创建时间"
-            prop="createTime"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column align="left" label="状态" prop="flag" min-width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" type="success" v-if="scope.row.flag === 1">有效</el-tag>
-              <el-tag size="mini" type="danger" v-else-if="scope.row.flag === 2">失效</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column
-            align="center"
-            label="操作"
-            prop="caozuo"
-            min-width="160"
-            show-overflow-tooltip
-            fixed="right"
-          >
-            <template slot-scope="scope">
-              <el-button type="text" class="textColor" @click="seeFn(scope.row)">查看</el-button>
-              <el-popconfirm
-                @onConfirm="deleFn(scope.row.id)"
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                title="这是一段内容确定删除吗?"
-              >
-                <el-button type="text" class="textColor" slot="reference">删除</el-button>
-              </el-popconfirm>
-              <el-button type="text" class="textColor" @click="stopFn(scope.row.id)" v-if="scope.row.flag === 1"
-                >停用</el-button
-              >
-              <el-button type="text" class="textColor" @click="rebuild(scope.row)" v-else-if="scope.row.flag === 2"
-                >重建</el-button
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <div class="fr">
-        <el-pagination
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal"
-        >
-        </el-pagination>
-      </div>
-    </div>
-
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+    :operationColumnWidth="200"
+  >
     <!-- 弹窗 -->
     <el-dialog
       title="提货人档案"
@@ -240,18 +94,28 @@
         <el-button v-if="showOK" type="primary" @click="addDataFn">确 定</el-button>
       </div>
     </el-dialog>
-  </div>
+  </template-page>
 </template>
 
 <script>
+import TemplatePage from '@/components/template/template-page-1.vue'
 import { mapGetters } from 'vuex'
-import { getList, addDataList, getCodeApi, stopTaker, deleDataList } from '@/api/basic_data/taker'
+import {
+  getList,
+  addDataList,
+  getCodeApi,
+  stopTaker,
+  deleDataList,
+  v2TakerRecordList,
+  v2TakerRecordListExport
+} from '@/api/basic_data/taker'
 import { getDealerList } from '@/api/basic_data/dealer'
 import { downloadFiles } from '@/utils/util'
 import fileUpload from '@/components/Common/file-upload.vue'
 export default {
   components: {
-    fileUpload
+    fileUpload,
+    TemplatePage
   },
   computed: {
     ...mapGetters(['customerId', 'customerName']),
@@ -265,6 +129,28 @@ export default {
   },
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              click: () => {}
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
       baseURL: process.env.VUE_APP_BASE_API,
       isCollapse: true,
       fileList: [],
@@ -289,7 +175,7 @@ export default {
       rules: {
         customerId: [{ required: false, message: '请选择经销商', trigger: 'blur' }],
         takerName: [{ required: true, message: '请输入提货人姓名', trigger: 'blur' }],
-    
+
         phone: [
           {
             required: true,
@@ -328,11 +214,83 @@ export default {
     }
   },
   created() {
-    this.getDataList()
-
+    // this.getDataList()
     // await this.getDealerDataList({ pageNum: 1, pageSize: 10 });
   },
   methods: {
+    // 列表请求函数
+    getList: v2TakerRecordList,
+    // 列表导出函数
+    exportList: v2TakerRecordListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        console.log(row)
+        return (
+          <div class="operation-btns">
+            <el-button
+              size="mini"
+              type="text"
+              onClick={async () => {
+                this.seeFn(row)
+              }}
+            >
+              查看
+            </el-button>
+
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handleSubmit(row.enginInfoId)
+                }}
+                title="是否确定需要删除该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {row.flag === 1 ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.stopFn(row.id)
+                }}
+              >
+                停用
+              </el-button>
+            ) : (
+              ''
+            )}
+            {row.flag === 2 ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={async () => {
+                  this.stopFn(row)
+                }}
+              >
+                重建
+              </el-button>
+            ) : (
+              ''
+            )}
+          </div>
+        )
+      }
+    },
+
     //重建
     rebuild(data) {
       this.showOK = true

+ 21 - 11
src/views/sales_policy/components/AddCondition.vue

@@ -133,7 +133,14 @@
         </el-col>
       </el-row>
     </el-footer>
-    <el-dialog :visible.sync="VisibleModle" width="80%" center @close="handleClose" :close-on-click-modal="false">
+    <el-dialog
+      :visible.sync="VisibleModle"
+      append-to-body
+      width="80%"
+      center
+      @close="handleClose"
+      :close-on-click-modal="false"
+    >
       <div>
         <el-container>
           <el-header height="">
@@ -436,12 +443,15 @@ export default {
   methods: {
     getList() {},
     handleBack() {
-      if (this.$parent.$parent.$parent.isShow == 10) {
-        this.$parent.$parent.$parent.isShow = 8
-      } else if (this.$parent.$parent.$parent.isShow == 12) {
-        this.$parent.$parent.$parent.isShow = 4
+      console.log(this.$parent)
+      if (this.$parent.$parent.$parent.$parent.isShow == 10) {
+        this.$parent.$parent.$parent.$parent.isShow = 8
+      } else if (this.$parent.$parent.$parent.$parent.isShow == 12) {
+        this.$parent.$parent.$parent.$parent.isShow = 4
+      } else if (this.$parent.$parent.$parent.isShow == 4) {
+        this.$parent.isEdit = 1
       } else {
-        this.$parent.$parent.$parent.isCondition = 0
+        this.$parent.isCondition = 0
         Object.assign(this.$data, this.$options.data())
       }
     },
@@ -523,7 +533,7 @@ export default {
       for (let i = 0; i < this.conditionBox.length; i++) {
         for (let j = 0; j < this.conditionBox[i].length; j++) {
           this.conditionBox[i][j].popType = i + 1
-          this.conditionBox[i][j].policyId = this.$parent.$parent.$parent.searchForm.code || this.comCode
+          this.conditionBox[i][j].policyId = this.$parent.searchForm.code || this.comCode
           this.conditionBox[i][j].id = ''
           //  this.conditionBox[i][j].policyMaterialId =this.conditionBox[i][j].materialId
         }
@@ -542,7 +552,7 @@ export default {
       const params = {
         id: '',
         policyConditionMaterials: tableData,
-        policyId: this.$parent.$parent.$parent.searchForm.code || this.comCode,
+        policyId: this.$parent.searchForm.code || this.comCode,
         policyName: '',
         pop: pop.join(':')
       }
@@ -554,8 +564,8 @@ export default {
         this.limit = ''
         this.pop = ''
         this.popArr = {}
-        this.$parent.$parent.$parent.isCondition = 0
-        this.$parent.$parent.$parent.isFlag = 1
+        this.$parent.isCondition = 0
+        this.$parent.$parent.$parent.$parent.isFlag = 1
         // Object.assign(this.$data, this.$options.data());
         this.$emit('handleSubmitCon', this.$parent.searchForm.code || this.comCode)
       })
@@ -607,7 +617,7 @@ export default {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         saleTypeCode: this.saleTypeCode,
-        policyId: this.$parent.$parent.$parent.searchForm.code || this.comCode
+        policyId: this.$parent.searchForm.code || this.comCode
       }).then(res => {
         let datas = []
 

+ 72 - 69
src/views/sales_policy/components/details.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="app-container mymain-container">
     <div v-if="isEdit == 1">
-      <el-header height="50px" class="header">
+      <!-- <el-header height="50px" class="header">
         <el-page-header :content="funTitle()" @back=";($parent.isShow = 1), ($parent.id = '')" />
-      </el-header>
+      </el-header> -->
       <div>
         <div class="diy-table-1">
           <el-row>
@@ -79,7 +79,7 @@
               </div>
             </el-col>
           </el-row>
-          <el-row v-if="detail.imgSrc && $parent.isShow !== 5" class="img-box">
+          <el-row v-if="detail.imgSrc && $parent.$parent.$parent.isShow !== 5" class="img-box">
             <el-col :span="24" class="item">
               <div class="label" style="height: 150px">政策封面图</div>
               <div class="value" style="height: 150px">
@@ -116,7 +116,7 @@
               </div>
             </el-col>
           </el-row>
-          <el-row v-if="$parent.isShow == 5">
+          <el-row v-if="$parent.$parent.$parent.isShow == 5">
             <el-col :span="24" class="item">
               <div class="label" style="height: 150px">政策封面图</div>
               <div class="value" style="height: 150px">
@@ -124,7 +124,7 @@
               </div>
             </el-col>
           </el-row>
-          <el-row v-if="this.$parent.isShow == 4">
+          <el-row v-if="this.$parent.$parent.$parent.isShow == 4">
             <el-col :span="8" class="item">
               <div class="label">审核人</div>
               <div class="value">{{ detail.examineBy }}</div>
@@ -167,7 +167,7 @@
               <el-col :span="12">
                 <h4 style="display: inline-block; margin-right: 20px">货品信息</h4>
                 <ExportButton
-                  v-if="$parent.isShow === 4"
+                  v-if="$parent.$parent.$parent.isShow === 4"
                   style="display: inline-block"
                   :ex-url="'policy/material/export'"
                   ex-text="导出货品"
@@ -175,7 +175,7 @@
                 />
 
                 <el-upload
-                  v-if="$parent.isShow == 5"
+                  v-if="$parent.$parent.$parent.isShow == 5"
                   class="import-btn"
                   :action="baseURL + 'student/import'"
                   :http-request="handleImport"
@@ -335,7 +335,7 @@
               </el-table-column>
               <el-table-column label="操作" align="left" width="150">
                 <template slot-scope="scope">
-                  <template v-if="$parent.isShow == 5">
+                  <template v-if="$parent.$parent.$parent.isShow == 5">
                     <el-button type="text" size="mini" @click="getCommonApi(scope.row)">编辑</el-button>
                     <el-popconfirm
                       confirm-button-text="好的"
@@ -352,7 +352,7 @@
                     v-else
                     type="text"
                     size="mini"
-                    @click=";($parent.isShow = 12), ($parent.policyId = scope.row.id)"
+                    @click=";($parent.$parent.$parent.isShow = 12), ($parent.$parent.$parent.policyId = scope.row.id)"
                     >查看条件</el-button
                   >
                 </template>
@@ -366,15 +366,15 @@
               <el-col :span="12">
                 <h4 style="display: inline-block; margin-right: 20px">经销商使用范围</h4>
 
-               <template v-if="detail.flag == 0">
-                <ExportButton
-                  v-if="$parent.isShow === 4"
-                  style="display: inline-block"
-                  :ex-url="'policy/customer/export'"
-                  ex-text="导出经销商"
-                  :ex-params="{ policyId: detail.code }"
-                />
-               </template>
+                <template v-if="detail.flag == 0">
+                  <ExportButton
+                    v-if="$parent.$parent.$parent.isShow === 4"
+                    style="display: inline-block"
+                    :ex-url="'policy/customer/export'"
+                    ex-text="导出经销商"
+                    :ex-params="{ policyId: detail.code }"
+                  />
+                </template>
               </el-col>
             </el-row>
             <el-divider />
@@ -384,46 +384,46 @@
               <el-radio label="2" :disabled="detail.flag != 2">佛山经销商</el-radio>
             </el-radio-group>
           </el-row>
-          <div class="table" >
-            <template v-if="$parent.isShow != 5">
+          <div class="table">
+            <template v-if="$parent.$parent.$parent.isShow != 5">
               <template v-if="detail.flag == 0">
-              <el-table
-                v-loading="listLoading"
-                :data="custoList"
-                element-loading-text="Loading"
-                border
-                fit
-                highlight-current-row
-                stripe
-              >
-                <el-table-column fixed type="index" label="序号" width="50" align="left" />
-                <el-table-column prop="customerNumber" label="经销商编码" align="left">
-                  <template slot-scope="scope">
-                    <CopyButton :copy-text="scope.row.customerNumber" />
-                    <span>{{ scope.row.customerNumber }}</span>
-                  </template></el-table-column
+                <el-table
+                  v-loading="listLoading"
+                  :data="custoList"
+                  element-loading-text="Loading"
+                  border
+                  fit
+                  highlight-current-row
+                  stripe
                 >
-                <el-table-column prop="customerName" label="经销商名称" align="left">
-                  <template slot-scope="scope">
-                    <CopyButton :copy-text="scope.row.customerName" />
-                    <span>{{ scope.row.customerName }}</span>
-                  </template>
-                </el-table-column>
-              </el-table>
-         
-              <!-- 分页 -->
-              <div style="margin: 20px 0">
-                <el-pagination
-                  :current-page="currentPages"
-                  :page-sizes="[10, 20, 30, 50]"
-                  :page-size="10"
-                  layout="total, sizes, prev, pager, next, jumper"
-                  :total="clistTotals"
-                  @size-change="handleSizeChanges"
-                  @current-change="handleCurrentChanges"
-                />
-              </div>
-            </template>
+                  <el-table-column fixed type="index" label="序号" width="50" align="left" />
+                  <el-table-column prop="customerNumber" label="经销商编码" align="left">
+                    <template slot-scope="scope">
+                      <CopyButton :copy-text="scope.row.customerNumber" />
+                      <span>{{ scope.row.customerNumber }}</span>
+                    </template></el-table-column
+                  >
+                  <el-table-column prop="customerName" label="经销商名称" align="left">
+                    <template slot-scope="scope">
+                      <CopyButton :copy-text="scope.row.customerName" />
+                      <span>{{ scope.row.customerName }}</span>
+                    </template>
+                  </el-table-column>
+                </el-table>
+
+                <!-- 分页 -->
+                <div style="margin: 20px 0">
+                  <el-pagination
+                    :current-page="currentPages"
+                    :page-sizes="[10, 20, 30, 50]"
+                    :page-size="10"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="clistTotals"
+                    @size-change="handleSizeChanges"
+                    @current-change="handleCurrentChanges"
+                  />
+                </div>
+              </template>
             </template>
             <template v-else>
               <el-row :gutter="20">
@@ -659,9 +659,10 @@
             </template>
           </div>
 
-
-
-          <div v-if="$parent.isShow == 8 && detail.examineStatus == 'WAIT'" class="descriptions diy-table-1">
+          <div
+            v-if="$parent.$parent.$parent.isShow == 8 && detail.examineStatus == 'WAIT'"
+            class="descriptions diy-table-1"
+          >
             <el-row>
               <el-col :span="6">审核人</el-col>
               <el-col :span="6">{{ $store.getters.name }}</el-col>
@@ -687,7 +688,9 @@
           </div>
         </div>
         <div>
-          <el-button v-if="$parent.isShow == 5" type="primary" size="default" @click="handleSave">保存</el-button>
+          <el-button v-if="$parent.$parent.$parent.isShow == 5" type="primary" size="default" @click="handleSave"
+            >保存</el-button
+          >
         </div>
       </div>
     </div>
@@ -797,9 +800,9 @@ export default {
     comTitle() {
       console.log(this.detailFang, 'kkk')
       let title = '详情页'
-      if (this.$parent.isShow == 5) {
+      if (this.$parent.$parent.$parent.isShow == 5) {
         title = '编辑页'
-      } else if (this.$parent.isShow == 8 && !this.detailFang) {
+      } else if (this.$parent.$parent.$parent.isShow == 8 && !this.detailFang) {
         title = '审核页'
       } else {
         title = '详情页'
@@ -820,7 +823,7 @@ export default {
     },
     getList() {
       this.listLoading = true
-      getPolicyDetail({ policyId: this.$parent.id }).then(res => {
+      getPolicyDetail({ policyId: this.$parent.$parent.$parent.id }).then(res => {
         this.detail = res.data
         this.detail.flag = this.detail.flag + ''
         this.detail.imgSrc = this.detail.imgSrc.split(',')
@@ -828,7 +831,7 @@ export default {
           this.srcList.push(this.$imageUrl + k)
         })
         // this.srcList = [this.$imageUrl + this.detail.imgSrc]
-        if (this.$parent.isShow == 5 && this.detail.imgSrc) {
+        if (this.$parent.$parent.$parent.isShow == 5 && this.detail.imgSrc) {
           this.fileList = [
             {
               hover: '',
@@ -848,7 +851,7 @@ export default {
       getPolicyList({
         pageNum: this.policyList.currentPages,
         pageSize: this.policyList.pageSize,
-        policyId: this.$parent.id,
+        policyId: this.$parent.$parent.$parent.id,
         keyword: this.policyList.keyword
       }).then(res => {
         this.list = res.data.records
@@ -951,12 +954,12 @@ export default {
     handleSubmit() {
       toExamine({
         examineStatus: this.examineStatus,
-        policyId: this.$parent.id,
+        policyId: this.$parent.$parent.$parent.id,
         examineRemark: this.remark
       }).then(res => {
         this.$successMsg('已提交审核')
-        this.$parent.isShow = 1
-        this.$parent.getList()
+        this.$parent.$parent.$parent.isShow = 1
+        this.$parent.$parent.$parent.$refs.pageRef.refreshList()
       })
     },
     // 获取货品信息
@@ -1170,7 +1173,7 @@ export default {
         await this.getCond()
         this.$successMsg('编辑成功')
         this.fileList = []
-        this.$parent.isShow = 1
+        this.$parent.$parent.$parent.isShow = 1
       }
     }
   }

+ 22 - 3
src/views/sales_policy/policy_list.vue

@@ -61,13 +61,13 @@ export default {
   data() {
     return {
       showPage: true,
-      content: '商用工程信息单',
+      // content: '商用工程信息单',
       // 关闭新增弹窗
       handleClose: this.addOff(() => {
         if (this.isShow === 2 || this.isShow === 5) {
           this.isShow = 1
         }
-        if (this.isShow === 8) {
+        if (this.isShow === 8 || this.isShow == 4 || this.isShow == 10 || this.isShow == 12) {
           this.isShow = 1
           this.id = ''
         }
@@ -167,7 +167,26 @@ export default {
     })
   },
   computed: mapState({
-    comCode: state => state.sales.code
+    comCode: state => state.sales.code,
+    content() {
+      let title = ''
+      if (this.isShow === 10 || this.isShow === 12) {
+        title = '条件'
+      }
+      if (this.isShow === 2) {
+        title = '添加'
+      }
+      if (this.isShow === 5) {
+        title = '编辑'
+      }
+      if (this.isShow === 4) {
+        title = '详情'
+      }
+      if (this.isShow === 8) {
+        title = '审核'
+      }
+      return title
+    }
   }),
   methods: {
     // 列表请求函数

+ 7 - 1
src/views/supply/engin/components/engin_examine.vue

@@ -296,7 +296,13 @@
       </div>
     </div>
 
-    <el-dialog title="添加产品" :visible.sync="isShowGoodsDialog" width="80%">
+    <el-dialog
+      title="添加产品"
+      :modal-append-to-body="true"
+      :append-to-body="true"
+      :visible.sync="isShowGoodsDialog"
+      width="80%"
+    >
       <el-form ref="goodsScreenForm" :model="goodsScreenForm" size="small" label-position="left">
         <el-row :gutter="20">
           <el-col :xs="12" :sm="6" :lg="6">

+ 7 - 1
src/views/supply/engin/components/engin_form.vue

@@ -331,7 +331,13 @@
       </div>
     </div>
 
-    <el-dialog title="添加产品" :visible.sync="isShowGoodsDialog" width="80%">
+    <el-dialog
+      title="添加产品"
+      :modal-append-to-body="true"
+      :append-to-body="true"
+      :visible.sync="isShowGoodsDialog"
+      width="80%"
+    >
       <el-form ref="goodsScreenForm" :model="goodsScreenForm" size="small" label-position="left">
         <el-row :gutter="20">
           <el-col :xs="12" :sm="6" :lg="6">

+ 184 - 326
src/views/supply/price/difference_price_list.vue

@@ -1,302 +1,76 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div>
-      <Collapse :screen-form="screenForm">
-        <template #right_btn>
-          <el-button size="mini" @click="resetScreenForm">清空</el-button>
-          <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="screenForm" :model="screenForm" label-width="70px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="物料编码" prop="materialNumber">
-                  <el-input v-model="screenForm.materialNumber" placeholder="请输入物料编码" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品名称" prop="materialName">
-                  <el-input v-model="screenForm.materialName" placeholder="请输入产品名称" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品编码" prop="materialOldNumber">
-                  <el-input v-model="screenForm.materialOldNumber" placeholder="请输入产品编码" />
-                </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 v-model="screenForm.saleTypeId" filterable placeholder="选择销售类型" style="width: 100%">
-                    <el-option label="全部" value="" />
-                    <el-option v-for="item in ztypeList" :key="item.id" :label="item.saleName" :value="item.id" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品类别" prop="k3CategoryNumber">
-                  <el-select v-model="screenForm.k3CategoryNumber" style="width: 100%" placeholder="请选择产品类别">
-                    <el-option label="全部" value="" />
-                    <el-option v-for="item in dictList" :label="item.name" :value="item.number" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="规格型号" prop="specification">
-                  <el-input v-model="screenForm.specification" placeholder="请输入规格型号" />
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="备注" prop="remark">
-                  <el-input v-model="screenForm.remark" placeholder="请输入备注" />
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!-- 按钮 -->
-    <div class="btn-group clearfix">
-      <div>
-        <el-popconfirm
-          v-if="$checkBtnRole('del', $route.meta.roles)"
-          confirm-button-text="好的"
-          cancel-button-text="不用了"
-          icon="el-icon-info"
-          icon-color="red"
-          title="内容确定删除吗?"
-          @onConfirm="handleDelete"
-        >
-          <el-button type="primary" size="mini" icon="el-icon-delete" slot="reference" class="el-popover-left"
-            >删除</el-button
-          >
-        </el-popconfirm>
-        <el-button type="primary" style="margin-left: 10px" size="mini" @click="handleRevokeAll">批量作废</el-button>
-        <!-- <ExportButton
-          :exUrl="'product-upd-price/export'"
-          :exParams="exParams"
-          class="exp"
-        /> -->
-        <!-- <el-button type="primary" size="mini">打印</el-button> -->
-      </div>
-      <div class="fl">
-        <!-- <el-popconfirm
-                style="margin-right: 10px"
-                title="批量作废吗?"
-                @onConfirm="handleRevokeAll"
-              >
-                <el-button
-                  slot="reference"
-                  type="text"
-                  size="mini"
-                >批量作废</el-button>
-
-                </el-popconfirm> -->
-      </div>
-    </div>
-
-    <div class="mymain-container">
-      <!-- 列表 -->
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          :row-class-name="tableRowClassName"
-          @select-all="hanleSelectAll"
-          @select="hanleSelectAll"
-        >
-          <el-table-column type="selection" align="left" width="50"></el-table-column>
-          <!--          <el-table-column type="selection" align="left" />-->
-          <!-- <el-table-column
-            align="left"
-            label="产品类别"
-            prop="mainName"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column> -->
-          <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="200" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.materialNumber" />
-              <span>{{ scope.row.materialNumber }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="200" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.materialOldNumber" />
-              <span>{{ scope.row.materialOldNumber }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="产品名称" prop="materialName" min-width="200" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.materialName" />
-              <span>{{ scope.row.materialName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="规格型号" prop="specification" min-width="200" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.specification" />
-              <span>{{ scope.row.specification }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip />
-          <el-table-column align="left" label="单位" prop="unit" min-width="160" show-overflow-tooltip />
-          <!-- <el-table-column
-            align="left"
-            label="数量下限"
-            prop="qty"
-            min-width="160"
-            show-overflow-tooltip
-          />
-          <el-table-column
-            align="left"
-            label="返利类型(钱包)"
-            prop="wallets"
-            min-width="200"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <template v-for="(item, index) in scope.row.wallets">
-                <template v-if="item.type === 'REBATE'">
-                  <el-tag
-                    :key="index"
-                    type="success"
-                    style="margin: 0 10px"
-                    size="mini"
-                  >
-                    {{ item.walletName }}
-                  </el-tag>
-                </template>
-              </template>
-            </template>
-          </el-table-column>
-          <el-table-column
-            align="left"
-            label="现金钱包"
-            prop="modifyPriceDepartment"
-            min-width="200"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <template v-for="(item, index) in scope.row.wallets">
-                <template v-if="item.type === 'COMMONLY'">
-                  <el-tag
-                    :key="index"
-                    type="success"
-                    style="margin: 0 10px"
-                    size="mini"
-                  >
-                    {{ item.walletName }}
-                  </el-tag>
-                </template>
-              </template>
-            </template>
-          </el-table-column> -->
-          <el-table-column align="left" label="生效日期" prop="startDate" min-width="160" show-overflow-tooltip />
-
-          <el-table-column align="left" label="失效日期" prop="endDate" min-width="160" show-overflow-tooltip />
-          <!-- <el-table-column
-            align="left"
-            label="是否销价"
-            prop="isPromote"
-            min-width="160"
-            show-overflow-tooltip
-          >
-            <template slot-scope="scope">
-              <el-tag size="mini" v-if="scope.row.isPromote" type="success"
-                >是</el-tag
-              >
-              <el-tag size="mini" v-else type="danger">否</el-tag>
-            </template>
-          </el-table-column> -->
-          <el-table-column align="left" label="是否作废" prop="isRevoke" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" v-if="scope.row.isRevoke" type="success">是</el-tag>
-              <el-tag size="mini" v-else type="danger">否</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column align="right" label="单价" prop="batchPrice" min-width="160" show-overflow-tooltip />
-          <!-- <el-table-column
-            align="right"
-            label="格力折扣"
-            prop="discAmount"
-            min-width="160"
-            show-overflow-tooltip
-          /> -->
-          <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip />
-          <el-table-column fixed="left" width="150" label="操作" align="center">
-            <template slot-scope="scope">
-              <el-popconfirm
-                v-if="!scope.row.isRevoke"
-                style="margin-right: 10px"
-                title="作废吗?"
-                @onConfirm="handleRevoke(scope.row.id)"
-              >
-                <el-button slot="reference" type="text" size="mini">作废</el-button>
-              </el-popconfirm>
-
-              <el-button
-                v-if="$checkBtnRole('del', $route.meta.roles)"
-                type="text"
-                size="mini"
-                @click="handleDelete(scope.row.id)"
-                >删除</el-button
-              >
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-      <!-- 分页 -->
-      <div class="fr">
-        <el-pagination
-          :current-page="currentPage"
-          :page-sizes="[10, 20, 30, 50]"
-          :page-size="10"
-          layout="total, sizes, prev, pager, next, jumper"
-          :total="listTotal"
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-        />
-      </div>
-    </div>
-  </div>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :optionsEvensGroup="optionsEvensGroup"
+    :operation="operation()"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+  </template-page>
 </template>
 
 <script>
-import Mixin from '@/mixin/index'
-import { getProductDelete, getProductPriceList, getTypeList, handlePriceRevoke } from '@/api/basic_data/material'
+// import Mixin from '@/mixin/index'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import {
+  getProductDelete,
+  getProductPriceList,
+  getTypeList,
+  handlePriceRevoke,
+  v2ProductPriceList
+} from '@/api/basic_data/material'
 import { getCategoryList } from '@/api/common'
-import ExportButton from '@/components/Common/export-button.vue'
+// import ExportButton from '@/components/Common/export-button.vue'
 
 export default {
-  mixins: [Mixin],
+  mixins: [],
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '批量删除',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要删除的数据')
+                  return
+                }
+                this.handleDelete()
+              },
+              isRole: this.$checkBtnRole('del', this.$route.meta.roles)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '批量作废',
+              click: async () => {
+                if (this.recordSelected.length === 0) {
+                  this.$message.error('请选择需要作废的数据')
+                  return
+                }
+                this.handleRevokeAll()
+              }
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
       currentPage: 1,
       pageSize: 10,
       listTotal: 0,
@@ -334,60 +108,144 @@ export default {
     }
   },
   mounted() {
-    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: {
+    // 列表请求函数
+    getList(...p) {
+      let params = {
+        moduleId: p[0].moduleId,
+        orderBy: p[0].orderBy,
+        pageNum: p[0].pageNum,
+        pageSize: p[0].pageSize,
+        params: [...p[0].params, { param: 'bill_type', compare: '=', value: 'DIFF' }]
+      }
+      return v2ProductPriceList(params)
+    },
+    // 列表导出函数
+    // exportList: v2ProductPriceListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {row.isRevoke === '否' ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handleRevoke(row.id)
+                }}
+                title="是否确定需要作废该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  作废
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+
+            {this.$checkBtnRole('del', this.$route.meta.roles) ? (
+              <el-popconfirm
+                onOnConfirm={async () => {
+                  this.handleDelete(row.id)
+                }}
+                title="是否确定需要删除该项内容?"
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : (
+              ''
+            )}
+          </div>
+        )
+      }
+    },
+
     addFn() {
       this.showDialogForm = true
     },
+
+    hanleDeleteAllPromise(id) {
+      return new Promise((resolve, reject) => {
+        const ids = id
+          ? [id]
+          : this.recordSelected.map(v => {
+              return v.id
+            })
+        if (!ids.length) {
+          this.$errorMsg('请选择删除内容')
+          return
+        }
+        resolve(ids)
+      })
+    },
+
     handleDelete(id) {
       this.hanleDeleteAllPromise(id).then(ids => {
         getProductDelete(ids).then(res => {
           this.$successMsg('删除成功')
-          this.getList()
+          // this.getList()
+          this.$refs.pageRef.refreshList()
         })
       })
     },
-    getList() {
-      this.listLoading = true
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        k3CategoryNumber: this.screenForm.k3CategoryNumber,
-        endDate: this.screenForm.endDate,
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        saleTypeId: this.screenForm.saleTypeId,
-        specification: this.screenForm.specification,
-        startDate: this.screenForm.startDate,
-        remark: this.screenForm.remark,
-        billType: 'DIFF'
-      }
-      getProductPriceList(params).then(res => {
-        this.dataList = res.data.records
-        console.log(res.data.records)
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-      getTypeList({ ...params, pageNum: 1, pageSize: -1 }).then(res => {
-        this.ztypeList = res.data.records
-        // console.log(this.ztypeList, "type1111");
-      })
-    },
+    // getList() {
+    //   this.listLoading = true
+    //   const params = {
+    //     pageNum: this.currentPage,
+    //     pageSize: this.pageSize,
+    //     k3CategoryNumber: this.screenForm.k3CategoryNumber,
+    //     endDate: this.screenForm.endDate,
+    //     materialName: this.screenForm.materialName,
+    //     materialNumber: this.screenForm.materialNumber,
+    //     materialOldNumber: this.screenForm.materialOldNumber,
+    //     saleTypeId: this.screenForm.saleTypeId,
+    //     specification: this.screenForm.specification,
+    //     startDate: this.screenForm.startDate,
+    //     remark: this.screenForm.remark,
+    //     billType: 'DIFF'
+    //   }
+    //   getProductPriceList(params).then(res => {
+    //     this.dataList = res.data.records
+    //     console.log(res.data.records)
+    //     this.listTotal = res.data.total
+    //     this.listLoading = false
+    //   })
+    //   getTypeList({ ...params, pageNum: 1, pageSize: -1 }).then(res => {
+    //     this.ztypeList = res.data.records
+    //     // console.log(this.ztypeList, "type1111");
+    //   })
+    // },
     handleRevoke(id) {
       handlePriceRevoke({ ids: id }).then(res => {
         this.$successMsg('操作成功')
-        this.getList()
+        // this.getList()
+        this.$refs.pageRef.refreshList()
       })
     },
     handleRevokeAll() {
-      handlePriceRevoke({ ids: this.ids.join('') }).then(res => {
+      handlePriceRevoke({
+        ids: this.recordSelected
+          .map(v => {
+            return v.id
+          })
+          .toString()
+      }).then(res => {
         this.$successMsg('操作成功')
-        this.getList()
+        // this.getList()
+        this.$refs.pageRef.refreshList()
       })
     },
     tableRowClassName({ row, rowIndex }) {
@@ -398,7 +256,7 @@ export default {
       return ''
     }
   },
-  components: { ExportButton }
+  components: { TemplatePage }
 }
 </script>