Przeglądaj źródła

Merge branch 'dev_v2' of ssh://gogs.zfire.top:2222/zfire-front/supply-front into dev_v2

aXin-0810 2 lat temu
rodzic
commit
5e092acdf2

+ 33 - 0
src/api/stock.js

@@ -1,4 +1,37 @@
 import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getListStockToDayV2(params) {
+  return request({
+    url: `/stock/manager/listStockToDayV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListStockToDayV2(data, name) {
+  return postBlob({
+    url: '/stock/manager/listStockToDayV2/export',
+    data,
+    name
+  })
+}
+
+export function getListStockToDayCustomerV2(params) {
+  return request({
+    url: `/stock/manager/listStockToDayCustomerV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+
+export function exportListStockToDayCustomerV2(data, name) {
+  return postBlob({
+    url: '/stock/manager/listStockToDayCustomerV2/export',
+    data,
+    name
+  })
+}
+
+
 
 // 获取库存列表
 export function getStockList(params) {

+ 33 - 1
src/api/supply/commercial_list.js

@@ -1,4 +1,4 @@
-import request from '@/utils/request'
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
 
 // 删除
 export function getBusPriceDelete(params) {
@@ -31,6 +31,38 @@ export function getBusPriceExport(params) {
     params
   })
 }
+// 商用工程产品价格-列表
+export function v2BusPriceList(data) {
+  return request({
+    url: `/v2/bus/price/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//工程信息单-导出
+export function v2BusPriceListExport(data, name) {
+  return postBlob({
+    url: '/v2/bus/price/list/export',
+    method: 'post',
+    data,
+    name
+  })
+}
+
+//下载商用工程产品价格模板
+export function v2BusPriceListExcel(data, name) {
+  return getBlob({
+    url: 'bus/price/download',
+    data,
+    name
+  })
+}
+//商用工程产品价格-导入
+export function v2BusPriceListImport(data) {
+  return handleImport('/bus/price/import', data.formdata, data.id || '')
+}
+
 // 商用工程产品价格列表
 export function getBusPriceList(params) {
   return request({

+ 15 - 2
src/api/supply/purchase.js

@@ -1,5 +1,18 @@
-import request from '@/utils/request'
-
+import request, { postBlob, handleImport, getBlob } from '@/utils/request'
+export function getPlanCustomerListV2(params) {
+  return request({
+    url: `/plan/listCustomerV2?moduleId=${params.moduleId}`,
+    method: 'post',
+    data: params
+  })
+}
+export function exportPlanCustomerListV2(data, name) {
+  return postBlob({
+    url: '/plan/listCustomerV2/export',
+    data,
+    name
+  })
+}
 // 获取采购单列表
 export function getPurchaseList(params) {
   return request({

+ 17 - 2
src/components/template/selectData.js

@@ -1,14 +1,29 @@
 import { getWarehouseList } from '@/api/supply/engin'
+import { getCategoryList } from '@/api/common'
+
 export default {
   // 仓库下拉数据
-  stock() {
+  STOCK() {
     return new Promise((r, j) => {
       getWarehouseList({
         pageNum: 1,
         pageSize: -1
       })
         .then(res => {
-          r({ data: res.data.map(item => ({ dictCode: item.id, dictValue: item.name })) })
+          r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) })
+        })
+        .catch(j)
+    })
+  },
+  // 存货类别
+  CATEGORY() {
+    return new Promise((r, j) => {
+      getCategoryList({
+        pageNum: 1,
+        pageSize: -1
+      })
+        .then(res => {
+          r({ data: res.data.records.map(item => ({ dictCode: item.id, dictValue: item.name })) })
         })
         .catch(j)
     })

+ 63 - 234
src/views/basic_data/stock/product_list.vue

@@ -1,254 +1,83 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div class="screen-container">
-      <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="90px" 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="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="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="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="correspondId">
-                  <el-select
-                    v-model="screenForm.correspondId"
-                    multiple
-                    style="width: 100%"
-                    placeholder="请选择仓库"
-                    size="mini"
-                    filterable
-                    clearable
-                  >
-                    <el-option
-                      v-for="(item, index) in warehouseList"
-                      :key="index"
-                      :label="item.name"
-                      :value="item.id"
-                    />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="存货类别" prop="categoryId">
-                  <el-select
-                    v-model="screenForm.categoryId"
-                    style="width: 100%"
-                    placeholder="选择存货类别"
-                    filterable
-                    clearable
-                    multiple
-                  >
-                    <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.id" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-
-              <el-col :xs="24" :sm="12" :lg="12" class="tr">
-                <el-form-item>
-                  <el-button @click="resetScreenForm">清空</el-button>
-                  <el-button type="primary" @click="submitScreenForm">搜索</el-button>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <div class="mymain-container">
-      <div class="btn-group clearfix">
-        <div>
-          <ExportButton :ex-url="'/stock/manager/exportStockToDay'" :ex-params="exParams" />
-        </div>
-      </div>
-      <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="correspondName" min-width="100" show-overflow-tooltip />
-          <el-table-column align="left" label="存货类别" prop="categoryName" min-width="100" show-overflow-tooltip />
-          <el-table-column align="left" label="物料代码" prop="materialNumber" min-width="150" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copy-text="scope.row.materialNumber" />
-              <span>{{ scope.row.materialNumber }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="150" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copy-text="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 :copy-text="scope.row.materialName" />
-              <span>{{ scope.row.materialName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="规格型号" prop="specification" min-width="300" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copy-text="scope.row.specification" />
-              <span>{{ scope.row.specification }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="right" label="可用数量" prop="stockAdequate" min-width="100" show-overflow-tooltip />
-          <el-table-column align="right" label="开单未提数量" prop="num" min-width="100" show-overflow-tooltip />
-          <el-table-column align="right" label="结存数量" prop="balanceNumber" min-width="100" show-overflow-tooltip />
-        </el-table>
-      </div>
-    </div>
-    <div class="pagination clearfix">
-      <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"
+    :exportList="exportList"
+    :operation="operation()"
+    :columnParsing="columnParsing"
+  >
+  </template-page>
 </template>
 
 <script>
-import { getListStockToDay } from '@/api/stock'
-import { getCategoryList } from '@/api/common'
-import { getWarehouseList } from '@/api/supply/apply'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { getListStockToDayV2, exportListStockToDayV2 } from '@/api/stock'
 
 export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
-      dataList: null, // 列表数据
-      listLoading: false, // 列表加载loading
-      screenForm: {
-        categoryId: [],
-        correspondId: [],
-        materialName: '',
-        materialNumber: '',
-        materialOldNumber: '',
-        specification: ''
-      },
-      typeList: [],
-      warehouseList: [],
-      categoryList: [],
-      isCollapse: true
-    }
-  },
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
 
-  computed: {
-    exParams() {
-      return {
-        categoryId: this.screenForm.categoryId.join(','),
-        correspondId: this.screenForm.correspondId.join(','),
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification
-      }
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
     }
   },
-  created() {
-    this.getList()
-  },
   methods: {
-    getList() {
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        categoryId: this.screenForm.categoryId.join(','),
-        correspondId: this.screenForm.correspondId.join(','),
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification
-      }
-      this.listLoading = true
-      getListStockToDay(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-      this.getWarehouseList()
-      this.getCategoryList()
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListStockToDayV2(...p)
     },
-    // 获取仓库列表
-    getWarehouseList() {
-      getWarehouseList({
-        pageNum: 1,
-        pageSize: -1
-      }).then(res => {
-        this.warehouseList = res.data.records
-      })
+    // 列表导出函数
+    exportList: exportListStockToDayV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
     },
-
-    // 获取存货类别列表
-    getCategoryList() {
-      getCategoryList({
-        pageNum: 1,
-        pageSize: -1
-      }).then(res => {
-        this.categoryList = res.data.records
-      })
-    },
-    // 提交筛选表单
-    submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
-    },
-
-    // 重置筛选表单
-    resetScreenForm() {
-        this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
     },
-
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {/* <el-button
+              size="mini"
+              type="text"
+              onClick={ () => {
+                this.visible = true
+                this.detailsId = row.id
+              }}
+            >
+              查看
+            </el-button> */}
+          </div>
+        )
+      }
     },
-
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
     }
   }
 }
 </script>
+
+<style lang="scss" scoped></style>

+ 63 - 226
src/views/basic_data/stock/product_list_customer.vue

@@ -1,246 +1,83 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div class="screen-container">
-      <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="90px" 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="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="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="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="correspondId">
-                  <el-select
-                    v-model="screenForm.correspondId"
-                    multiple
-                    style="width: 100%"
-                    placeholder="请选择仓库"
-                    size="mini"
-                    filterable
-                    clearable
-                  >
-                    <el-option
-                      v-for="(item, index) in warehouseList"
-                      :key="index"
-                      :label="item.name"
-                      :value="item.id"
-                    />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="存货类别">
-                  <el-select
-                    v-model="screenForm.categoryId"
-                    style="width: 100%"
-                    placeholder="选择存货类别"
-                    filterable
-                    clearable
-                  >
-                    <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.id" />
-                  </el-select>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <div class="mymain-container">
-      <div class="btn-group clearfix">
-        <div>
-          <ExportButton :ex-url="'/stock/manager/exportStockToDay'" :ex-params="exParams" />
-        </div>
-      </div>
-      <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="correspondName" min-width="100" show-overflow-tooltip />
-          <el-table-column align="left" label="存货类别" prop="categoryName" min-width="100" show-overflow-tooltip />
-          <el-table-column align="left" label="物料代码" prop="materialNumber" min-width="150" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copy-text="scope.row.materialNumber" />
-              <span>{{ scope.row.materialNumber }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="150" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copy-text="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 :copy-text="scope.row.materialName" />
-              <span>{{ scope.row.materialName }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="规格型号" prop="specification" min-width="300" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copy-text="scope.row.specification" />
-              <span>{{ scope.row.specification }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="right" label="可用数量" prop="stockAdequate" min-width="100" show-overflow-tooltip />
-          <el-table-column align="right" label="开单未提数量" prop="num" min-width="100" show-overflow-tooltip />
-          <el-table-column align="right" label="结存数量" prop="balanceNumber" min-width="100" show-overflow-tooltip />
-        </el-table>
-      </div>
-    </div>
-    <div class="pagination clearfix">
-      <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"
+    :exportList="exportList"
+    :operation="operation()"
+    :columnParsing="columnParsing"
+  >
+  </template-page>
 </template>
 
 <script>
-import { getListStockToDay } from '@/api/stock'
-import { getCategoryList } from '@/api/common'
-import { getWarehouseList } from '@/api/supply/apply'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { getListStockToDayCustomerV2, exportListStockToDayCustomerV2 } from '@/api/stock'
 
 export default {
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
-      dataList: null, // 列表数据
-      listLoading: false, // 列表加载loading
-      screenForm: {
-        categoryId: '',
-        correspondId: [],
-        materialName: '',
-        materialNumber: '',
-        materialOldNumber: '',
-        specification: ''
-      },
-      typeList: [],
-      warehouseList: [],
-      categoryList: [],
-      isCollapse: true
-    }
-  },
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
 
-  computed: {
-    exParams() {
-      return {
-        categoryId: this.screenForm.categoryId,
-        correspondId: this.screenForm.correspondId.join(','),
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification
-      }
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
     }
   },
-  created() {
-    this.getList()
-  },
   methods: {
-    getList() {
-      const params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        categoryId: this.screenForm.categoryId,
-        correspondId: this.screenForm.correspondId.join(','),
-        materialName: this.screenForm.materialName,
-        materialNumber: this.screenForm.materialNumber,
-        materialOldNumber: this.screenForm.materialOldNumber,
-        specification: this.screenForm.specification
-      }
-      this.listLoading = true
-      getListStockToDay(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
-      this.getWarehouseList()
-      this.getCategoryList()
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getListStockToDayCustomerV2(...p)
     },
-    // 获取仓库列表
-    getWarehouseList() {
-      getWarehouseList({
-        pageNum: 1,
-        pageSize: -1
-      }).then(res => {
-        this.warehouseList = res.data.records
-      })
+    // 列表导出函数
+    exportList: exportListStockToDayCustomerV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
     },
-
-    // 获取存货类别列表
-    getCategoryList() {
-      getCategoryList({
-        pageNum: 1,
-        pageSize: -1
-      }).then(res => {
-        this.categoryList = res.data.records
-      })
-    },
-    // 提交筛选表单
-    submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
-    },
-
-    // 重置筛选表单
-    resetScreenForm() {
-        this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
     },
-
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {/* <el-button
+              size="mini"
+              type="text"
+              onClick={ () => {
+                this.visible = true
+                this.detailsId = row.id
+              }}
+            >
+              查看
+            </el-button> */}
+          </div>
+        )
+      }
     },
-
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
     }
   }
 }
 </script>
+
+<style lang="scss" scoped></style>

+ 139 - 199
src/views/sales/price/commercial_list.vue

@@ -1,208 +1,76 @@
 <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="searchFormFn">搜索</el-button>
-        </template>
-        <template #search>
-          <el-form ref="searchForm" :model="searchForm" 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="categoryId">
-                  <el-input v-model="searchForm.categoryId" placeholder="请输入"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="物料名称" prop="materialName">
-                  <el-input v-model="searchForm.materialName" placeholder="请输入"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="物料编码" prop="materialNumber">
-                  <el-input v-model="searchForm.materialNumber" placeholder="请输入"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="销售类型" prop="saleTypeId">
-                  <el-input v-model="searchForm.saleTypeId" placeholder="请输入"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="规格" prop="specification">
-                  <el-input v-model="searchForm.specification" placeholder="请输入"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-    <!-- 按钮 -->
-    <div class="btn-group clearfix">
-      <div class="fr">
-        <el-button type="primary" size="mini" @click="downLoadFn">模板</el-button>
-        <ExportButton class="import-btn" :exUrl="'bus/price/export'" :exParams="exParams" />
-        <el-upload
-          class="import-btn"
-          action=""
-          :http-request="handleImport"
-          :file-list="importFileList"
-          :show-file-list="false"
-        >
-          <el-button type="primary" size="mini">批量导入</el-button>
-        </el-upload>
-      </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="productCode" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.productCode" />
-              <span>{{ scope.row.productCode }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column
-            align="left"
-            label="零售价格"
-            prop="retailPrice"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="批发价格"
-            prop="batchPrice"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column align="left" label="规格型号" prop="specification" min-width="160" 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>
-
-          <el-table-column
-            align="left"
-            label="金蝶物料ID"
-            prop="materialId"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="金蝶物料编码"
-            prop="materialNumber"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="金蝶物料名称"
-            prop="materialName"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="金蝶物料旧编码"
-            prop="materialOldNumber"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column align="left" label="是否促销价" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag type="success" v-if="scope.row.isPromote">是</el-tag>
-              <el-tag type="danger" v-else>否</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="是否促作废" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag type="success" v-if="scope.row.isRevoke">是</el-tag>
-              <el-tag type="danger" v-else>否</el-tag>
-            </template>
-          </el-table-column>
-
-          <el-table-column
-            align="left"
-            label="格力折扣价"
-            prop="discAmount"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="left"
-            label="备注"
-            prop="remark"
-            min-width="160"
-            show-overflow-tooltip
-          ></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)">修改</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>
-  </div>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :operation="operation()"
+    :optionsEvensGroup="optionsEvensGroup"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+  </template-page>
 </template>
 
 <script>
-import { getBusPriceList } from '@/api/supply/commercial_list'
-import { downloadFiles, handleImport } from '@/utils/util'
+import import_mixin from '@/components/template/import_mixin.js'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import {
+  getBusPriceList,
+  v2BusPriceList,
+  v2BusPriceListExport,
+  v2BusPriceListExcel,
+  v2BusPriceListImport
+} from '@/api/supply/commercial_list'
+// import { downloadFiles, handleImport } from '@/utils/util'
 export default {
+  mixins: [import_mixin],
+  components: {
+    TemplatePage
+  },
   data() {
     return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '',
+              render: this.importButton(v2BusPriceListImport)
+            }
+          ]
+        ],
+        [
+          [
+            {
+              name: '导入模版',
+              click: () => {
+                v2BusPriceListExcel({}, `${this.$route.meta.title}`)
+                  .then(res => {
+                    this.$message({
+                      message: '下载成功',
+                      type: 'success'
+                    })
+                  })
+                  .catch(err => {
+                    this.$message.error('下载失败')
+                  })
+              }
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: false
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+
       listLoading: false, // 列表加载loading
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
@@ -225,9 +93,81 @@ export default {
     }
   },
   created() {
-    this.getDataList()
+    // this.getDataList()
   },
   methods: {
+    // 列表请求函数
+    getList: v2BusPriceList,
+    // 列表导出函数
+    exportList: v2BusPriceListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        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.deleFn(row.id)
+                }}
+                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.rebuild(row)
+                }}
+              >
+                重建
+              </el-button>
+            ) : (
+              ''
+            )}
+          </div>
+        )
+      }
+    },
+
     // 更改每页数量
     handleSizeChange(val) {
       this.pageSize = val

+ 14 - 10
src/views/sales_policy/components/AddCondition.vue

@@ -1,7 +1,7 @@
 <template>
-  <el-container class="app-container mymian-container">
-    <el-header height="50px" class="header">
-      <el-page-header @back="handleBack" :content="!id ? (!edit ? '新增' : '编辑') : '详情页面'"> </el-page-header>
+  <el-container class="">
+    <el-header height="20px" >
+      <el-page-header  @back="handleBack" :content="content"> </el-page-header>
     </el-header>
     <div class="line">
       <el-divider></el-divider>
@@ -438,17 +438,20 @@ export default {
   },
 
   computed: mapState({
-    comCode: state => state.sales.code
+    comCode: state => state.sales.code,
+    content() {
+      const textArr = ['新增条件', '编辑条件', '条件详情']
+      const isShow = this.$parent.$parent.$parent.$parent.isShow - 2
+      let len = isShow ? 2 : isShow
+      return textArr[len]
+    }
   }),
   methods: {
     getList() {},
     handleBack() {
-      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 == 12) {
-        this.$parent.$parent.$parent.isShow = 4
+      const isShow = this.$parent.$parent.$parent.$parent.isShow
+      if ([4, 5].includes(isShow)) {
+        this.$parent.isEdit = 1
       } else {
         this.$parent.isCondition = 0
         Object.assign(this.$data, this.$options.data())
@@ -484,6 +487,7 @@ export default {
         const res = await getConditionMaterialDetail({
           id: this.policyId || policyId || this.id
         })
+        console.log()
         this.pop = res.data.pop
         let pop = res.data.pop.split(':')
         this.conditionBox = []

+ 2 - 5
src/views/sales_policy/components/AddPolicy.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="app-container">
+  <div>
     <div v-show="isCondition == 0">
       <!-- <el-header height="50px" class="header">
         <el-page-header content="新增" @back=";($parent.isShow = 1), ($parent.isFlag = '')" />
@@ -842,7 +842,6 @@ export default {
     },
     // 提交审核
     handleAddPolicy(policyCustomers, region) {
-      console.log(region, 'jkjkj')
       if (!this.searchForm.title) {
         this.$errorMsg('请输入说明')
         return
@@ -899,9 +898,7 @@ export default {
         addPoliy(params).then(res => {
           console.log(res)
           this.$successMsg('新增成功')
-          // this.$parent.getList()
-          this.$parent.$parent.$refs.pageRef.refreshList()
-          this.$parent.$parent.isShow = 1
+          this.$emit('close')
         })
       }
 

+ 14 - 75
src/views/sales_policy/components/Examine.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="app-container">
+  <div class="">
     <div v-if="isEdit == 1">
       <!-- <el-header height="50px" class="header">
         <el-page-header :content="funTitle()" @back=";($parent.isShow = 1), ($parent.id = '')" />
@@ -86,7 +86,7 @@
             </el-col>
           </el-row>
 
-          <el-row v-if="detail.imgSrc && $parent.$parent.$parent.isShow !== 5" class="img-box">
+          <el-row v-if="detail.imgSrc" class="img-box">
             <el-col :span="24" class="item">
               <div class="label" style="height: 150px">政策封面图</div>
               <div class="value" style="height: 150px">
@@ -116,14 +116,6 @@
               </div>
             </el-col>
           </el-row>
-          <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">
-                <ImageUpload :file-list="fileList" :multiple="false" />
-              </div>
-            </el-col>
-          </el-row>
           <el-row v-if="this.$parent.$parent.$parent.isShow == 4">
             <el-col :span="8" class="item">
               <div class="label">审核人</div>
@@ -174,17 +166,6 @@
                   ex-text="导出货品"
                   :ex-params="{ policyId: detail.code }"
                 />
-
-                <el-upload
-                  v-if="$parent.$parent.$parent.isShow == 5"
-                  class="import-btn"
-                  :action="baseURL + 'student/import'"
-                  :http-request="handleImport"
-                  :file-list="importFileList"
-                  :show-file-list="false"
-                >
-                  <el-button size="small">导入货品价格表</el-button>
-                </el-upload>
               </el-col>
               <el-col :span="12" class="tr">
                 <!-- <el-button size="small" @click="$parent.isShow = 10"
@@ -266,30 +247,6 @@
                 {{ scope.row.status ? '启用' : '作废' }}
               </template>
             </el-table-column>
-            <!-- <el-table-column
-              label="操作"
-              align="left"
-              width="150"
-              v-if="$parent.isShow == 5 && detail.examineStatus == 'SAVE'"
-            >
-              <template slot-scope="scope">
-                <el-popconfirm
-                  confirm-button-text="好的"
-                  cancel-button-text="不用了"
-                  icon="el-icon-info"
-                  icon-color="red"
-                  title="内容确定删除吗?"
-                  @onConfirm="hanleDelete(scope.row.id)"
-                >
-                  <el-button
-                    slot="reference"
-                    type="text"
-                    class="textColor el-popover-left"
-                    >删除</el-button
-                  >
-                </el-popconfirm>
-              </template>
-            </el-table-column> -->
           </el-table>
           <!-- 分页 -->
           <div style="margin: 20px 0">
@@ -321,28 +278,10 @@
             </el-table-column>
             <el-table-column label="操作" align="left" width="150">
               <template slot-scope="scope">
-                <template v-if="$parent.$parent.$parent.isShow == 5">
-                  <el-button type="text" size="small" @click="getCommonApi(scope.row)">编辑</el-button>
-                  <el-popconfirm
-                    confirm-button-text="好的"
-                    cancel-button-text="不用了"
-                    icon="el-icon-info"
-                    icon-color="red"
-                    title="内容确定删除吗?"
-                    @onConfirm="handleCondition(scope.row.id, scope.$index)"
-                  >
-                    <el-button slot="reference" type="text" class="textColor el-popover-left">删除</el-button>
-                  </el-popconfirm>
-                </template>
                 <el-button
-                  v-else
                   type="text"
                   size="small"
-                  @click="
-                    ;($parent.$parent.$parent.isShow = 10),
-                      ($parent.$parent.$parent.policyId = scope.row.id),
-                      $parent.$parent.$parent.isShow === 8 ? (detailFang = false) : (detailFang = true)
-                  "
+                  @click="getCommonApi(scope.row)"
                   >查看条件</el-button
                 >
               </template>
@@ -608,7 +547,7 @@
             </div>
           </div>
           <div
-            v-if="$parent.$parent.$parent.isShow == 8 && detail.examineStatus == 'WAIT'"
+            v-if="$parent.$parent.$parent.isShow == 5 && detail.examineStatus == 'WAIT'"
             class="descriptions diy-table-1"
           >
             <el-row>
@@ -635,14 +574,9 @@
             </el-row>
           </div>
         </div>
-        <div>
-          <el-button v-if="$parent.$parent.$parent.isShow == 5" type="primary" size="default" @click="handleSave"
-            >保存</el-button
-          >
-        </div>
       </div>
     </div>
-    <EditCondition v-else :id="cid" :policy-id="cpolicyId" />
+    <AddCondition v-else :id="cid" @close="handleConditionClose"/>
   </div>
 </template>
 
@@ -659,7 +593,7 @@ import {
   updatePolicy,
   getPolicyList
 } from '@/api/policy_list'
-import EditCondition from './EditCondition'
+import AddCondition from './AddCondition'
 import ImageUpload from '@/components/Common/image-upload.vue'
 
 import { handleImport } from '@/utils/util'
@@ -675,7 +609,7 @@ export default {
     }
   },
   components: {
-    EditCondition,
+    AddCondition,
     ImageUpload
   },
   mixins: [Minxin],
@@ -767,6 +701,9 @@ export default {
   },
   created() {},
   methods: {
+    handleConditionClose(){
+      this.isEdit = 1
+    },
     funTitle() {
       console.log()
       let title = '详情页'
@@ -862,6 +799,7 @@ export default {
     },
     // 检查文件类型
     checkFileType(url) {
+
       if (!url) return ''
       const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
 
@@ -901,8 +839,9 @@ export default {
       this.handletwoList()
     },
     getCommonApi(row) {
-      ;(this.isEdit = 2), (this.cid = row.id), (this.cpolicyId = row.policyId)
-      console.log(this.cpolicyId, this.detail.code, this.cpolicyId == this.detail.code)
+     this.isEdit = 2
+     this.cid = row.id
+     this.cpolicyId = row.policyId
     },
     getCond() {
       this.listLoading = true

+ 11 - 13
src/views/sales_policy/components/details.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="app-container mymain-container">
+  <div class="">
     <div v-if="isEdit == 1">
       <!-- <el-header height="50px" class="header">
         <el-page-header :content="funTitle()" @back=";($parent.isShow = 1), ($parent.id = '')" />
@@ -348,13 +348,7 @@
                       <el-button slot="reference" type="text" class="textColor el-popover-left">删除</el-button>
                     </el-popconfirm>
                   </template>
-                  <el-button
-                    v-else
-                    type="text"
-                    size="mini"
-                    @click=";($parent.$parent.$parent.isShow = 12), ($parent.$parent.$parent.policyId = scope.row.id)"
-                    >查看条件</el-button
-                  >
+                  <el-button v-else type="text" size="mini" @click="getCommonApi(scope.row)">查看条件</el-button>
                 </template>
               </el-table-column>
             </el-table>
@@ -694,7 +688,7 @@
         </div>
       </div>
     </div>
-    <EditCondition v-else :id="cid" :policy-id="cpolicyId" />
+    <AddCondition v-else :id="cid" @close="handleConditionClose" />
   </div>
 </template>
 
@@ -711,7 +705,7 @@ import {
   updatePolicy,
   getPolicyList
 } from '@/api/policy_list'
-import EditCondition from './EditCondition'
+import AddCondition from './AddCondition'
 import ImageUpload from '@/components/Common/image-upload.vue'
 
 import { handleImport } from '@/utils/util'
@@ -721,7 +715,7 @@ import Minxin from '@/mixin'
 export default {
   name: 'Examine',
   components: {
-    EditCondition,
+    AddCondition,
     ImageUpload
   },
   mixins: [Minxin],
@@ -817,6 +811,9 @@ export default {
   },
   created() {},
   methods: {
+    handleConditionClose() {
+      this.isEdit = 1
+    },
     funTitle() {
       const title = '详情页'
       return title
@@ -934,8 +931,9 @@ export default {
       this.handletwoList()
     },
     getCommonApi(row) {
-      ;(this.isEdit = 2), (this.cid = row.id), (this.cpolicyId = row.policyId)
-      console.log(this.cpolicyId, this.detail.code, this.cpolicyId == this.detail.code)
+      this.isEdit = 2
+      this.cid = row.id
+      this.cpolicyId = row.policyId
     },
     getCond() {
       this.listLoading = true

+ 2 - 6
src/views/sales_policy/components/editPolicy.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div v-show="isCondition == 0" class="app-container mymain-container">
+    <div v-show="isCondition == 0" class="">
       <!-- <el-header height="50px" class="header">
         <el-page-header content="编辑" @back=";($parent.isShow = 1), ($parent.isFlag = '')" />
       </el-header> -->
@@ -950,13 +950,9 @@ export default {
           policyCustomers: arr,
           imgSrc: imgUrl.join(',')
         }
-        console.log(this.fileList)
         updatePolicy(params).then(res => {
-          console.log(res)
           this.$successMsg('编辑成功')
-          // this.$parent.getList()
-          this.$parent.$parent.$parent.$refs.pageRef.refreshList()
-          this.isShow = 1
+          this.$emit('close')
         })
       }
 

+ 15 - 43
src/views/sales_policy/policy_list.vue

@@ -1,10 +1,4 @@
 <template>
-  <!-- <AddPolicy v-else-if="isShow === 2" />
-  <AddCondition v-else-if="isShow === 10 || isShow === 12" :id="id" :policy-id="policyId" />
-  <EditPolicy v-else-if="isShow === 5" />
-  <Details v-else-if="isShow === 4" />
-  <Examine v-else /> -->
-
   <template-page
     ref="pageRef"
     :getList="getList"
@@ -17,11 +11,10 @@
   >
     <Popu v-if="isShow !== 1">
       <el-page-header slot="head" :content="content" @back="handleClose" />
-      <AddPolicy v-if="isShow === 2" />
-      <AddCondition v-if="isShow === 10 || isShow === 12" :id="id" :policy-id="policyId" />
-      <EditPolicy v-if="isShow === 5" :id="id" />
-      <Details v-if="isShow === 4" />
-      <Examine v-if="isShow === 8" />
+      <AddPolicy v-if="isShow === 2" @close="handleClose" />
+      <EditPolicy v-if="isShow === 3" :id="id" @close="handleClose" />
+      <Details v-if="isShow === 4" @close="handleClose" />
+      <Examine v-if="isShow === 5" @close="handleClose" />
     </Popu>
   </template-page>
 </template>
@@ -61,19 +54,6 @@ export default {
   data() {
     return {
       showPage: true,
-      // content: '商用工程信息单',
-      // 关闭新增弹窗
-      handleClose: this.addOff(() => {
-        if (this.isShow === 2 || this.isShow === 5) {
-          this.isShow = 1
-        }
-        if (this.isShow === 8 || this.isShow == 4 || this.isShow == 10 || this.isShow == 12) {
-          this.isShow = 1
-          this.id = ''
-        }
-        this.showPage = true
-        this.$refs.pageRef.refreshList()
-      }),
       // 事件组合
       optionsEvensGroup: [
         [
@@ -169,23 +149,8 @@ export default {
   computed: mapState({
     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
+      const textArr = ['新增', '编辑', '详情', '审核']
+      return textArr[this.isShow - 2]
     }
   }),
   methods: {
@@ -201,6 +166,13 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
+    handleClose() {
+      this.addOff(() => {
+        this.isShow = 1
+        this.showPage = true
+        this.$refs.pageRef.refreshList()
+      })()
+    },
     operation() {
       return (h, { row, index, column }) => {
         return (
@@ -210,7 +182,7 @@ export default {
                 size="mini"
                 type="text"
                 onClick={async () => {
-                  this.isShow = 5
+                  this.isShow = 3
                   this.id = row.id
                 }}
               >
@@ -237,7 +209,7 @@ export default {
                 size="mini"
                 type="text"
                 onClick={async () => {
-                  this.isShow = 8
+                  this.isShow = 5
                   this.id = row.id
                   this.code = row.code
                   this.policyId = row.policyId

+ 12 - 18
src/views/supply/displace/displace_list.vue

@@ -344,9 +344,8 @@
                 size="mini"
                 @click="submitChooseBeiGoods(scope.row)"
                 :disabled="scope.row.selected"
-              >选择
-              </el-button
-              >
+                >选择
+              </el-button>
             </template>
           </el-table-column>
           <el-table-column
@@ -390,7 +389,7 @@
             <el-pagination
               @current-change="changeBeiGoodsDialogPage"
               :current-page="beiGoodsDialog_currentPage"
-              :page-size="10"
+              :page-size="100"
               background
               layout="prev, pager, next"
               :total="beiGoodsDialog_listTotal"
@@ -514,9 +513,8 @@
                 size="mini"
                 @click="submitChooseKeGoods(scope.row)"
                 :disabled="scope.row.selected"
-              >选择
-              </el-button
-              >
+                >选择
+              </el-button>
             </template>
           </el-table-column>
           <el-table-column
@@ -553,7 +551,7 @@
             <el-pagination
               @current-change="changeKeGoodsDialogPage"
               :current-page="keGoodsDialog_currentPage"
-              :page-size="10"
+              :page-size="100"
               background
               layout="prev, pager, next"
               :total="keGoodsDialog_listTotal"
@@ -616,9 +614,8 @@
           <el-table-column align="center" width="80">
             <template slot-scope="scope">
               <el-button type="primary" size="mini" @click="submitChooseOrder(scope.row)" :disabled="scope.row.selected"
-              >选择
-              </el-button
-              >
+                >选择
+              </el-button>
             </template>
           </el-table-column>
           <el-table-column
@@ -740,7 +737,7 @@
             <el-pagination
               @current-change="changeOrderDialogPage"
               :current-page="orderDialog_currentPage"
-              :page-size="10"
+              :page-size="100"
               background
               layout="prev, pager, next"
               :total="orderDialog_listTotal"
@@ -816,8 +813,7 @@ export default {
     }
   },
 
-  created() {
-  },
+  created() {},
 
   methods: {
     // 切换置换类型
@@ -896,10 +892,8 @@ export default {
           package: '',
           signType: 'MD5',
           paySign: '',
-          success(res) {
-          },
-          fail(res) {
-          }
+          success(res) {},
+          fail(res) {}
         })
       })
     },

+ 1 - 1
src/views/supply/implement/components/displace_detail.vue

@@ -30,7 +30,7 @@
         ></el-table-column>
         <el-table-column align="left" label="" min-width="80" show-overflow-tooltip>
           <template slot-scope="scope">
-            {{ scope.row.isOld ? '新机' : '旧机' }}
+            {{ scope.row.isOld ? '旧机' : '新机' }}
           </template>
         </el-table-column>
         <el-table-column

+ 85 - 302
src/views/supply/purchase/sum_list.vue

@@ -1,341 +1,124 @@
 <template>
-  <div class="app-container">
-    <!-- 筛选条件 -->
-    <div class="screen-container">
-      <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="100px" size="mini" label-position="left">
-            <el-row :gutter="20">
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="销售单号" prop="orderNum">
-                  <el-input v-model="screenForm.orderNum" placeholder="请输入销售单号"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="销售类型" prop="salesType">
-                  <el-input v-model="screenForm.salesType" placeholder="请输入销售类型"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品名称" prop="chName">
-                  <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="产品编码" prop="chNum">
-                  <el-input v-model="screenForm.chNum" placeholder="请输入产品编码"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="规格型号" prop="model">
-                  <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="品类" prop="type">
-                  <el-select v-model="screenForm.type" placeholder="全部">
-                    <el-option label="全部" value=""></el-option>
-                    <el-option
-                      v-for="item in typeList"
-                      :key="item.dictCode"
-                      :label="item.dictValue"
-                      :value="item.dictCode"
-                    ></el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="经销商名称" prop="jxsName">
-                  <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="经销商编码" prop="jxsNum">
-                  <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编码"></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-          </el-form>
-        </template>
-      </Collapse>
-    </div>
-
-    <div class="mymain-container">
-      <div class="btn-group clearfix">
-        <div class="fr">
-          <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
-        </div>
-      </div>
-      <div class="table">
-        <el-table
-          v-loading="listLoading"
-          :data="dataList"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          stripe
-          @selection-change="handleSelectionChange"
-        >
-          <el-table-column align="center" type="selection" width="55"></el-table-column>
-          <el-table-column
-            align="center"
-            label="单据号"
-            prop="billNo"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column align="center" label="订单类型" prop="orderType" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{ scope.row.orderType | orderTypeFilter }}
-            </template>
-          </el-table-column>
-          <el-table-column
-            align="center"
-            label="销售类型"
-            prop="saleName"
-            min-width="160"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" 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="140" 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="160" 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="350" 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="center"
-            label="计量单位"
-            prop="unit"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="数量"
-            prop="number"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="单价"
-            prop="price"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            label="金额"
-            prop="amount"
-            min-width="100"
-            show-overflow-tooltip
-          ></el-table-column>
-          <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.customerNumber" />
-              <span>{{ scope.row.customerNumber }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <CopyButton :copyText="scope.row.customerName" />
-              <span>{{ scope.row.customerName }}</span>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
-    </div>
-    <div class="pagination clearfix">
-      <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>
-
-    <div class="">
+  <div style="height: 100%">
+    <template-page
+      style="height: 90%"
+      ref="pageRef"
+      :getList="getList"
+      :exportList="exportList"
+      :tableEvents="tableEvents"
+      :tableAttributes="tableAttributes"
+      :operation="operation()"
+      :columnParsing="columnParsing"
+    >
+    </template-page>
+    <div class="btn">
       <div>
         <el-button size="small" type="primary" @click="clickSubmit()">提 交</el-button>
       </div>
-      <div style="margin-top: 10px; font-size: 14px; color: #666">注:提交成功后,系统将自动生成采购计划订单</div>
+      <div class="tip">注:提交成功后,系统将自动生成采购计划订单</div>
     </div>
   </div>
 </template>
 
 <script>
-import { getSumList, submitPlan } from '@/api/supply/purchase'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import { getPlanCustomerListV2, exportPlanCustomerListV2, submitPlan } from '@/api/supply/purchase'
 import { getDictList } from '@/api/common'
-
 export default {
-  filters: {
-    orderTypeFilter(val) {
-      const MAP = {
-        1: '工程计划单',
-        2: '零售计划单'
-      }
-      return MAP[val]
-    }
-  },
+  components: { TemplatePage, Popu },
+  mixins: [import_mixin, add_callback_mixin],
   data() {
     return {
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
-      dataList: null, // 列表数据
-      listLoading: false, // 列表加载loading
-      screenForm: {
-        // 筛选表单数据
-        orderNum: '',
-        salesType: '',
-        chName: '',
-        chNum: '',
-        model: '',
-        type: '',
-        jxsName: '',
-        jxsNum: ''
-      },
-      typeList: [],
-      isCollapse: true,
-      multipleSelection: []
-    }
-  },
-
-  computed: {
-    exParams() {
-      return {
-        billNo: this.screenForm.orderNum,
-        saleName: this.screenForm.salesType,
-        materialName: this.screenForm.chName,
-        materialNumber: this.screenForm.chNum,
-        specification: this.screenForm.model,
-        materialType: this.screenForm.type,
-        customerName: this.screenForm.jxsName,
-        customerNumber: this.screenForm.jxsNum
+      visible: false,
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      }, // 关闭新增弹窗
+
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
       }
     }
   },
-
-  created() {
-    this.getDictList()
-    this.getList()
-  },
-
   methods: {
-    // 查询按钮权限
-    checkBtnRole(value) {
-      // let btnRole = this.$route.meta.roles;
-      // if(!btnRole) {return true}
-      // let index = btnRole.indexOf(value);
-      // return index >= 0;
-      return true
-    },
-
-    getDictList() {
-      getDictList({ sysDictEnum: 'PRODUCT_TYPE' }).then(res => {
-        this.typeList = res.data
-      })
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getPlanCustomerListV2(...p)
     },
-
-    // 查询列表
-    getList() {
-      this.listLoading = true
-
-      let params = {
-        pageNum: this.currentPage,
-        pageSize: this.pageSize,
-        billNo: this.screenForm.orderNum,
-        saleName: this.screenForm.salesType,
-        materialName: this.screenForm.chName,
-        materialNumber: this.screenForm.chNum,
-        specification: this.screenForm.model,
-        materialType: this.screenForm.type,
-        customerName: this.screenForm.jxsName,
-        customerNumber: this.screenForm.jxsNum
-      }
-      getSumList(params).then(res => {
-        this.dataList = res.data.records
-        this.listTotal = res.data.total
-        this.listLoading = false
-      })
+    // 列表导出函数
+    exportList: exportPlanCustomerListV2,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
     },
-
-    // 提交筛选表单
-    submitScreenForm() {
-      this.currentPage = 1
-      this.getList()
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
     },
-
-    // 重置筛选表单
-    resetScreenForm() {
-        this.$refs.screenForm.resetFields()
-      this.currentPage = 1
-      this.getList()
-    },
-
-    // 更改每页数量
-    handleSizeChange(val) {
-      this.pageSize = val
-      this.currentPage = 1
-      this.getList()
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-button
+              size="mini"
+              type="text"
+              onClick={() => {
+                this.visible = true
+                this.detailsId = row.id
+              }}
+            >
+              查看
+            </el-button>
+          </div>
+        )
+      }
     },
-
-    // 更改当前页
-    handleCurrentChange(val) {
-      this.currentPage = val
-      this.getList()
+    handleClose() {
+      this.addOff(() => {
+        this.visible = false
+      })()
     },
-
-    // 表格选择
-    handleSelectionChange(val) {
-      this.multipleSelection = val
+    getDictList() {
+      getDictList({ sysDictEnum: 'PRODUCT_TYPE' }).then(res => {
+        this.typeList = res.data
+      })
     },
 
     // 提交
     clickSubmit() {
-      if (this.multipleSelection.length < 1) {
+      if (this.recordSelected.length < 1) {
         return this.$errorMsg('请选择单据')
       }
       let ids = []
-      this.multipleSelection.forEach(item => {
+      this.recordSelected.forEach(item => {
         ids.push(item.id)
       })
       submitPlan(ids).then(res => {
         this.$successMsg()
-        this.getList()
+        this.$refs.pageRef.refreshList()
       })
     }
   }
 }
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.btn {
+  margin: 0 20px;
+}
+.tip {
+  margin-top: 10px;
+  text-align: left;
+  font-size: 14px;
+  color: #f00;
+
+}
+</style>