Browse Source

辅材调价单

linwenxin 1 year ago
parent
commit
bcc9259e67

+ 133 - 121
src/views/auxiliaryFittings/salesManagement/auxiliaryAdjustPriceOrder/index.vue

@@ -1,20 +1,20 @@
 <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">
-		  
-		  <div slot="moreSearch">
-		    <el-radio-group v-model="flag" size="mini" @change="changeType">
-		    	<el-radio-button label="">全部</el-radio-button>
-		    	<el-radio-button label="SAVE">已保存</el-radio-button>
-		    	<el-radio-button label="OK">已审核</el-radio-button>
-		    </el-radio-group>
-		    <br><br>
-		  </div>
+		<template-page v-show="!formDialog" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
+			:table-events="tableEvents" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
+			:column-parsing="columnParsing" :operation="operation()" :exportList="exportList">
+			<div slot="moreSearch">
+				<el-radio-group v-model="flag" size="mini" @change="changeType">
+					<el-radio-button label="">全部</el-radio-button>
+					<el-radio-button label="SAVE">已保存</el-radio-button>
+					<el-radio-button label="OK">已审核</el-radio-button>
+				</el-radio-group>
+				<br><br>
+			</div>
 		</template-page>
 		<div class="detail" v-if="formDialog">
-			<auxiliaryAdjustPriceOrderDetail :id="id" @back="backList" :formType="formDialogType" :title="'辅材调价单' + formDialogTitles[formDialogType]"></auxiliaryAdjustPriceOrderDetail>
+			<auxiliaryAdjustPriceOrderDetail :id="id" @back="backList" :formType="formDialogType"
+				:title="'辅材调价单' + formDialogTitles[formDialogType]"></auxiliaryAdjustPriceOrderDetail>
 		</div>
 	</div>
 </template>
