浏览代码

no message

linwenxin 7 月之前
父节点
当前提交
debfe89af9

+ 67 - 63
src/api/material-system/vender.js

@@ -21,134 +21,138 @@ export function exportVenderGoods(data, name) {
 
 // -----------------------------------------
 
-export function newGetVenderList(data) {
+export function getNewVenderList(data) {
   return request({
-    url: `/vender/master/zfire/list?moduleId=${data.moduleId}`,
+    url: `/vender/goods/list?moduleId=${data.moduleId}`,
     method: 'post',
     data
   })
 }
 
-export function newGetVenderListExport(data, name) {
+// 导出
+export function exportNewVenderList(data, name) {
   return postBlob({
-    url: '/vender/master/zfire/list/export',
+    url: '/vender/goods/list/export',
     data,
     name
   })
 }
 
-// 获取供应商资料列表
-export function getVenderList(params) {
-  return request({
-    url: '/vender/master/list',
-    method: 'get',
-    params
-  })
-}
-
-// 获取供应商资料信息
-export function getVender(params) {
+// 删除供应商产品关系维护单
+export function delVenderGoodsSheet(data) {
   return request({
-    url: '/vender/master/detail',
-    method: 'get',
-    params
+    url: '/vender/goods/del',
+    method: 'post',
+    data
   })
 }
 
-// 新增供应商资料
-export function addVender(params) {
+// 审核供应商产品关系维护单
+export function confirmVenderGoodsSheet(data) {
   return request({
-    url: '/vender/master/add',
+    url: '/vender/goods/confirm',
     method: 'post',
-    data: params
+    data
   })
 }
 
-// 编辑供应商资料
-export function editVender(params) {
+// 新增供应商产品关系维护单
+export function addVenderGoodsSheet(data) {
   return request({
-    url: '/vender/master/update',
+    url: '/vender/goods/add',
     method: 'post',
-    data: params
+    data
   })
 }
 
-// 获取供应商产品关系维护单列表
-export function getVenderGoodsSheetList(params) {
+// 编辑供应商产品关系维护单
+export function editVenderGoodsSheet(data) {
   return request({
-    url: '/vender/manager/list',
-    method: 'get',
-    params
+    url: '/vender/goods/edit',
+    method: 'post',
+    data
   })
 }
 
 // 获取供应商产品关系维护单信息
 export function getVenderGoodsSheet(params) {
   return request({
-    url: '/vender/manager/detail',
+    url: '/vender/goods/detail',
     method: 'get',
     params
   })
 }
 
-// 新增供应商产品关系维护单
-export function addVenderGoodsSheet(params) {
+// ,,
+
+export function newGetVenderList(data) {
   return request({
-    url: '/vender/manager/add',
+    url: `/vender/master/zfire/list?moduleId=${data.moduleId}`,
     method: 'post',
-    data: params
+    data
   })
 }
 
-// 编辑供应商产品关系维护单
-export function editVenderGoodsSheet(params) {
+// ------------------------------------------
+
+// 获取供应商产品关系维护单列表
+export function getVenderGoodsSheetList(params) {
   return request({
-    url: '/vender/manager/update',
-    method: 'post',
-    data: params
+    url: '/vender/manager/list',
+    method: 'get',
+    params
   })
 }
 
-// 删除供应商产品关系维护单
-export function delVenderGoodsSheet(params) {
-  return request({
-    url: '/vender/manager/del',
-    method: 'post',
-    params
+export function newGetVenderListExport(data, name) {
+  return postBlob({
+    url: '/vender/master/zfire/list/export',
+    data,
+    name
   })
 }
 
-// 审核供应商产品关系维护单
-export function confirmVenderGoodsSheet(params) {
+// 获取供应商资料列表
+export function getVenderList(params) {
   return request({
-    url: '/vender/manager/confirm',
-    method: 'post',
+    url: '/vender/master/list',
+    method: 'get',
     params
   })
 }
 
-// 获取供应商产品信息列表
-export function getVenderGoodsList(params) {
+// 获取供应商资料信息
+export function getVender(params) {
   return request({
-    url: '/vender/goods/list',
+    url: '/vender/master/detail',
     method: 'get',
     params
   })
 }
 
-export function getNewVenderList(data) {
+// 新增供应商资料
+export function addVender(params) {
   return request({
-    url: `/vender/manager/zfire/list?moduleId=${data.moduleId}`,
+    url: '/vender/master/add',
     method: 'post',
-    data
+    data: params
   })
 }
 
-// 导出
-export function exportNewVenderList(data, name) {
-  return postBlob({
-    url: '/vender/manager/zfire/list/export',
-    data,
-    name
+// 编辑供应商资料
+export function editVender(params) {
+  return request({
+    url: '/vender/master/update',
+    method: 'post',
+    data: params
+  })
+}
+
+// 获取供应商产品信息列表
+export function getVenderGoodsList(params) {
+  return request({
+    url: '/vender/goods/list',
+    method: 'get',
+    params
   })
 }

+ 73 - 95
src/views/auxiliaryFittings/vender/vender-goods-sheet/index.vue

@@ -18,7 +18,7 @@
         :getList="getList"
         :exportList="exportList"
         :columnParsing="columnParsing"
-        :operation="operation()"
+        :operation="operation"
         :optionsEvensGroup="optionsEvensGroup"
         :tableAttributes="tableAttributes"
         :tableEvents="tableEvents"
@@ -36,19 +36,19 @@
 
 <script>
 import {
-  confirmVenderGoodsSheet,
-  delVenderGoodsSheet,
-  getVenderGoodsSheetList,
   getNewVenderList,
-  exportNewVenderList
+  exportNewVenderList,
+  confirmVenderGoodsSheet,
+  delVenderGoodsSheet
 } from '@/api/material-system/vender'
 import VenderGoodsArea from '../components/VenderGoodsArea'
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
   name: 'VenderGoodsSheet',
   components: { VenderGoodsArea, TemplatePage },
-  mixins: [import_mixin],
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
       venderGoodsArea: false,
@@ -56,24 +56,10 @@ export default {
         openType: 'add',
         sheetId: ''
       },
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '新增单据',
-              click: () => {
-                this.addOrEdit('add')
-              },
-              isRole: this.checkBtnRole('add')
-            }
-          ]
-        ]
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
-        selectColumn: true
+        selectColumn: false
       },
       // 表格事件
       tableEvents: {
@@ -82,7 +68,72 @@ export default {
       recordSelected: []
     }
   },
+  computed: {
+    optionsEvensGroup() {
+      return [
+        [
+          [
+            this.optionsEvensAuth('add', {
+              click: () => {
+                this.addOrEdit('add')
+              }
+            })
+          ]
+        ]
+      ]
+    }
+  },
   methods: {
+    // 列表请求函数
+    getList(p) {
+      this.recordSelected = []
+      return getNewVenderList(p)
+    },
+    // 列表导出函数
+    exportList: exportNewVenderList,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return this.operationBtn({
+        view: {
+          click: ({ row, index, column }) => {
+            this.addOrEdit('view', row.sheetId)
+          }
+        },
+        edit: {
+          conditions: ({ row, index, column }) => {
+            return row.flag === 0
+          },
+          click: ({ row, index, column }) => {
+            this.addOrEdit('edit', row.sheetId)
+          }
+        },
+        del: {
+          prompt: '确定删除吗?',
+          conditions: ({ row, index, column }) => {
+            return row.flag === 0
+          },
+          click: ({ row, index, column }) => {
+            this.delSheet(row.sheetId)
+          }
+        },
+        confirm: {
+          prompt: '确定审核吗?',
+          conditions: ({ row, index, column }) => {
+            return row.flag === 0
+          },
+          click: ({ row, index, column }) => {
+            this.confirmSheet(row.sheetId)
+          }
+        }
+      })
+    },
     // 新增编辑 辅材
     addOrEdit(type, id) {
       this.venderGoodsArea = true
@@ -91,9 +142,8 @@ export default {
     },
     // 删除单据
     delSheet(sheetId) {
-      delVenderGoodsSheet({ sheetId: sheetId }).then(() => {
+      delVenderGoodsSheet([sheetId]).then(() => {
         this.$refs.pageRef.refreshList()
-
         this.$successMsg('删除成功')
       })
     },
@@ -108,78 +158,6 @@ export default {
     backUpdPage() {
       this.$refs.pageRef.refreshList()
       this.venderGoodsArea = false
-    },
-    // 列表请求函数
-    getList(...p) {
-      this.recordSelected = []
-      return getNewVenderList(...p)
-    },
-    // 列表导出函数
-    exportList: exportNewVenderList,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-      return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    operation() {
-      return (h, { row, index, column }) => {
-        return (
-          <div class="operation-btns">
-            {this.checkBtnRole('view') ? (
-              <el-button
-                size="mini"
-                type="text"
-                onClick={() => {
-                  this.addOrEdit('view', row.sheetId)
-                }}
-              >
-                查看
-              </el-button>
-            ) : null}
-            {this.checkBtnRole('edit') && row.flag === 0 ? (
-              <el-button
-                type="text"
-                size="mini"
-                style="margin-right: 10px;"
-                onClick={() => {
-                  this.addOrEdit('edit', row.sheetId)
-                }}
-              >
-                编辑
-              </el-button>
-            ) : null}
-            {this.checkBtnRole('confirm') && row.flag === 0 ? (
-              <el-popconfirm
-                style="margin-right: 10px;"
-                title="确定审核吗?"
-                onConfirm={() => {
-                  this.confirmSheet(row.sheetId)
-                }}
-              >
-                <el-button slot="reference" size="mini" type="text">
-                  审核
-                </el-button>
-              </el-popconfirm>
-            ) : null}
-            {this.checkBtnRole('del') && row.flag === 0 ? (
-              <el-popconfirm
-                style="margin-right: 10px;"
-                title="确定删除吗?"
-                onConfirm={() => {
-                  this.delSheet(row.sheetId)
-                }}
-              >
-                <el-button slot="reference" size="mini" type="text">
-                  删除
-                </el-button>
-              </el-popconfirm>
-            ) : null}
-          </div>
-        )
-      }
     }
   }
 }

+ 2 - 16
src/views/auxiliaryFittings/vender/vender-goods/index.vue

@@ -11,7 +11,7 @@
 </template>
 
 <script>
-import { getVenderGoodsList, getNewVenderGoodsList, exportVenderGoods } from '@/api/material-system/vender'
+import { getNewVenderGoodsList, exportVenderGoods } from '@/api/material-system/vender'
 import { downloadFiles } from '@/utils/util'
 import TemplatePage from '@/components/template/template-page-1.vue'
 import import_mixin from '@/components/template/import_mixin.js'
@@ -21,24 +21,10 @@ export default {
   mixins: [import_mixin],
   data() {
     return {
-      // 事件组合
-      optionsEvensGroup: [
-        [
-          [
-            {
-              name: '新增单据',
-              click: () => {
-                this.addOrEdit('add')
-              },
-              isRole: this.checkBtnRole('add')
-            }
-          ]
-        ]
-      ],
       // 表格属性
       tableAttributes: {
         // 启用勾选列
-        selectColumn: true
+        selectColumn: false
       },
       // 表格事件
       tableEvents: {