|
|
@@ -0,0 +1,118 @@
|
|
|
+<template>
|
|
|
+ <ele-pro-table
|
|
|
+ :columns="columns"
|
|
|
+ :datasource="datasource"
|
|
|
+ cacheKey="mes-recordRules-25113-031018"
|
|
|
+ ref="tableRef"
|
|
|
+ >
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <el-select v-model="reportWorkType" placeholder="请选择" @change="reload">
|
|
|
+ <el-option
|
|
|
+ v-for="item in reportWorkTypeOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import tableColumnsMixin from '@/mixins/tableColumnsMixin';
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
+ import { produceTaskRecordRules } from '@/api/producetaskrulerecord/index';
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'recordRules',
|
|
|
+ props: {
|
|
|
+ produceTaskId: {
|
|
|
+ type: String,
|
|
|
+ required: true
|
|
|
+ },
|
|
|
+ bomCategoryId: {
|
|
|
+ type: String,
|
|
|
+ required: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mixins: [tableColumnsMixin, dictMixins],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ type: 'index',
|
|
|
+ width: 45,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'produceTaskName',
|
|
|
+ label: '工序名称',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'itemType',
|
|
|
+ label: '类型',
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ return this.getDictValue('记录规则事项类型', row.itemType);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'executeMethod',
|
|
|
+ label: '配置执行方式',
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ return this.getDictValue('记录规则执行方式', row.executeMethod);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'rulesName',
|
|
|
+ label: '名称',
|
|
|
+ align: 'center',
|
|
|
+ formatter: (row) => {
|
|
|
+ return row.rulesName || row.itemTaskName;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ reportWorkType: 1,
|
|
|
+ reportWorkTypeOptions: [
|
|
|
+ { label: '产前准备', value: 1 },
|
|
|
+ { label: '过程监测', value: 2 },
|
|
|
+ { label: '产后检查', value: 3 }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ produceTaskId(newVal) {
|
|
|
+ this.reload();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ datasource({ page, limit, where }) {
|
|
|
+ let body = {
|
|
|
+ ...where,
|
|
|
+ produceTaskId: this.produceTaskId,
|
|
|
+ bomCategoryId: this.bomCategoryId,
|
|
|
+ reportWorkType: this.reportWorkType,
|
|
|
+ pageNum: page,
|
|
|
+ size: limit,
|
|
|
+ bomCategoryId: null
|
|
|
+ };
|
|
|
+
|
|
|
+ if (this.reportWorkType == 2) {
|
|
|
+ body.bomCategoryId = this.bomCategoryId;
|
|
|
+ } else {
|
|
|
+ body.bomCategoryId = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ return produceTaskRecordRules(body);
|
|
|
+ },
|
|
|
+ reload() {
|
|
|
+ this.$refs.tableRef.reload();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
+<style></style>
|