@@ -26,119 +26,131 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2,pageExport } from "@/api/auxiliaryFittings/auxiliaryAdjustPriceOrder";
+import { listPageV2, pageExport } from "@/api/auxiliaryFittings/auxiliaryAdjustPriceOrder";
+import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
-  components: { TemplatePage, ImageUpload, auxiliaryAdjustPriceOrderDetail },
-  mixins: [import_mixin],
-  data() {
-    return {
-      // 事件组合
-      optionsEvensGroup: [
-	  	[
-	  		[
-	  			{
-	  				name: '新建',
-	  				click: this.addData
-	  			}
-	  		]
-	  	]
-	  ],
-      // 表格属性
-      tableAttributes: {
-        // 启用勾选列
-        selectColumn: true
-      },
-      // 表格事件
-      tableEvents: {
-        'selection-change': this.selectionChange
-      },
-      // 勾选选中行
-      recordSelected: [],
-      /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ["新增","编辑", "详情"],
-      formDialog: false,
-	  id: '',
-	  flag: ''
-    }
-  },
-  computed: {
-    // 更多参数
-    moreParameters() {
-      return []
-    },
-    formItems() {}
-  },
-  methods: {
-	// 切换状态
-	changeType(val) {
-	  this.$refs.pageRef.refreshList()
+	components: { TemplatePage, ImageUpload, auxiliaryAdjustPriceOrderDetail },
+	mixins: [import_mixin, operation_mixin],
+	data() {
+		return {
+			// 表格属性
+			tableAttributes: {
+				// 启用勾选列
+				selectColumn: true
+			},
+			// 表格事件
+			tableEvents: {
+				'selection-change': this.selectionChange
+			},
+			// 勾选选中行
+			recordSelected: [],
+			/** 表单变量 */
+			formDialogType: 0,
+			formDialogTitles: ["新增", "编辑", "详情"],
+			formDialog: false,
+			id: '',
+			flag: ''
+		}
 	},
-	backList() {
-		this.id = ''
-		this.formDialog = false;
-		this.$refs.pageRef.refreshList()
+	computed: {
+		// 事件组合
+		optionsEvensGroup() {
+			return [
+				[
+					[
+						this.optionsEvensAuth("add", {
+							click: this.addData
+						}),
+					]
+				]
+			]
+		},
+		// 更多参数
+		moreParameters() {
+			return []
+		},
+		formItems() { }
 	},
-    // 列表请求函数
-	getList(p,cb) {
-	  try {
-	    var pam = JSON.parse(JSON.stringify(p))
-	    if (this.flag) {
-	      pam.params.push({ "param": "a.flag", "compare": "=", "value": this.flag })
-	    }
-			cb && cb(pam)
-	    return listPageV2(pam)
-	  } catch (error) {
-	    console.log(error)
-	  }
-	},
-    // 列表导出函数
-    exportList: pageExport,
-    // 表格列解析渲染数据更改
-    columnParsing(item, defaultData) {
-      return defaultData
-    },
-    // 监听勾选变化
-    selectionChange(data) {
-      this.recordSelected = data
-    },
-    // 表格操作列
-    operation(h, { row, index, column }) {
-      return (
-        <div class='operation-btns'>
-		  {row.flag == 'SAVE'?<el-button type="text" onClick={() => {
-			this.id = row.sheetId
-		    this.formDialogType = 1
-		    this.openForm()
-		  }}>编辑</el-button>:null}
-		  {row.flag == 'OK'?<el-button type="text" onClick={() => {
-		  	this.id = row.sheetId
-		    this.formDialogType = 2
-		    this.openForm()
-		  }}>详情</el-button>:null}
-        </div>
-      )
-    },
-    addData() {
-      this.formDialogType = 0
-      this.openForm()
-    },
-    openForm() {
-      this.formDialog = true;
-    },
-	// 下载导入模版
-	handleDownload() {
-	  // downloadFiles('charging/standard/download');
-	},
-  }
+	methods: {
+		// 切换状态
+		changeType(val) {
+			this.$refs.pageRef.refreshList()
+		},
+		backList() {
+			this.id = ''
+			this.formDialog = false;
+			this.$refs.pageRef.refreshList()
+		},
+		// 列表请求函数
+		getList(p, cb) {
+			try {
+				var pam = JSON.parse(JSON.stringify(p))
+				if (this.flag) {
+					pam.params.push({ "param": "a.flag", "compare": "=", "value": this.flag })
+				}
+				cb && cb(pam)
+				return listPageV2(pam)
+			} catch (error) {
+				console.log(error)
+			}
+		},
+		// 列表导出函数
+		exportList: pageExport,
+		// 表格列解析渲染数据更改
+		columnParsing(item, defaultData) {
+			return defaultData
+		},
+		// 监听勾选变化
+		selectionChange(data) {
+			this.recordSelected = data
+		},
+
+		operation() {
+			return this.operationBtn({
+				edit: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'SAVE'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.sheetId
+						this.formDialogType = 1
+						this.openForm()
+					}
+				},
+				detail: {
+					conditions: ({ row, index, column }) => {
+						return row.flag == 'OK'
+					},
+					click: ({ row, index, column }) => {
+						this.id = row.sheetId
+						this.formDialogType = 2
+						this.openForm()
+					}
+				},
+			})
+		},
+
+		addData() {
+			this.formDialogType = 0
+			this.openForm()
+		},
+		openForm() {
+			this.formDialog = true;
+		},
+		// 下载导入模版
+		handleDownload() {
+			// downloadFiles('charging/standard/download');
+		},
+	}
 }
 </script>
 
 <style lang="scss" scoped>
-	.page{
-		height: 100%;
-	}
-	.tab{
-		padding: 20px 20px 0 20px;
-	}
+.page {
+	height: 100%;
+}
+
+.tab {
+	padding: 20px 20px 0 20px;
+}
 </style>

+ 5 - 5
src/views/workOrder/workOrderPool/index.vue

@@ -115,7 +115,7 @@ export default {
       return [
         [
           [
-          this.optionsEvensAuth(["createWorkOrder", "createWbWorkOrder"], {
+            this.optionsEvensAuth(["createWorkOrder", "createWbWorkOrder"], {
               name: '创建工单',
               click: () => { }
             }),
@@ -239,11 +239,11 @@ export default {
         }
       }
     },
-    
+
     selectable(row, index) {
       return !["YWG", "YJS", "YQX"].includes(Object.entries(row.selectMapData.orderStatus).find(([key, val]) => val == row.orderStatus)?.[0])
     },
-    
+
     screeningAnalysis(jname, val) {
       if (jname == 'orderFlags') {
         return (val || []).map(item => item.tagName).join(',')
@@ -251,14 +251,14 @@ export default {
         return val
       }
     },
-    
+
     filterMethod(value, row, column) {
       if (column['property'] == 'orderFlags') {
         return (row[column['property']] || []).map(item => item.tagName).join(',') === value
       }
       return row[column['property']] === value
     },
-    
+
     // 获取统计
     getOrderBaseStatusCount(...p) {
       orderBaseStatusCount(...p).then(res => {