Browse Source

交易管理

linwenxin 1 year ago
parent
commit
fb44372ad5
1 changed files with 55 additions and 46 deletions
  1. 55 46
      src/views/auxiliaryFittings/salesManagement/transaction/index.vue

+ 55 - 46
src/views/auxiliaryFittings/salesManagement/transaction/index.vue

@@ -1,17 +1,22 @@
 <template>
-	<div class="page">
-		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents" :operationColumnWidth="50"
-		  :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters" :column-parsing="columnParsing"
-		  :operation="operation" :exportList="exportList">
-		</template-page>
-		<div class="detail" v-if="formDialog">
-			<auxiliarySalesOrderDetail v-if="orderSource == 'M_SALES'" :id="id" @back="backList" :formType="2" title="辅材销售订单详情"></auxiliarySalesOrderDetail>
-			<attachmentSalesOrderDetail v-if="orderSource == 'P_SALES'" :id="id" @back="backList" :formType="2" title="配件销售订单详情"></attachmentSalesOrderDetail>
-			<auxiliarySalesReturnOrderDetail v-if="orderSource == 'SALES_RET'" :id="id" @back="backList" :formType="2" title="辅材销售退货单详情"></auxiliarySalesReturnOrderDetail>
-			<attachmentNewReturnDetail v-if="orderSource == 'NEW_PARTS_RET'" :id="id" @back="backList" :formType="2" title="配件新件返还详情"></attachmentNewReturnDetail>
-			<attachmentOldReturnDetail v-if="orderSource == 'OLD_PARTS_RET'" :id="id" @back="backList" :formType="2" title="配件旧件返还详情"></attachmentOldReturnDetail>
-		</div>
-	</div>
+  <div class="page">
+    <template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+      :table-events="tableEvents" :operationColumnWidth="50" :options-evens-group="optionsEvensGroup"
+      :moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+    </template-page>
+    <div class="detail" v-if="formDialog">
+      <auxiliarySalesOrderDetail v-if="orderSource == 'M_SALES'" :id="id" @back="backList" :formType="2" title="辅材销售订单详情">
+      </auxiliarySalesOrderDetail>
+      <attachmentSalesOrderDetail v-if="orderSource == 'P_SALES'" :id="id" @back="backList" :formType="2"
+        title="配件销售订单详情"></attachmentSalesOrderDetail>
+      <auxiliarySalesReturnOrderDetail v-if="orderSource == 'SALES_RET'" :id="id" @back="backList" :formType="2"
+        title="辅材销售退货单详情"></auxiliarySalesReturnOrderDetail>
+      <attachmentNewReturnDetail v-if="orderSource == 'NEW_PARTS_RET'" :id="id" @back="backList" :formType="2"
+        title="配件新件返还详情"></attachmentNewReturnDetail>
+      <attachmentOldReturnDetail v-if="orderSource == 'OLD_PARTS_RET'" :id="id" @back="backList" :formType="2"
+        title="配件旧件返还详情"></attachmentOldReturnDetail>
+    </div>
+  </div>
 </template>
 
 <script>
@@ -23,10 +28,11 @@ import auxiliarySalesReturnOrderDetail from '../components/auxiliarySalesReturnO
 import attachmentNewReturnDetail from '../components/attachmentNewReturnDetail.vue'
 import attachmentOldReturnDetail from '../components/attachmentOldReturnDetail.vue'
 import { downloadFiles } from '@/utils/util'
-import { listPageV2,pageExport } from "@/api/auxiliaryFittings/transaction";
+import { listPageV2, pageExport } from "@/api/auxiliaryFittings/transaction";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, auxiliarySalesOrderDetail, attachmentSalesOrderDetail, auxiliarySalesReturnOrderDetail, attachmentNewReturnDetail, attachmentOldReturnDetail},
-  mixins: [import_mixin],
+  components: { TemplatePage, auxiliarySalesOrderDetail, attachmentSalesOrderDetail, auxiliarySalesReturnOrderDetail, attachmentNewReturnDetail, attachmentOldReturnDetail },
+  mixins: [import_mixin, operation_mixin],
   data() {
     return {
       // 事件组合
@@ -43,9 +49,9 @@ export default {
       // 勾选选中行
       recordSelected: [],
       /** 表单变量 */
-	  id: '',
-	  orderSource: '',
-	  formDialog: false
+      id: '',
+      orderSource: '',
+      formDialog: false
     }
   },
   computed: {
@@ -56,7 +62,7 @@ export default {
   },
   methods: {
     // 列表请求函数
-		getList: listPageV2,
+    getList: listPageV2,
     // 列表导出函数
     exportList: pageExport,
     // 表格列解析渲染数据更改
@@ -67,36 +73,39 @@ export default {
     selectionChange(data) {
       this.recordSelected = data
     },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-		  <el-button type="text" onClick={() => {
-			this.id = row.orderId
-			this.orderSource = row.orderSource
-			if(row.orderSource){
-				this.formDialog = true
-			}else{
-				this.$message.warning('订单来源为空!')
-			}
-		  }}>查看</el-button>
-        </div>
-      )
+
+
+    operation() {
+      return this.operationBtn({
+        detail: {
+          click: ({ row, index, column }) => {
+            this.id = row.orderId
+            this.orderSource = row.orderSource
+            if (row.orderSource) {
+              this.formDialog = true
+            } else {
+              this.$message.warning('订单来源为空!')
+            }
+          }
+        }
+      })
+    },
+
+    backList() {
+      this.id = ''
+      this.formDialog = false;
+      this.$refs.pageRef.refreshList()
     },
-	backList() {
-		this.id = ''
-		this.formDialog = false;
-		this.$refs.pageRef.refreshList()
-	},
   }
 }
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		height: 100%;
-	}
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.page {
+  height: 100%;
+}
+
+.tab {
+  padding: 20px 20px 0 20px;
+}
 </style>