1
This commit is contained in:
		@@ -1,313 +1,324 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="160"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 新增 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="160"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 新增 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="centervisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%"
 | 
			
		||||
    >
 | 
			
		||||
			<add-or-update ref="addOrUpdate" @successSubmit="successSubmit" />
 | 
			
		||||
			width="50%">
 | 
			
		||||
			<add-or-update
 | 
			
		||||
				ref="addOrUpdate"
 | 
			
		||||
				@successSubmit="successSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
    <!-- 装车 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
		<!-- 装车 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			dialogTitle="装车"
 | 
			
		||||
			:dialogVisible="centervisible2"
 | 
			
		||||
			@cancel="handleCancel2"
 | 
			
		||||
			@confirm="handleConfirm2"
 | 
			
		||||
			:before-close="handleCancel2"
 | 
			
		||||
			width="50%"
 | 
			
		||||
    >
 | 
			
		||||
			<loaded-page ref="loadedPage" @successSubmit="successSubmit2" />
 | 
			
		||||
			width="50%">
 | 
			
		||||
			<loaded-page
 | 
			
		||||
				ref="loadedPage"
 | 
			
		||||
				@successSubmit="successSubmit2" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
    <!-- 发货详情 -->
 | 
			
		||||
    <delivery-log-detail ref='deliveryLogDetail' v-if='showDetail' />
 | 
			
		||||
  </div>
 | 
			
		||||
		<!-- 发货详情 -->
 | 
			
		||||
		<delivery-log-detail
 | 
			
		||||
			ref="deliveryLogDetail"
 | 
			
		||||
			v-if="showDetail" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { deliveryLogPage, deliveryLogDelete } from '@/api/base/delivery'
 | 
			
		||||
import AddOrUpdate from './components/addOrUpdate'
 | 
			
		||||
import LoadedPage from './components/loadedPage'
 | 
			
		||||
import DeliveryLogDetail from './components/deliveryLogDetail.vue'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import { deliveryLogPage, deliveryLogDelete } from '@/api/base/delivery';
 | 
			
		||||
import AddOrUpdate from './components/addOrUpdate';
 | 
			
		||||
import LoadedPage from './components/loadedPage';
 | 
			
		||||
import DeliveryLogDetail from './components/deliveryLogDetail.vue';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'orderName',
 | 
			
		||||
    label: '订单名',
 | 
			
		||||
    minWidth: 100,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '发货单名称',
 | 
			
		||||
    minWidth: 100,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliveryTime',
 | 
			
		||||
    label: '发货时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '发货单号',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliverPerName',
 | 
			
		||||
    label: '发货负责人',
 | 
			
		||||
    minWidth: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'principal',
 | 
			
		||||
    label: '运输负责人',
 | 
			
		||||
    minWidth: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'principalCall',
 | 
			
		||||
    label: '运输联系方式',
 | 
			
		||||
    minWidth: 110,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'principalCost',
 | 
			
		||||
    label: '运输费用',
 | 
			
		||||
    align: 'right'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'remark',
 | 
			
		||||
    label: '备注',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'orderName',
 | 
			
		||||
		label: '订单名',
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '发货单名称',
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'deliveryTime',
 | 
			
		||||
		label: '发货时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '发货单号',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'deliverPerName',
 | 
			
		||||
		label: '发货负责人',
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'principal',
 | 
			
		||||
		label: '运输负责人',
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'principalCall',
 | 
			
		||||
		label: '运输联系方式',
 | 
			
		||||
		minWidth: 110,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'principalCost',
 | 
			
		||||
		label: '运输费用',
 | 
			
		||||
		align: 'right',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: "DeliveryLog",
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '订单名',
 | 
			
		||||
          param: 'orderName',
 | 
			
		||||
          defaultSelect: ''
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '发货单名称',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '发货单号',
 | 
			
		||||
          param: 'code'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('extend:delivery-log:create') ? 'separate' : '',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('extend:delivery-log:create') ? 'button' : '',
 | 
			
		||||
          btnName: '新增',
 | 
			
		||||
          name: 'add',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        orderName: '',
 | 
			
		||||
        code: '',
 | 
			
		||||
        name: ''
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
      this.$auth.hasPermi('extend:delivery-log:loaded')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'loaded',
 | 
			
		||||
              btnName: '装车'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('extend:delivery-log:detail')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'detail',
 | 
			
		||||
              btnName: '详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('extend:delivery-log:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'edit',
 | 
			
		||||
              btnName: '编辑'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('extend:delivery-log:delete')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'delete',
 | 
			
		||||
              btnName: '删除'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      addOrEditTitle: '',
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      centervisible2: false,
 | 
			
		||||
      showDetail: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    if (location.href.indexOf('?') > 0) {
 | 
			
		||||
      let arr = location.href.split('?')[1]
 | 
			
		||||
      this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1])
 | 
			
		||||
    } else {
 | 
			
		||||
      this.formConfig[0].defaultSelect = ''
 | 
			
		||||
    }
 | 
			
		||||
    this.queryParams.orderName = this.formConfig[0].defaultSelect
 | 
			
		||||
    this.getList();
 | 
			
		||||
  },
 | 
			
		||||
  components: { AddOrUpdate, LoadedPage, DeliveryLogDetail },
 | 
			
		||||
  watch: {
 | 
			
		||||
    $route: 'initData'
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    initData(to) {
 | 
			
		||||
      if (to.name === 'DeliveryLog') {
 | 
			
		||||
        if (location.href.indexOf('?') > 0) {
 | 
			
		||||
          let arr = location.href.split('?')[1]
 | 
			
		||||
          this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1])
 | 
			
		||||
        } else {
 | 
			
		||||
          this.formConfig[0].defaultSelect = ''
 | 
			
		||||
        }
 | 
			
		||||
        this.queryParams.orderName = this.formConfig[0].defaultSelect
 | 
			
		||||
        this.getList()
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      deliveryLogPage({...this.queryParams}).then(res => {
 | 
			
		||||
        let arr = res.data.list || []
 | 
			
		||||
        arr && arr.map(item => {
 | 
			
		||||
          item.principalCost = item.principalCost.toFixed(2)
 | 
			
		||||
        })
 | 
			
		||||
        this.list = arr
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.queryParams.name = val.name
 | 
			
		||||
        this.queryParams.orderName = val.orderName
 | 
			
		||||
        this.queryParams.code = val.code
 | 
			
		||||
        this.getList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.addOrEditTitle = '新增'
 | 
			
		||||
        this.centervisible = true
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.addOrUpdate.init()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.addOrUpdate.init(val.data.id)
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        case 'delete':
 | 
			
		||||
          this.handleDelete(val.data)
 | 
			
		||||
          break
 | 
			
		||||
        case 'loaded':
 | 
			
		||||
          this.centervisible2 = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.loadedPage.init(val.data.id, val.data.code, val.data.orderId)
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
          this.showDetail = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.deliveryLogDetail.init(val.data)
 | 
			
		||||
          })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 新增
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.addOrUpdate.formClear()
 | 
			
		||||
      this.centervisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.addOrUpdate.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    // 删除
 | 
			
		||||
    handleDelete(val) {
 | 
			
		||||
      this.$modal.confirm('是否确认删除发货单名为"' + val.name + '"的数据项?').then(function() {
 | 
			
		||||
          return deliveryLogDelete({ id: val.id })
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          this.getList();
 | 
			
		||||
          this.$modal.msgSuccess("操作成功");
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    // 装车
 | 
			
		||||
    handleCancel2() {
 | 
			
		||||
      this.$refs.loadedPage.formClear()
 | 
			
		||||
      this.centervisible2 = false
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm2() {
 | 
			
		||||
      this.$refs.loadedPage.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit2() {
 | 
			
		||||
      this.handleCancel2()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	name: 'DeliveryLog',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '订单名',
 | 
			
		||||
					param: 'orderName',
 | 
			
		||||
					defaultSelect: '',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '发货单名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '发货单号',
 | 
			
		||||
					param: 'code',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('extend:delivery-log:create')
 | 
			
		||||
						? 'separate'
 | 
			
		||||
						: '',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('extend:delivery-log:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				orderName: '',
 | 
			
		||||
				code: '',
 | 
			
		||||
				name: '',
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			total: 0,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('extend:delivery-log:loaded')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'loaded',
 | 
			
		||||
							btnName: '装车',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('extend:delivery-log:detail')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '详情',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('extend:delivery-log:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('extend:delivery-log:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			addOrEditTitle: '',
 | 
			
		||||
			centervisible: false,
 | 
			
		||||
			centervisible2: false,
 | 
			
		||||
			showDetail: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		if (location.href.indexOf('?') > 0) {
 | 
			
		||||
			let arr = location.href.split('?')[1];
 | 
			
		||||
			this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1]);
 | 
			
		||||
		} else {
 | 
			
		||||
			this.formConfig[0].defaultSelect = '';
 | 
			
		||||
		}
 | 
			
		||||
		this.queryParams.orderName = this.formConfig[0].defaultSelect;
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	components: { AddOrUpdate, LoadedPage, DeliveryLogDetail },
 | 
			
		||||
	watch: {
 | 
			
		||||
		$route: 'initData',
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		initData(to) {
 | 
			
		||||
			if (to.name === 'DeliveryLog') {
 | 
			
		||||
				if (location.href.indexOf('?') > 0) {
 | 
			
		||||
					let arr = location.href.split('?')[1];
 | 
			
		||||
					this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1]);
 | 
			
		||||
				} else {
 | 
			
		||||
					this.formConfig[0].defaultSelect = '';
 | 
			
		||||
				}
 | 
			
		||||
				this.queryParams.orderName = this.formConfig[0].defaultSelect;
 | 
			
		||||
				this.getList();
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		getList() {
 | 
			
		||||
			deliveryLogPage({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				let arr = res.data.list || [];
 | 
			
		||||
				arr &&
 | 
			
		||||
					arr.map((item) => {
 | 
			
		||||
						item.principalCost = item.principalCost.toFixed(2);
 | 
			
		||||
					});
 | 
			
		||||
				this.list = arr;
 | 
			
		||||
				this.total = res.data.total || 0;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			if (val.btnName === 'search') {
 | 
			
		||||
				this.queryParams.name = val.name;
 | 
			
		||||
				this.queryParams.orderName = val.orderName;
 | 
			
		||||
				this.queryParams.code = val.code;
 | 
			
		||||
				this.getList();
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addOrEditTitle = '新增';
 | 
			
		||||
				this.centervisible = true;
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
					this.$refs.addOrUpdate.init();
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			switch (val.type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.addOrEditTitle = '编辑';
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.addOrUpdate.init(val.data.id);
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				case 'delete':
 | 
			
		||||
					this.handleDelete(val.data);
 | 
			
		||||
					break;
 | 
			
		||||
				case 'loaded':
 | 
			
		||||
					this.centervisible2 = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.loadedPage.init(
 | 
			
		||||
							val.data.id,
 | 
			
		||||
							val.data.code,
 | 
			
		||||
							val.data.orderId
 | 
			
		||||
						);
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.showDetail = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.deliveryLogDetail.init(val.data);
 | 
			
		||||
					});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 新增
 | 
			
		||||
		handleCancel() {
 | 
			
		||||
			this.$refs.addOrUpdate.formClear();
 | 
			
		||||
			this.centervisible = false;
 | 
			
		||||
			this.addOrEditTitle = '';
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm() {
 | 
			
		||||
			this.$refs.addOrUpdate.submitForm();
 | 
			
		||||
		},
 | 
			
		||||
		successSubmit() {
 | 
			
		||||
			this.handleCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		// 删除
 | 
			
		||||
		handleDelete(val) {
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除发货单名为"' + val.name + '"的数据项?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return deliveryLogDelete({ id: val.id });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('操作成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		// 装车
 | 
			
		||||
		handleCancel2() {
 | 
			
		||||
			this.$refs.loadedPage.formClear();
 | 
			
		||||
			this.centervisible2 = false;
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm2() {
 | 
			
		||||
			this.$refs.loadedPage.submitForm();
 | 
			
		||||
		},
 | 
			
		||||
		successSubmit2() {
 | 
			
		||||
			this.handleCancel2();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,130 +1,124 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="80"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 详情抽屉 -->
 | 
			
		||||
    <delivery-log-det-detail ref='deliveryLogDetail'/>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 详情抽屉 -->
 | 
			
		||||
		<delivery-log-det-detail ref="deliveryLogDetail" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { deliveryProgressPage } from '@/api/base/delivery'
 | 
			
		||||
import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue'
 | 
			
		||||
import { deliveryProgressPage } from '@/api/base/delivery';
 | 
			
		||||
import DeliveryLogDetDetail from './components/deliveryLogDetDetail.vue';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'orderName',
 | 
			
		||||
    label: '订单名',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'customerName',
 | 
			
		||||
    label: '客户名称',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'orderNum',
 | 
			
		||||
    label: '订单数量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '发货数量'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'rate',
 | 
			
		||||
    label: '累计发货比例(%)'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'orderName',
 | 
			
		||||
		label: '订单名',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'customerName',
 | 
			
		||||
		label: '客户名称',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'unit',
 | 
			
		||||
		label: '单位',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'orderNum',
 | 
			
		||||
		label: '订单数量',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'num',
 | 
			
		||||
		label: '发货数量',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'rate',
 | 
			
		||||
		label: '累计发货比例(%)',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: "DeliveryLogDet",
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '订单名',
 | 
			
		||||
          param: 'orderName'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        orderName: ''
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
      this.$auth.hasPermi('extend:delivery-log-det:detail')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'detail',
 | 
			
		||||
              btnName: '详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v)
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { DeliveryLogDetDetail },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList() {
 | 
			
		||||
      deliveryProgressPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      this.queryParams.orderName = val.orderName
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs.deliveryLogDetail.init(val.data)
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	name: 'DeliveryLogDet',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '订单名',
 | 
			
		||||
					param: 'orderName',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				orderName: '',
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			total: 0,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('extend:delivery-log-det:detail')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '详情',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: { DeliveryLogDetDetail },
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getList() {
 | 
			
		||||
			deliveryProgressPage({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				this.list = res.data.list || [];
 | 
			
		||||
				this.total = res.data.total || 0;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			this.queryParams.orderName = val.orderName;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs.deliveryLogDetail.init(val.data);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -298,7 +298,7 @@ export default {
 | 
			
		||||
		},
 | 
			
		||||
		selectObj(val) {
 | 
			
		||||
			this.form.objectId = val[val.length - 1];
 | 
			
		||||
			this.form.objectType = val.length - 1;
 | 
			
		||||
			this.form.objectType = val.length;
 | 
			
		||||
			if (this.form.energyTypeId && this.form.type) {
 | 
			
		||||
				this.getDetailList();
 | 
			
		||||
				this.form.plcParamId = '';
 | 
			
		||||
 
 | 
			
		||||
@@ -1,244 +1,292 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
 | 
			
		||||
      :max-height="tableH">
 | 
			
		||||
      <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick" />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
 | 
			
		||||
      @pagination="getList" />
 | 
			
		||||
    <!-- 新增 -->
 | 
			
		||||
    <base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm" :before-close="handleCancel" width='50%'>
 | 
			
		||||
      <group-class-add ref="classList" @successSubmit="successSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="120"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 新增 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="centervisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="50%">
 | 
			
		||||
			<group-class-add
 | 
			
		||||
				ref="classList"
 | 
			
		||||
				@successSubmit="successSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { getGroupClassesPage, deleteGroupClasses, updateGroupClasses } from "@/api/base/groupClasses";
 | 
			
		||||
import GroupClassAdd from './components/groupClassAdd'
 | 
			
		||||
import { formatDate } from '@/utils'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import {
 | 
			
		||||
	getGroupClassesPage,
 | 
			
		||||
	deleteGroupClasses,
 | 
			
		||||
	updateGroupClasses,
 | 
			
		||||
} from '@/api/base/groupClasses';
 | 
			
		||||
import GroupClassAdd from './components/groupClassAdd';
 | 
			
		||||
import { formatDate } from '@/utils';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'enableTimeStr',
 | 
			
		||||
    label: '生效时段',
 | 
			
		||||
    minWidth: 300
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'roomNameDict',
 | 
			
		||||
    label: '车间名称',
 | 
			
		||||
    filter: publicFormatter('workshop'),
 | 
			
		||||
    minWidth: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '班次名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'timeStr',
 | 
			
		||||
    label: '班次时间',
 | 
			
		||||
    minWidth: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '班次编码',
 | 
			
		||||
    minWidth: 200
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'status',
 | 
			
		||||
    label: '班次状态'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'remark',
 | 
			
		||||
    label: '备注'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'enableTimeStr',
 | 
			
		||||
		label: '生效时段',
 | 
			
		||||
		minWidth: 300,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'roomNameDict',
 | 
			
		||||
		label: '车间名称',
 | 
			
		||||
		filter: publicFormatter('workshop'),
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '班次名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'timeStr',
 | 
			
		||||
		label: '班次时间',
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '班次编码',
 | 
			
		||||
		minWidth: 200,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'status',
 | 
			
		||||
		label: '班次状态',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'remark',
 | 
			
		||||
		label: '备注',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: "GroupClasses",
 | 
			
		||||
  components: { GroupClassAdd },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '班次名称',
 | 
			
		||||
          placeholder: '班次名称',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'separate'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:group-classes:create') ? 'button' : '',
 | 
			
		||||
          btnName: '新增',
 | 
			
		||||
          name: 'add',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi('base:group-classes:cancel')
 | 
			
		||||
          ? {
 | 
			
		||||
            type: 'cancel',
 | 
			
		||||
            btnName: '作废',
 | 
			
		||||
            showParam: {
 | 
			
		||||
              type: '&',
 | 
			
		||||
              data: [
 | 
			
		||||
                {
 | 
			
		||||
                  type: 'unequal',
 | 
			
		||||
                  name: 'status',
 | 
			
		||||
                  value: '不可用'
 | 
			
		||||
                }
 | 
			
		||||
              ]
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:group-classes:update')
 | 
			
		||||
          ? {
 | 
			
		||||
            type: 'edit',
 | 
			
		||||
            btnName: '编辑'
 | 
			
		||||
          }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:group-classes:delete')
 | 
			
		||||
          ? {
 | 
			
		||||
            type: 'delete',
 | 
			
		||||
            btnName: '删除'
 | 
			
		||||
          }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      // 总条数
 | 
			
		||||
      total: 0,
 | 
			
		||||
      // 班次基础信息列表
 | 
			
		||||
      list: [],
 | 
			
		||||
      // 弹出层标题
 | 
			
		||||
      addOrEditTitle: "",
 | 
			
		||||
      // 是否显示弹出层
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        name: null
 | 
			
		||||
      }
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case 'search':
 | 
			
		||||
          this.queryParams.pageNo = 1;
 | 
			
		||||
          this.queryParams.name = val.name
 | 
			
		||||
          this.getList()
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
          this.addOrEditTitle = '新增'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.classList.init()
 | 
			
		||||
          })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    /** 查询列表 */
 | 
			
		||||
    getList() {
 | 
			
		||||
      getGroupClassesPage(this.queryParams).then(res => {
 | 
			
		||||
        if (res.code === 0 && res.data.list.length > 0) {
 | 
			
		||||
          res.data.list.map(item => {
 | 
			
		||||
            item.enableTimeStr = formatDate(item.enableTime) + '至' + (item.disableTime ? formatDate(item.disableTime) : '永久')
 | 
			
		||||
            item.timeStr = item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5)
 | 
			
		||||
            item.status = item.status === true ? '可用' : '不可用'
 | 
			
		||||
          })
 | 
			
		||||
          this.list = res.data.list;
 | 
			
		||||
          this.total = res.data.total;
 | 
			
		||||
        } else {
 | 
			
		||||
          this.list = []
 | 
			
		||||
          this.total = 0
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.classList.init(val.data.id)
 | 
			
		||||
          })
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          break
 | 
			
		||||
        case 'cancel':
 | 
			
		||||
          this.discard(val.data)
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
          this.handleDelete(val.data)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.classList.formClear()
 | 
			
		||||
      this.centervisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.classList.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    discard(row) {
 | 
			
		||||
      let obj = {}
 | 
			
		||||
      obj.id = row.id
 | 
			
		||||
      obj.startTime = row.startTime
 | 
			
		||||
      obj.endTime = row.endTime
 | 
			
		||||
      obj.enableTime = row.enableTime
 | 
			
		||||
      obj.disableTime = Date.parse(new Date())
 | 
			
		||||
      this.$modal.confirm('是否确认作废班次名称为"' + row.name + '"的数据项?').then(function () {
 | 
			
		||||
        return updateGroupClasses({ ...obj })
 | 
			
		||||
      }).then(() => {
 | 
			
		||||
        this.getList();
 | 
			
		||||
        this.$modal.msgSuccess("操作成功");
 | 
			
		||||
      }).catch(() => { });
 | 
			
		||||
    },
 | 
			
		||||
    /** 删除按钮操作 */
 | 
			
		||||
    handleDelete(row) {
 | 
			
		||||
      console.log(row)
 | 
			
		||||
      let _this = this
 | 
			
		||||
      if (row.status === '可用') {// 可用
 | 
			
		||||
        _this.$modal.confirm('删除的班次"' + row.name + '"可能会影响交接班计划,请点取消再次确认!').then(function () {
 | 
			
		||||
          return _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function () {
 | 
			
		||||
            return deleteGroupClasses(row.id);
 | 
			
		||||
          }).then(() => {
 | 
			
		||||
            _this.getList();
 | 
			
		||||
            _this.$modal.msgSuccess("删除成功");
 | 
			
		||||
          }).catch(() => { });
 | 
			
		||||
        })
 | 
			
		||||
      } else {
 | 
			
		||||
        _this.$modal.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?').then(function () {
 | 
			
		||||
          return deleteGroupClasses(row.id);
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          _this.getList();
 | 
			
		||||
          _this.$modal.msgSuccess("删除成功");
 | 
			
		||||
        }).catch(() => { });
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
	name: 'GroupClasses',
 | 
			
		||||
	components: { GroupClassAdd },
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '班次名称',
 | 
			
		||||
					placeholder: '班次名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:group-classes:create')
 | 
			
		||||
						? 'button'
 | 
			
		||||
						: '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:group-classes:cancel')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'cancel',
 | 
			
		||||
							btnName: '作废',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'unequal',
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										value: '不可用',
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:group-classes:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:group-classes:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			// 总条数
 | 
			
		||||
			total: 0,
 | 
			
		||||
			// 班次基础信息列表
 | 
			
		||||
			list: [],
 | 
			
		||||
			// 弹出层标题
 | 
			
		||||
			addOrEditTitle: '',
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			centervisible: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				name: null,
 | 
			
		||||
			},
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.queryParams.pageNo = 1;
 | 
			
		||||
					this.queryParams.name = val.name;
 | 
			
		||||
					this.getList();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.classList.init();
 | 
			
		||||
					});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			getGroupClassesPage(this.queryParams).then((res) => {
 | 
			
		||||
				if (res.code === 0 && res.data.list.length > 0) {
 | 
			
		||||
					res.data.list.map((item) => {
 | 
			
		||||
						item.enableTimeStr =
 | 
			
		||||
							formatDate(item.enableTime) +
 | 
			
		||||
							'至' +
 | 
			
		||||
							(item.disableTime ? formatDate(item.disableTime) : '永久');
 | 
			
		||||
						item.timeStr =
 | 
			
		||||
							item.startTime.slice(0, 5) + '-' + item.endTime.slice(0, 5);
 | 
			
		||||
						item.status = item.status === true ? '可用' : '不可用';
 | 
			
		||||
					});
 | 
			
		||||
					this.list = res.data.list;
 | 
			
		||||
					this.total = res.data.total;
 | 
			
		||||
				} else {
 | 
			
		||||
					this.list = [];
 | 
			
		||||
					this.total = 0;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			switch (val.type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.addOrEditTitle = '编辑';
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.classList.init(val.data.id);
 | 
			
		||||
					});
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					break;
 | 
			
		||||
				case 'cancel':
 | 
			
		||||
					this.discard(val.data);
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.handleDelete(val.data);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleCancel() {
 | 
			
		||||
			this.$refs.classList.formClear();
 | 
			
		||||
			this.centervisible = false;
 | 
			
		||||
			this.addOrEditTitle = '';
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm() {
 | 
			
		||||
			this.$refs.classList.submitForm();
 | 
			
		||||
		},
 | 
			
		||||
		successSubmit() {
 | 
			
		||||
			this.handleCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		discard(row) {
 | 
			
		||||
			let obj = {};
 | 
			
		||||
			obj.id = row.id;
 | 
			
		||||
			obj.startTime = row.startTime;
 | 
			
		||||
			obj.endTime = row.endTime;
 | 
			
		||||
			obj.enableTime = row.enableTime;
 | 
			
		||||
			obj.disableTime = Date.parse(new Date());
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认作废班次名称为"' + row.name + '"的数据项?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return updateGroupClasses({ ...obj });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('操作成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			console.log(row);
 | 
			
		||||
			let _this = this;
 | 
			
		||||
			if (row.status === '可用') {
 | 
			
		||||
				// 可用
 | 
			
		||||
				_this.$modal
 | 
			
		||||
					.confirm(
 | 
			
		||||
						'删除的班次"' +
 | 
			
		||||
							row.name +
 | 
			
		||||
							'"可能会影响交接班计划,请点取消再次确认!'
 | 
			
		||||
					)
 | 
			
		||||
					.then(function () {
 | 
			
		||||
						return _this.$modal
 | 
			
		||||
							.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?')
 | 
			
		||||
							.then(function () {
 | 
			
		||||
								return deleteGroupClasses(row.id);
 | 
			
		||||
							})
 | 
			
		||||
							.then(() => {
 | 
			
		||||
								_this.getList();
 | 
			
		||||
								_this.$modal.msgSuccess('删除成功');
 | 
			
		||||
							})
 | 
			
		||||
							.catch(() => {});
 | 
			
		||||
					});
 | 
			
		||||
			} else {
 | 
			
		||||
				_this.$modal
 | 
			
		||||
					.confirm('是否确认删除班次名称为"' + row.name + '"的数据项?')
 | 
			
		||||
					.then(function () {
 | 
			
		||||
						return deleteGroupClasses(row.id);
 | 
			
		||||
					})
 | 
			
		||||
					.then(() => {
 | 
			
		||||
						_this.getList();
 | 
			
		||||
						_this.$modal.msgSuccess('删除成功');
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,253 +1,260 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
      @emitFun="handleTableEvents"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="80"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 新增 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
      :dialogTitle="addOrEditTitle"
 | 
			
		||||
      :dialogVisible="centervisible"
 | 
			
		||||
      @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm"
 | 
			
		||||
      :before-close="handleCancel"
 | 
			
		||||
      width='40%'
 | 
			
		||||
    >
 | 
			
		||||
      <group-team-add ref="groupList" @successSubmit="successSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
    <!-- 组员编辑 -->
 | 
			
		||||
    <worker-edit v-if='paramVisible' ref='workerEditParam' @closeDrawer="closeDrawer"></worker-edit>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH"
 | 
			
		||||
			@emitFun="handleTableEvents">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 新增 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="centervisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="40%">
 | 
			
		||||
			<group-team-add
 | 
			
		||||
				ref="groupList"
 | 
			
		||||
				@successSubmit="successSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
		<!-- 组员编辑 -->
 | 
			
		||||
		<worker-edit
 | 
			
		||||
			v-if="paramVisible"
 | 
			
		||||
			ref="workerEditParam"
 | 
			
		||||
			@closeDrawer="closeDrawer"></worker-edit>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import { getGroupTeamPage, deleteGroupTeam, updateGroupTeam } from "@/api/base/groupTeam";
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import GroupTeamAdd from './components/groupTeamAdd'
 | 
			
		||||
import StatusBtn from './components/statusBtn'
 | 
			
		||||
import WorkerOperate from './components/workerOperate'
 | 
			
		||||
import WorkerEdit from './components/workerEdit'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import {
 | 
			
		||||
	getGroupTeamPage,
 | 
			
		||||
	deleteGroupTeam,
 | 
			
		||||
	updateGroupTeam,
 | 
			
		||||
} from '@/api/base/groupTeam';
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import GroupTeamAdd from './components/groupTeamAdd';
 | 
			
		||||
import StatusBtn from './components/statusBtn';
 | 
			
		||||
import WorkerOperate from './components/workerOperate';
 | 
			
		||||
import WorkerEdit from './components/workerEdit';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '创建时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'roomNameDict',
 | 
			
		||||
    label: '车间名称',
 | 
			
		||||
    filter: publicFormatter('workshop')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '班组名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '编码',
 | 
			
		||||
    minWidth: 220
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '班组人数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'leaderName',
 | 
			
		||||
    label: '组长'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'enabled',
 | 
			
		||||
    label: '班组状态',
 | 
			
		||||
    subcomponent: StatusBtn
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workerName',
 | 
			
		||||
    label: '组员',
 | 
			
		||||
    subcomponent: WorkerOperate
 | 
			
		||||
  },
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '创建时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'roomNameDict',
 | 
			
		||||
		label: '车间名称',
 | 
			
		||||
		filter: publicFormatter('workshop'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '班组名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '编码',
 | 
			
		||||
		minWidth: 220,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'num',
 | 
			
		||||
		label: '班组人数',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'leaderName',
 | 
			
		||||
		label: '组长',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'enabled',
 | 
			
		||||
		label: '班组状态',
 | 
			
		||||
		subcomponent: StatusBtn,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'workerName',
 | 
			
		||||
		label: '组员',
 | 
			
		||||
		subcomponent: WorkerOperate,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: "GroupTeam",
 | 
			
		||||
  components: { GroupTeamAdd, WorkerEdit },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '班组名称',
 | 
			
		||||
          placeholder: '班组名称',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '组长',
 | 
			
		||||
          placeholder: '组长',
 | 
			
		||||
          param: 'leaderName'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'separate'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '',
 | 
			
		||||
          btnName: '新增',
 | 
			
		||||
          name: 'add',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi('base:group-team:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'edit',
 | 
			
		||||
              btnName: '编辑'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:group-team:delete')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'delete',
 | 
			
		||||
              btnName: '删除'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      // 总条数
 | 
			
		||||
      total: 0,
 | 
			
		||||
      // 班次基础信息列表
 | 
			
		||||
      list: [],
 | 
			
		||||
      // 弹出层标题
 | 
			
		||||
      addOrEditTitle: "",
 | 
			
		||||
      // 是否显示弹出层
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        name: null,
 | 
			
		||||
        code: null
 | 
			
		||||
      },
 | 
			
		||||
      paramVisible: false
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      switch (val.btnName) {
 | 
			
		||||
        case 'search':
 | 
			
		||||
          this.queryParams.pageNo = 1;
 | 
			
		||||
          this.queryParams.leaderName = val.leaderName
 | 
			
		||||
          this.queryParams.name = val.name
 | 
			
		||||
          this.getList()
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
          this.addOrEditTitle = '新增'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.groupList.init()
 | 
			
		||||
          })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    /** 查询列表 */
 | 
			
		||||
    getList() {
 | 
			
		||||
      getGroupTeamPage(this.queryParams).then(response => {
 | 
			
		||||
        this.list = response.data.list;
 | 
			
		||||
        this.total = response.data.total;
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.groupList.init(val.data.id)
 | 
			
		||||
          })
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
        this.handleDelete(val.data)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 班组状态
 | 
			
		||||
    handleTableEvents(params) {
 | 
			
		||||
      console.log(params)
 | 
			
		||||
      if (params.name === 'state') {// 班组状态
 | 
			
		||||
        updateGroupTeam({ ...params.payload }).then((res) => {
 | 
			
		||||
          if (res.code === 0) {
 | 
			
		||||
            this.$modal.msgSuccess("操作成功");
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      }else {// 编辑&查看
 | 
			
		||||
        this.paramVisible = true
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.workerEditParam.init(params)
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.groupList.formClear()
 | 
			
		||||
      this.centervisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.groupList.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    /** 删除按钮操作 */
 | 
			
		||||
    handleDelete(row) {
 | 
			
		||||
      this.$modal.confirm('是否确认删除班组名称为"' + row.name + '"的数据项?').then(function() {
 | 
			
		||||
          return deleteGroupTeam(row.id);
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          this.queryParams.pageNo = 1;
 | 
			
		||||
          this.getList();
 | 
			
		||||
          this.$modal.msgSuccess("删除成功");
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    closeDrawer() {
 | 
			
		||||
      this.getList()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
	name: 'GroupTeam',
 | 
			
		||||
	components: { GroupTeamAdd, WorkerEdit },
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '班组名称',
 | 
			
		||||
					placeholder: '班组名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '组长',
 | 
			
		||||
					placeholder: '组长',
 | 
			
		||||
					param: 'leaderName',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'separate',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:group-team:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:group-team:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:group-team:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			// 总条数
 | 
			
		||||
			total: 0,
 | 
			
		||||
			// 班次基础信息列表
 | 
			
		||||
			list: [],
 | 
			
		||||
			// 弹出层标题
 | 
			
		||||
			addOrEditTitle: '',
 | 
			
		||||
			// 是否显示弹出层
 | 
			
		||||
			centervisible: false,
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				name: null,
 | 
			
		||||
				code: null,
 | 
			
		||||
			},
 | 
			
		||||
			paramVisible: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			switch (val.btnName) {
 | 
			
		||||
				case 'search':
 | 
			
		||||
					this.queryParams.pageNo = 1;
 | 
			
		||||
					this.queryParams.leaderName = val.leaderName;
 | 
			
		||||
					this.queryParams.name = val.name;
 | 
			
		||||
					this.getList();
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.addOrEditTitle = '新增';
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.groupList.init();
 | 
			
		||||
					});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		/** 查询列表 */
 | 
			
		||||
		getList() {
 | 
			
		||||
			getGroupTeamPage(this.queryParams).then((response) => {
 | 
			
		||||
				this.list = response.data.list;
 | 
			
		||||
				this.total = response.data.total;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			switch (val.type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.addOrEditTitle = '编辑';
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.groupList.init(val.data.id);
 | 
			
		||||
					});
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.handleDelete(val.data);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 班组状态
 | 
			
		||||
		handleTableEvents(params) {
 | 
			
		||||
			console.log(params);
 | 
			
		||||
			if (params.name === 'state') {
 | 
			
		||||
				// 班组状态
 | 
			
		||||
				updateGroupTeam({ ...params.payload }).then((res) => {
 | 
			
		||||
					if (res.code === 0) {
 | 
			
		||||
						this.$modal.msgSuccess('操作成功');
 | 
			
		||||
					}
 | 
			
		||||
				});
 | 
			
		||||
			} else {
 | 
			
		||||
				// 编辑&查看
 | 
			
		||||
				this.paramVisible = true;
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
					this.$refs.workerEditParam.init(params);
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleCancel() {
 | 
			
		||||
			this.$refs.groupList.formClear();
 | 
			
		||||
			this.centervisible = false;
 | 
			
		||||
			this.addOrEditTitle = '';
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm() {
 | 
			
		||||
			this.$refs.groupList.submitForm();
 | 
			
		||||
		},
 | 
			
		||||
		successSubmit() {
 | 
			
		||||
			this.handleCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		/** 删除按钮操作 */
 | 
			
		||||
		handleDelete(row) {
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除班组名称为"' + row.name + '"的数据项?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return deleteGroupTeam(row.id);
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.queryParams.pageNo = 1;
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('删除成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		closeDrawer() {
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,152 +1,150 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="160"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <!-- 查看详情 -->
 | 
			
		||||
    <group-team-view-detail v-if="paramVisible" ref="groupTeamViewDetail"/>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="160"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<!-- 查看详情 -->
 | 
			
		||||
		<group-team-view-detail
 | 
			
		||||
			v-if="paramVisible"
 | 
			
		||||
			ref="groupTeamViewDetail" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getByWorkOrder } from '@/api/monitoring/groupTeamView'
 | 
			
		||||
import { workOrderList } from '@/api/base/workOrder'
 | 
			
		||||
import GroupTeamViewDetail from './components/groupTeamViewDetail.vue'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import { getByWorkOrder } from '@/api/monitoring/groupTeamView';
 | 
			
		||||
import { workOrderList } from '@/api/base/workOrder';
 | 
			
		||||
import GroupTeamViewDetail from './components/groupTeamViewDetail.vue';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'roomNameDict',
 | 
			
		||||
    label: '车间名称',
 | 
			
		||||
    filter: publicFormatter('workshop'),
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
    minWidth: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '班组名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'leaderName',
 | 
			
		||||
    label: '班组长'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'num',
 | 
			
		||||
    label: '人数'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workCount',
 | 
			
		||||
    label: '上班次数'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'roomNameDict',
 | 
			
		||||
		label: '车间名称',
 | 
			
		||||
		filter: publicFormatter('workshop'),
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '班组名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'leaderName',
 | 
			
		||||
		label: '班组长',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'num',
 | 
			
		||||
		label: '人数',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'workCount',
 | 
			
		||||
		label: '上班次数',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'GroupTeamView',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '工单',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          param: 'workOrderId',
 | 
			
		||||
          clearable: false,
 | 
			
		||||
          filterable: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 1000,
 | 
			
		||||
        workOrderId: ''
 | 
			
		||||
      },
 | 
			
		||||
      workOrderList: [],
 | 
			
		||||
      workOrderName: '',
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
      this.$auth.hasPermi('base:group-team-view:detail')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'detail',
 | 
			
		||||
              btnName: '详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableH: this.tableHeight(220),
 | 
			
		||||
      list: [],
 | 
			
		||||
      paramVisible: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { GroupTeamViewDetail },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(220)
 | 
			
		||||
    })
 | 
			
		||||
    this.getOrderList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    // 获取工单list
 | 
			
		||||
    getOrderList() {
 | 
			
		||||
      workOrderList().then(res => {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        this.formConfig[0].selectOptions = res.data || []
 | 
			
		||||
        this.workOrderList = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    // 查询
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      if (!val.workOrderId) {
 | 
			
		||||
        this.$modal.msgWarning('工单不能为空')
 | 
			
		||||
        return false
 | 
			
		||||
      }
 | 
			
		||||
      this.queryParams.workOrderId = val.workOrderId
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    // 获取table数据
 | 
			
		||||
    getList() {
 | 
			
		||||
      getByWorkOrder({ id: this.queryParams.workOrderId }).then(res => {
 | 
			
		||||
        this.list = res.data || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      this.paramVisible = true
 | 
			
		||||
      let params = {}
 | 
			
		||||
      params.teamId = val.data.id
 | 
			
		||||
      params.teamName = val.data.name
 | 
			
		||||
      this.workOrderList.map(item => {
 | 
			
		||||
        if (val.data.workOrderId === item.id) {
 | 
			
		||||
          this.workOrderName = item.name
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
      params.workOrderId = val.data.workOrderId
 | 
			
		||||
      params.workOrderName = this.workOrderName
 | 
			
		||||
      params.roomNameDict = val.data.roomNameDict
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs.groupTeamViewDetail.init(params)
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	name: 'GroupTeamView',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '工单',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'workOrderId',
 | 
			
		||||
					clearable: false,
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 1000,
 | 
			
		||||
				workOrderId: '',
 | 
			
		||||
			},
 | 
			
		||||
			heightNum: 220,
 | 
			
		||||
			workOrderList: [],
 | 
			
		||||
			workOrderName: '',
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:group-team-view:detail')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '详情',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			paramVisible: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: { GroupTeamViewDetail },
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getOrderList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		// 获取工单list
 | 
			
		||||
		getOrderList() {
 | 
			
		||||
			workOrderList().then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				this.formConfig[0].selectOptions = res.data || [];
 | 
			
		||||
				this.workOrderList = res.data || [];
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		// 查询
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			if (!val.workOrderId) {
 | 
			
		||||
				this.$modal.msgWarning('工单不能为空');
 | 
			
		||||
				return false;
 | 
			
		||||
			}
 | 
			
		||||
			this.queryParams.workOrderId = val.workOrderId;
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		// 获取table数据
 | 
			
		||||
		getList() {
 | 
			
		||||
			getByWorkOrder({ id: this.queryParams.workOrderId }).then((res) => {
 | 
			
		||||
				this.list = res.data || [];
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			this.paramVisible = true;
 | 
			
		||||
			let params = {};
 | 
			
		||||
			params.teamId = val.data.id;
 | 
			
		||||
			params.teamName = val.data.name;
 | 
			
		||||
			this.workOrderList.map((item) => {
 | 
			
		||||
				if (val.data.workOrderId === item.id) {
 | 
			
		||||
					this.workOrderName = item.name;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
			params.workOrderId = val.data.workOrderId;
 | 
			
		||||
			params.workOrderName = this.workOrderName;
 | 
			
		||||
			params.roomNameDict = val.data.roomNameDict;
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs.groupTeamViewDetail.init(params);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,130 +1,146 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-area @submit="buttonClick" />
 | 
			
		||||
    <!-- <search-bar
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-area @submit="buttonClick" />
 | 
			
		||||
		<!-- <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    /> -->
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list"
 | 
			
		||||
      :max-height="tableH">
 | 
			
		||||
      <method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick" />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total"
 | 
			
		||||
      @pagination="getList" />
 | 
			
		||||
    <!-- 查看生产情况 -->
 | 
			
		||||
    <team-production-detail v-if='paramVisible' ref='schedulingMonitoringDetail' />
 | 
			
		||||
  </div>
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 查看生产情况 -->
 | 
			
		||||
		<team-production-detail
 | 
			
		||||
			v-if="paramVisible"
 | 
			
		||||
			ref="schedulingMonitoringDetail" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { groupTeamSchedulingPage } from '@/api/monitoring/teamProduction'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import TeamProductionDetail from './components/teamProductionDetail'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import SearchArea from './components/searchArea'
 | 
			
		||||
import { groupTeamSchedulingPage } from '@/api/monitoring/teamProduction';
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import TeamProductionDetail from './components/teamProductionDetail';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import SearchArea from './components/searchArea';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'roomNameDict',
 | 
			
		||||
    label: '车间名称',
 | 
			
		||||
    filter: publicFormatter('workshop'),
 | 
			
		||||
    showOverflowtooltip: true,
 | 
			
		||||
    minWidth: 100
 | 
			
		||||
  },
 | 
			
		||||
  // {
 | 
			
		||||
  //   prop: 'createTime',
 | 
			
		||||
  //   label: '排班创建时间',
 | 
			
		||||
  //   filter: parseTime,
 | 
			
		||||
  //   minWidth: 160
 | 
			
		||||
  // },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'startDay',
 | 
			
		||||
    label: '上班日期',
 | 
			
		||||
    minWidth: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'startTime',
 | 
			
		||||
    label: '上班时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'endTime',
 | 
			
		||||
    label: '下班时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'classesName',
 | 
			
		||||
    label: '班次名称',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'teamName',
 | 
			
		||||
    label: '班组名称',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'roomNameDict',
 | 
			
		||||
		label: '车间名称',
 | 
			
		||||
		filter: publicFormatter('workshop'),
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
	},
 | 
			
		||||
	// {
 | 
			
		||||
	//   prop: 'createTime',
 | 
			
		||||
	//   label: '排班创建时间',
 | 
			
		||||
	//   filter: parseTime,
 | 
			
		||||
	//   minWidth: 160
 | 
			
		||||
	// },
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'startDay',
 | 
			
		||||
		label: '上班日期',
 | 
			
		||||
		minWidth: 100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'startTime',
 | 
			
		||||
		label: '上班时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'endTime',
 | 
			
		||||
		label: '下班时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'classesName',
 | 
			
		||||
		label: '班次名称',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'teamName',
 | 
			
		||||
		label: '班组名称',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'GroupTeamScheduling',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        classesId: '',
 | 
			
		||||
        teamName: '',
 | 
			
		||||
        startDay: []
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi('base:team-production:detail')
 | 
			
		||||
          ? {
 | 
			
		||||
            type: 'productionDetail',
 | 
			
		||||
            btnName: '查看',
 | 
			
		||||
            showTip: '生产情况'
 | 
			
		||||
          }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      total: 0,
 | 
			
		||||
      paramVisible: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { TeamProductionDetail, SearchArea },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      this.queryParams.pageNo = 1;
 | 
			
		||||
      this.queryParams.classesId = val.classesId
 | 
			
		||||
      this.queryParams.teamName = val.teamName
 | 
			
		||||
      this.queryParams.startDay[0] = val.tiemStr ? val.tiemStr[0] + ' 00:00:00' : ''
 | 
			
		||||
      this.queryParams.startDay[1] = val.tiemStr ? val.tiemStr[1] + ' 23:59:59' : ''
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      groupTeamSchedulingPage({ ...this.queryParams }).then(res => {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      this.paramVisible = true
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
        this.$refs.schedulingMonitoringDetail.init(val.data)
 | 
			
		||||
      })
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	name: 'GroupTeamScheduling',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				classesId: '',
 | 
			
		||||
				teamName: '',
 | 
			
		||||
				startDay: [],
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:team-production:detail')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'productionDetail',
 | 
			
		||||
							btnName: '查看',
 | 
			
		||||
							showTip: '生产情况',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			list: [],
 | 
			
		||||
			total: 0,
 | 
			
		||||
			paramVisible: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: { TeamProductionDetail, SearchArea },
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.queryParams.classesId = val.classesId;
 | 
			
		||||
			this.queryParams.teamName = val.teamName;
 | 
			
		||||
			this.queryParams.startDay[0] = val.tiemStr
 | 
			
		||||
				? val.tiemStr[0] + ' 00:00:00'
 | 
			
		||||
				: '';
 | 
			
		||||
			this.queryParams.startDay[1] = val.tiemStr
 | 
			
		||||
				? val.tiemStr[1] + ' 23:59:59'
 | 
			
		||||
				: '';
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		getList() {
 | 
			
		||||
			groupTeamSchedulingPage({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				this.list = res.data.list || [];
 | 
			
		||||
				this.total = res.data.total || 0;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			this.paramVisible = true;
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				this.$refs.schedulingMonitoringDetail.init(val.data);
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,440 +1,465 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="240"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 新增&编辑 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
      :dialogTitle="addOrEditTitle"
 | 
			
		||||
      :dialogVisible="centervisible"
 | 
			
		||||
      @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm"
 | 
			
		||||
      :before-close="handleCancel"
 | 
			
		||||
      width='60%'
 | 
			
		||||
    >
 | 
			
		||||
      <order-group-add ref="orderGroupAdd" @successSubmit="successSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
    <!-- 查看详情 -->
 | 
			
		||||
    <!-- 新增工单 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
      dialogTitle="绑定厂务订单"
 | 
			
		||||
      :dialogVisible="bindOrderVisible"
 | 
			
		||||
      @cancel="bindOrderCancel"
 | 
			
		||||
      @confirm="bindOrderConfirm"
 | 
			
		||||
      :before-close="bindOrderCancel"
 | 
			
		||||
      width='60%'
 | 
			
		||||
    >
 | 
			
		||||
      <bind-order ref="bindOrder" @bindOrderSubmit="bindOrderSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="240"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 新增&编辑 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="centervisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="60%">
 | 
			
		||||
			<order-group-add
 | 
			
		||||
				ref="orderGroupAdd"
 | 
			
		||||
				@successSubmit="successSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
		<!-- 查看详情 -->
 | 
			
		||||
		<!-- 新增工单 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			dialogTitle="绑定厂务订单"
 | 
			
		||||
			:dialogVisible="bindOrderVisible"
 | 
			
		||||
			@cancel="bindOrderCancel"
 | 
			
		||||
			@confirm="bindOrderConfirm"
 | 
			
		||||
			:before-close="bindOrderCancel"
 | 
			
		||||
			width="60%">
 | 
			
		||||
			<bind-order
 | 
			
		||||
				ref="bindOrder"
 | 
			
		||||
				@bindOrderSubmit="bindOrderSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup'
 | 
			
		||||
import { customerList } from '@/api/base/orderManage'
 | 
			
		||||
import OrderGroupAdd from './components/orderGroupAdd'
 | 
			
		||||
import BindOrder from './components/bindOrder'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import { getOrderGroupPage, groupOrderStatusSet } from '@/api/base/orderGroup';
 | 
			
		||||
import { customerList } from '@/api/base/orderManage';
 | 
			
		||||
import OrderGroupAdd from './components/orderGroupAdd';
 | 
			
		||||
import BindOrder from './components/bindOrder';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '添加时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '订单名称',
 | 
			
		||||
    minWidth: 140,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '订单编码',
 | 
			
		||||
    minWidth: 150
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'customerId',
 | 
			
		||||
    label: '客户',
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'status',
 | 
			
		||||
    label: '订单状态',
 | 
			
		||||
    filter: publicFormatter('order_status')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productName',
 | 
			
		||||
    label: '产品名称',
 | 
			
		||||
    minWidth: 200,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'specifications',
 | 
			
		||||
    label: '产品规格',
 | 
			
		||||
    minWidth: 120,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位',
 | 
			
		||||
    filter: publicFormatter('unit_dict')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planQuantity',
 | 
			
		||||
    label: '计划加工量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'actualquantity',
 | 
			
		||||
    label: '实际加工量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'deliveTime',
 | 
			
		||||
    label: '交货时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'packReq',
 | 
			
		||||
    label: '包装要求',
 | 
			
		||||
    // filter: publicFormatter('pack_spec'),
 | 
			
		||||
    minWidth: 120,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'orderIdNum',
 | 
			
		||||
    label: '订单数量'
 | 
			
		||||
  }  
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '添加时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '订单名称',
 | 
			
		||||
		minWidth: 140,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '订单编码',
 | 
			
		||||
		minWidth: 150,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'customerId',
 | 
			
		||||
		label: '客户',
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'status',
 | 
			
		||||
		label: '订单状态',
 | 
			
		||||
		filter: publicFormatter('order_status'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'productName',
 | 
			
		||||
		label: '产品名称',
 | 
			
		||||
		minWidth: 200,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'specifications',
 | 
			
		||||
		label: '产品规格',
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'unit',
 | 
			
		||||
		label: '单位',
 | 
			
		||||
		filter: publicFormatter('unit_dict'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'planQuantity',
 | 
			
		||||
		label: '计划加工量',
 | 
			
		||||
		width: 100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'actualquantity',
 | 
			
		||||
		label: '实际加工量',
 | 
			
		||||
		width: 100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'deliveTime',
 | 
			
		||||
		label: '交货时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'packReq',
 | 
			
		||||
		label: '包装要求',
 | 
			
		||||
		// filter: publicFormatter('pack_spec'),
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'orderIdNum',
 | 
			
		||||
		label: '订单数量',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'OrderGroup',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '订单名称',
 | 
			
		||||
          placeholder: '订单名称',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '状态',
 | 
			
		||||
          selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
 | 
			
		||||
          labelField: 'label',
 | 
			
		||||
          valueField: 'value',
 | 
			
		||||
          param: 'status'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '时间段',
 | 
			
		||||
          dateType: 'daterange',
 | 
			
		||||
          format: 'yyyy-MM-dd',
 | 
			
		||||
          valueFormat: "yyyy-MM-dd",
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          startPlaceholder: '开始时间',
 | 
			
		||||
          endPlaceholder: '结束时间',
 | 
			
		||||
          param: 'timeVal',
 | 
			
		||||
          defaultSelect: [],
 | 
			
		||||
          width: 250
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:order-group:create') ? 'separate' : '',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
 | 
			
		||||
          btnName: '新增',
 | 
			
		||||
          name: 'add',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        name: null,
 | 
			
		||||
        status: null,
 | 
			
		||||
        planFinishTime: []
 | 
			
		||||
      },
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
      this.$auth.hasPermi('base:order-group:bind')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'bind',
 | 
			
		||||
              btnName: '绑定',
 | 
			
		||||
              showTip: '厂务订单',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'less',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 3
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:order-group:complete')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'complete',
 | 
			
		||||
              btnName: '完成',
 | 
			
		||||
              showTip: '完成订单',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 3
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
          this.$auth.hasPermi('base:order-group:termination')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'termination',
 | 
			
		||||
              btnName: '终止',
 | 
			
		||||
              showTip: '终止',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 3
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
          this.$auth.hasPermi('base:order-group:cancel')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'cancel',
 | 
			
		||||
              btnName: '作废',
 | 
			
		||||
              showTip: '作废',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'less',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 2
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
          {
 | 
			
		||||
            type: 'detail',
 | 
			
		||||
            btnName: '详情'
 | 
			
		||||
          },
 | 
			
		||||
        this.$auth.hasPermi('base:order-group:edit')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'edit',
 | 
			
		||||
              btnName: '编辑',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'less',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 2
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      addOrEditTitle: '',
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
 | 
			
		||||
      workIssueTitle: '',
 | 
			
		||||
      bindOrderVisible: false,
 | 
			
		||||
      orderDetailVisible: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { OrderGroupAdd, BindOrder },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList() {
 | 
			
		||||
      getOrderGroupPage({...this.queryParams}).then(res => {
 | 
			
		||||
        let arr = res.data.records || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
        if (arr.length > 0) {
 | 
			
		||||
          customerList().then(result => {
 | 
			
		||||
            let tempData = result.data || []
 | 
			
		||||
            if (tempData.length > 0) {
 | 
			
		||||
              arr.map(item => {
 | 
			
		||||
                for (let i of tempData) {
 | 
			
		||||
                  if (item.customerId === i.id) {
 | 
			
		||||
                    item.customerId = i.name
 | 
			
		||||
                  }
 | 
			
		||||
                }
 | 
			
		||||
              })
 | 
			
		||||
              this.list = arr
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        }else {
 | 
			
		||||
          this.list = arr
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.queryParams.name = val.name
 | 
			
		||||
        this.queryParams.status = val.status
 | 
			
		||||
        if (val.timeVal && val.timeVal.length > 0) {
 | 
			
		||||
          this.queryParams.planFinishTime[0] = val.timeVal[0] + ' 00:00:00'
 | 
			
		||||
          this.queryParams.planFinishTime[1] = val.timeVal[1] + ' 23:59:59'
 | 
			
		||||
        } else {
 | 
			
		||||
          this.queryParams.planFinishTime = []
 | 
			
		||||
        }
 | 
			
		||||
        this.getList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.addOrEditTitle = '新增'
 | 
			
		||||
        this.centervisible = true
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.orderGroupAdd.init()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.orderGroupAdd.init(val.data.id)
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        case 'cancel':
 | 
			
		||||
          this.handleEditStatus(val.data, '作废', '6')
 | 
			
		||||
          break
 | 
			
		||||
        case 'detail':
 | 
			
		||||
          this.$router.push({path: '/order/base/order-group/order-group-detail-data?orderGroupId='+ val.data.id})
 | 
			
		||||
          break
 | 
			
		||||
        case 'termination':
 | 
			
		||||
          this.handleEditStatus(val.data, '终止', '5')
 | 
			
		||||
          break
 | 
			
		||||
        case 'bind':
 | 
			
		||||
          this.workIssueTitle = '绑定工单'
 | 
			
		||||
          this.bindOrderVisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.bindOrder.init(val.data)
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        case 'complete':
 | 
			
		||||
          this.handleEditStatus(val.data, '完成', '4')
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 完成,终止,作废
 | 
			
		||||
    handleEditStatus(val, tip, status) {
 | 
			
		||||
      let _this = this
 | 
			
		||||
      if (val.orderIdNum > 0) {// 有下级订单
 | 
			
		||||
        _this.$confirm('是否将"'+tip+'"操作同步至下级订单和工单?','确认信息', {
 | 
			
		||||
          type: 'warning',
 | 
			
		||||
          distinguishCancelAndClose: true,
 | 
			
		||||
          confirmButtonText: '同步',
 | 
			
		||||
          cancelButtonText: '不同步'
 | 
			
		||||
        }).then(function() {
 | 
			
		||||
          console.log('同步')
 | 
			
		||||
          groupOrderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
 | 
			
		||||
            _this.getList();
 | 
			
		||||
            _this.$modal.msgSuccess("操作成功");
 | 
			
		||||
          })
 | 
			
		||||
        }).catch(action => {
 | 
			
		||||
          if (action === 'cancel') {
 | 
			
		||||
            console.log('不同步')
 | 
			
		||||
            groupOrderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
 | 
			
		||||
              _this.getList();
 | 
			
		||||
              _this.$modal.msgSuccess("操作成功");
 | 
			
		||||
            })
 | 
			
		||||
          }else {
 | 
			
		||||
            return console.log('关闭')
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      }else{// 无下级订单
 | 
			
		||||
        _this.$modal.confirm('是否确认"'+tip+'"集团订单名称为"' + val.name + '"的数据项?').then(function() {
 | 
			
		||||
          return groupOrderStatusSet({ id: val.id, status: status})
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          _this.getList();
 | 
			
		||||
          _this.$modal.msgSuccess("操作成功");
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.orderGroupAdd.formClear()
 | 
			
		||||
      this.centervisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.orderGroupAdd.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    // 下发新增
 | 
			
		||||
    bindOrderCancel() {
 | 
			
		||||
      this.$refs.bindOrder.formClear()
 | 
			
		||||
      this.bindOrderVisible = false
 | 
			
		||||
    },
 | 
			
		||||
    bindOrderConfirm() {
 | 
			
		||||
      this.$refs.bindOrder.bindOrderSubmit()
 | 
			
		||||
    },
 | 
			
		||||
    bindOrderSubmit() {
 | 
			
		||||
      this.bindOrderCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	name: 'OrderGroup',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '订单名称',
 | 
			
		||||
					placeholder: '订单名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '状态',
 | 
			
		||||
					selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
 | 
			
		||||
					labelField: 'label',
 | 
			
		||||
					valueField: 'value',
 | 
			
		||||
					param: 'status',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange',
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					valueFormat: 'yyyy-MM-dd',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'timeVal',
 | 
			
		||||
					defaultSelect: [],
 | 
			
		||||
					width: 250,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:order-group:create')
 | 
			
		||||
						? 'separate'
 | 
			
		||||
						: '',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:order-group:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				name: null,
 | 
			
		||||
				status: null,
 | 
			
		||||
				planFinishTime: [],
 | 
			
		||||
			},
 | 
			
		||||
			total: 0,
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:order-group:bind')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'bind',
 | 
			
		||||
							btnName: '绑定',
 | 
			
		||||
							showTip: '厂务订单',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'less',
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										value: 3,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-group:complete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'complete',
 | 
			
		||||
							btnName: '完成',
 | 
			
		||||
							showTip: '完成订单',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'equal',
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										value: 3,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-group:termination')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'termination',
 | 
			
		||||
							btnName: '终止',
 | 
			
		||||
							showTip: '终止',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'equal',
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										value: 3,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-group:cancel')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'cancel',
 | 
			
		||||
							btnName: '作废',
 | 
			
		||||
							showTip: '作废',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'less',
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										value: 2,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				{
 | 
			
		||||
					type: 'detail',
 | 
			
		||||
					btnName: '详情',
 | 
			
		||||
				},
 | 
			
		||||
				this.$auth.hasPermi('base:order-group:edit')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'less',
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										value: 2,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			addOrEditTitle: '',
 | 
			
		||||
			centervisible: false,
 | 
			
		||||
			priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
 | 
			
		||||
			workIssueTitle: '',
 | 
			
		||||
			bindOrderVisible: false,
 | 
			
		||||
			orderDetailVisible: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: { OrderGroupAdd, BindOrder },
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getList() {
 | 
			
		||||
			getOrderGroupPage({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				let arr = res.data.records || [];
 | 
			
		||||
				this.total = res.data.total || 0;
 | 
			
		||||
				if (arr.length > 0) {
 | 
			
		||||
					customerList().then((result) => {
 | 
			
		||||
						let tempData = result.data || [];
 | 
			
		||||
						if (tempData.length > 0) {
 | 
			
		||||
							arr.map((item) => {
 | 
			
		||||
								for (let i of tempData) {
 | 
			
		||||
									if (item.customerId === i.id) {
 | 
			
		||||
										item.customerId = i.name;
 | 
			
		||||
									}
 | 
			
		||||
								}
 | 
			
		||||
							});
 | 
			
		||||
							this.list = arr;
 | 
			
		||||
						}
 | 
			
		||||
					});
 | 
			
		||||
				} else {
 | 
			
		||||
					this.list = arr;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			if (val.btnName === 'search') {
 | 
			
		||||
				this.queryParams.name = val.name;
 | 
			
		||||
				this.queryParams.status = val.status;
 | 
			
		||||
				if (val.timeVal && val.timeVal.length > 0) {
 | 
			
		||||
					this.queryParams.planFinishTime[0] = val.timeVal[0] + ' 00:00:00';
 | 
			
		||||
					this.queryParams.planFinishTime[1] = val.timeVal[1] + ' 23:59:59';
 | 
			
		||||
				} else {
 | 
			
		||||
					this.queryParams.planFinishTime = [];
 | 
			
		||||
				}
 | 
			
		||||
				this.getList();
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addOrEditTitle = '新增';
 | 
			
		||||
				this.centervisible = true;
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
					this.$refs.orderGroupAdd.init();
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			switch (val.type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.addOrEditTitle = '编辑';
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.orderGroupAdd.init(val.data.id);
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				case 'cancel':
 | 
			
		||||
					this.handleEditStatus(val.data, '作废', '6');
 | 
			
		||||
					break;
 | 
			
		||||
				case 'detail':
 | 
			
		||||
					this.$router.push({
 | 
			
		||||
						path:
 | 
			
		||||
							'/order/base/order-group/order-group-detail-data?orderGroupId=' +
 | 
			
		||||
							val.data.id,
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				case 'termination':
 | 
			
		||||
					this.handleEditStatus(val.data, '终止', '5');
 | 
			
		||||
					break;
 | 
			
		||||
				case 'bind':
 | 
			
		||||
					this.workIssueTitle = '绑定工单';
 | 
			
		||||
					this.bindOrderVisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.bindOrder.init(val.data);
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				case 'complete':
 | 
			
		||||
					this.handleEditStatus(val.data, '完成', '4');
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 完成,终止,作废
 | 
			
		||||
		handleEditStatus(val, tip, status) {
 | 
			
		||||
			let _this = this;
 | 
			
		||||
			if (val.orderIdNum > 0) {
 | 
			
		||||
				// 有下级订单
 | 
			
		||||
				_this
 | 
			
		||||
					.$confirm(
 | 
			
		||||
						'是否将"' + tip + '"操作同步至下级订单和工单?',
 | 
			
		||||
						'确认信息',
 | 
			
		||||
						{
 | 
			
		||||
							type: 'warning',
 | 
			
		||||
							distinguishCancelAndClose: true,
 | 
			
		||||
							confirmButtonText: '同步',
 | 
			
		||||
							cancelButtonText: '不同步',
 | 
			
		||||
						}
 | 
			
		||||
					)
 | 
			
		||||
					.then(function () {
 | 
			
		||||
						console.log('同步');
 | 
			
		||||
						groupOrderStatusSet({
 | 
			
		||||
							id: val.id,
 | 
			
		||||
							status: status,
 | 
			
		||||
							isSync: true,
 | 
			
		||||
						}).then(() => {
 | 
			
		||||
							_this.getList();
 | 
			
		||||
							_this.$modal.msgSuccess('操作成功');
 | 
			
		||||
						});
 | 
			
		||||
					})
 | 
			
		||||
					.catch((action) => {
 | 
			
		||||
						if (action === 'cancel') {
 | 
			
		||||
							console.log('不同步');
 | 
			
		||||
							groupOrderStatusSet({
 | 
			
		||||
								id: val.id,
 | 
			
		||||
								status: status,
 | 
			
		||||
								isSync: false,
 | 
			
		||||
							}).then(() => {
 | 
			
		||||
								_this.getList();
 | 
			
		||||
								_this.$modal.msgSuccess('操作成功');
 | 
			
		||||
							});
 | 
			
		||||
						} else {
 | 
			
		||||
							return console.log('关闭');
 | 
			
		||||
						}
 | 
			
		||||
					});
 | 
			
		||||
			} else {
 | 
			
		||||
				// 无下级订单
 | 
			
		||||
				_this.$modal
 | 
			
		||||
					.confirm(
 | 
			
		||||
						'是否确认"' + tip + '"集团订单名称为"' + val.name + '"的数据项?'
 | 
			
		||||
					)
 | 
			
		||||
					.then(function () {
 | 
			
		||||
						return groupOrderStatusSet({ id: val.id, status: status });
 | 
			
		||||
					})
 | 
			
		||||
					.then(() => {
 | 
			
		||||
						_this.getList();
 | 
			
		||||
						_this.$modal.msgSuccess('操作成功');
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleCancel() {
 | 
			
		||||
			this.$refs.orderGroupAdd.formClear();
 | 
			
		||||
			this.centervisible = false;
 | 
			
		||||
			this.addOrEditTitle = '';
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm() {
 | 
			
		||||
			this.$refs.orderGroupAdd.submitForm();
 | 
			
		||||
		},
 | 
			
		||||
		successSubmit() {
 | 
			
		||||
			this.handleCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		// 下发新增
 | 
			
		||||
		bindOrderCancel() {
 | 
			
		||||
			this.$refs.bindOrder.formClear();
 | 
			
		||||
			this.bindOrderVisible = false;
 | 
			
		||||
		},
 | 
			
		||||
		bindOrderConfirm() {
 | 
			
		||||
			this.$refs.bindOrder.bindOrderSubmit();
 | 
			
		||||
		},
 | 
			
		||||
		bindOrderSubmit() {
 | 
			
		||||
			this.bindOrderCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,470 +1,494 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="290"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 新增&编辑 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
      :dialogTitle="addOrEditTitle"
 | 
			
		||||
      :dialogVisible="centervisible"
 | 
			
		||||
      @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm"
 | 
			
		||||
      :before-close="handleCancel"
 | 
			
		||||
      width='60%'
 | 
			
		||||
    >
 | 
			
		||||
      <order-add ref="orderAdd" @successSubmit="successSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
    <!-- 查看详情 -->
 | 
			
		||||
    <!-- 新增工单 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
      :dialogTitle="workIssueTitle"
 | 
			
		||||
      :dialogVisible="addWorkOrdervisible"
 | 
			
		||||
      @cancel="addWorkOrderCancel"
 | 
			
		||||
      @confirm="addWorkOrderConfirm"
 | 
			
		||||
      :before-close="addWorkOrderCancel"
 | 
			
		||||
      width='70%'
 | 
			
		||||
    >
 | 
			
		||||
      <add-work-order ref="addWorkOrder" @addWorkOrderSubmit="addWorkOrderSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="290"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 新增&编辑 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="centervisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="60%">
 | 
			
		||||
			<order-add
 | 
			
		||||
				ref="orderAdd"
 | 
			
		||||
				@successSubmit="successSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
		<!-- 查看详情 -->
 | 
			
		||||
		<!-- 新增工单 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="workIssueTitle"
 | 
			
		||||
			:dialogVisible="addWorkOrdervisible"
 | 
			
		||||
			@cancel="addWorkOrderCancel"
 | 
			
		||||
			@confirm="addWorkOrderConfirm"
 | 
			
		||||
			:before-close="addWorkOrderCancel"
 | 
			
		||||
			width="70%">
 | 
			
		||||
			<add-work-order
 | 
			
		||||
				ref="addWorkOrder"
 | 
			
		||||
				@addWorkOrderSubmit="addWorkOrderSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { getOrderPage, orderStatusSet, customerList, orderFinish } from '@/api/base/orderManage'
 | 
			
		||||
import OrderAdd from './components/orderAdd'
 | 
			
		||||
import AddWorkOrder from './components/addWorkOrder'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import {
 | 
			
		||||
	getOrderPage,
 | 
			
		||||
	orderStatusSet,
 | 
			
		||||
	customerList,
 | 
			
		||||
	orderFinish,
 | 
			
		||||
} from '@/api/base/orderManage';
 | 
			
		||||
import OrderAdd from './components/orderAdd';
 | 
			
		||||
import AddWorkOrder from './components/addWorkOrder';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '添加时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '订单名称',
 | 
			
		||||
    minWidth: 140,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '订单编码',
 | 
			
		||||
    minWidth: 150,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'triggerOrigin',
 | 
			
		||||
    label: '来源',
 | 
			
		||||
    filter: publicFormatter('order_Origin')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'priority',
 | 
			
		||||
    label: '优先级',
 | 
			
		||||
    filter: publicFormatter('order_priority')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'status',
 | 
			
		||||
    label: '订单状态',
 | 
			
		||||
    filter: publicFormatter('order_status')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'planQuantity',
 | 
			
		||||
    label: '计划加工量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'actualQuantity',
 | 
			
		||||
    label: '实际加工量',
 | 
			
		||||
    width: 100
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'productName',
 | 
			
		||||
    label: '产品',
 | 
			
		||||
    width: 200,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位',
 | 
			
		||||
    filter: publicFormatter('unit_dict')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'price',
 | 
			
		||||
    label: '单价(元)',
 | 
			
		||||
    align: 'right'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'workOrderNum',
 | 
			
		||||
    label: '工单数量'
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '添加时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '订单名称',
 | 
			
		||||
		minWidth: 140,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '订单编码',
 | 
			
		||||
		minWidth: 150,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'triggerOrigin',
 | 
			
		||||
		label: '来源',
 | 
			
		||||
		filter: publicFormatter('order_Origin'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'priority',
 | 
			
		||||
		label: '优先级',
 | 
			
		||||
		filter: publicFormatter('order_priority'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'status',
 | 
			
		||||
		label: '订单状态',
 | 
			
		||||
		filter: publicFormatter('order_status'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'planQuantity',
 | 
			
		||||
		label: '计划加工量',
 | 
			
		||||
		width: 100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'actualQuantity',
 | 
			
		||||
		label: '实际加工量',
 | 
			
		||||
		width: 100,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'productName',
 | 
			
		||||
		label: '产品',
 | 
			
		||||
		width: 200,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'unit',
 | 
			
		||||
		label: '单位',
 | 
			
		||||
		filter: publicFormatter('unit_dict'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'price',
 | 
			
		||||
		label: '单价(元)',
 | 
			
		||||
		align: 'right',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'workOrderNum',
 | 
			
		||||
		label: '工单数量',
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'OrderManage',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '订单名称',
 | 
			
		||||
          placeholder: '订单名称',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '状态',
 | 
			
		||||
          selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
 | 
			
		||||
          labelField: 'label',
 | 
			
		||||
          valueField: 'value',
 | 
			
		||||
          param: 'status'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '时间段',
 | 
			
		||||
          dateType: 'daterange',
 | 
			
		||||
          format: 'yyyy-MM-dd',
 | 
			
		||||
          valueFormat: "yyyy-MM-dd",
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          startPlaceholder: '开始时间',
 | 
			
		||||
          endPlaceholder: '结束时间',
 | 
			
		||||
          param: 'timeVal',
 | 
			
		||||
          defaultSelect: [],
 | 
			
		||||
          width: 250
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
 | 
			
		||||
          btnName: '新增',
 | 
			
		||||
          name: 'add',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        name: null,
 | 
			
		||||
        status: null,
 | 
			
		||||
        lastIssuedTime: []
 | 
			
		||||
      },
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
      this.$auth.hasPermi('base:order-manage:addWorkOrder')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'add',
 | 
			
		||||
              btnName: '新增',
 | 
			
		||||
              showTip: '新增工单',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'less',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 3
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:order-manage:bindWorkOrder')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'bind',
 | 
			
		||||
              btnName: '绑定',
 | 
			
		||||
              showTip: '绑定工单',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'less',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 3
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:order-manage:complete')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'complete',
 | 
			
		||||
              btnName: '完成',
 | 
			
		||||
              showTip: '完成订单',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 3
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:order-manage:termination')
 | 
			
		||||
        ? {
 | 
			
		||||
            type: 'termination',
 | 
			
		||||
            btnName: '终止',
 | 
			
		||||
            showTip: '终止',
 | 
			
		||||
            showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'equal',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 3
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
          }
 | 
			
		||||
        : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:order-manage:cancel')
 | 
			
		||||
        ? {
 | 
			
		||||
            type: 'cancel',
 | 
			
		||||
            btnName: '作废',
 | 
			
		||||
            showTip: '作废',
 | 
			
		||||
            showParam: {
 | 
			
		||||
              type: '&',
 | 
			
		||||
              data: [
 | 
			
		||||
                {
 | 
			
		||||
                  type: 'less',
 | 
			
		||||
                  name: 'status',
 | 
			
		||||
                  value: 2
 | 
			
		||||
                }
 | 
			
		||||
              ]
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        : undefined,
 | 
			
		||||
      this.$auth.hasPermi('base:order-manage:detail')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'detail',
 | 
			
		||||
              btnName: '详情'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:order-manage:edit')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'edit',
 | 
			
		||||
              btnName: '编辑',
 | 
			
		||||
              showParam: {
 | 
			
		||||
                type: '&',
 | 
			
		||||
                data: [
 | 
			
		||||
                  {
 | 
			
		||||
                    type: 'less',
 | 
			
		||||
                    name: 'status',
 | 
			
		||||
                    value: 2
 | 
			
		||||
                  }
 | 
			
		||||
                ]
 | 
			
		||||
              }
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v) => v),
 | 
			
		||||
      addOrEditTitle: '',
 | 
			
		||||
      centervisible: false,
 | 
			
		||||
      priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
 | 
			
		||||
      workIssueTitle: '',
 | 
			
		||||
      addWorkOrdervisible: false,
 | 
			
		||||
      orderDetailVisible: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { OrderAdd, AddWorkOrder },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList() {
 | 
			
		||||
      getOrderPage({...this.queryParams}).then(res => {
 | 
			
		||||
        let arr = res.data.records || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
        if (arr.length > 0) {
 | 
			
		||||
          customerList().then(result => {
 | 
			
		||||
            let tempData = result.data || []
 | 
			
		||||
            if (tempData.length > 0) {
 | 
			
		||||
              arr.map(item => {
 | 
			
		||||
                for (let i of tempData) {
 | 
			
		||||
                  if (item.customerId === i.id) {
 | 
			
		||||
                    item.customerId = i.name
 | 
			
		||||
                  }
 | 
			
		||||
                }
 | 
			
		||||
                item.price =  item.price ? item.price.toFixed(2) : '0.00'
 | 
			
		||||
              })
 | 
			
		||||
              this.list = arr
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        }else {
 | 
			
		||||
          this.list = arr
 | 
			
		||||
        }
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.queryParams.name = val.name
 | 
			
		||||
        this.queryParams.status = val.status
 | 
			
		||||
        if (val.timeVal && val.timeVal.length > 0) {
 | 
			
		||||
          this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00'
 | 
			
		||||
          this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59'
 | 
			
		||||
        } else {
 | 
			
		||||
          this.queryParams.lastIssuedTime = []
 | 
			
		||||
        }
 | 
			
		||||
        this.getList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.addOrEditTitle = '新增'
 | 
			
		||||
        this.centervisible = true
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.orderAdd.init()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.orderAdd.init(val.data.id)
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        case 'cancel':
 | 
			
		||||
          this.handleEditStatus(val.data, '作废', '6')
 | 
			
		||||
          break
 | 
			
		||||
        case 'termination':
 | 
			
		||||
          this.handleEditStatus(val.data, '终止', '5')
 | 
			
		||||
          break
 | 
			
		||||
        case 'detail':
 | 
			
		||||
          this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id})
 | 
			
		||||
          break
 | 
			
		||||
        case 'add':
 | 
			
		||||
          this.workIssueTitle = '新增工单'
 | 
			
		||||
          this.addWorkOrdervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.addWorkOrder.init(val.data, 'add')
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        case 'bind':
 | 
			
		||||
          this.workIssueTitle = '绑定工单'
 | 
			
		||||
          this.addWorkOrdervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.addWorkOrder.init(val.data, 'bind')
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        case 'complete':
 | 
			
		||||
          this.handleEditStatus(val.data, '完成', '4')
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 完成,终止,作废
 | 
			
		||||
    handleEditStatus(val, tip, status) {
 | 
			
		||||
      let _this = this
 | 
			
		||||
      if (val.workOrderNum > 0) {//有下级工单
 | 
			
		||||
        _this.$confirm('是否将"'+tip+'"操作同步至下级工单?','确认信息', {
 | 
			
		||||
          type: 'warning',
 | 
			
		||||
          distinguishCancelAndClose: true,
 | 
			
		||||
          confirmButtonText: '同步',
 | 
			
		||||
          cancelButtonText: '不同步'
 | 
			
		||||
        }).then(function() {
 | 
			
		||||
          console.log('同步')
 | 
			
		||||
          orderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
 | 
			
		||||
            _this.getList();
 | 
			
		||||
            _this.$modal.msgSuccess("操作成功");
 | 
			
		||||
          })
 | 
			
		||||
        }).catch(action => {
 | 
			
		||||
          if (action === 'cancel') {
 | 
			
		||||
            console.log('不同步')
 | 
			
		||||
            orderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
 | 
			
		||||
              _this.getList();
 | 
			
		||||
              _this.$modal.msgSuccess("操作成功");
 | 
			
		||||
            })
 | 
			
		||||
          }else {
 | 
			
		||||
            return console.log('关闭')
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      }else{// 无下级工单
 | 
			
		||||
        _this.$modal.confirm('是否确认"'+tip+'"厂务订单名称为"' + val.name + '"的数据项?').then(function() {
 | 
			
		||||
          return orderStatusSet({ id: val.id, status: status})
 | 
			
		||||
        }).then(() => {
 | 
			
		||||
          _this.getList();
 | 
			
		||||
          _this.$modal.msgSuccess("操作成功");
 | 
			
		||||
        }).catch(() => {});
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 新增
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.orderAdd.formClear()
 | 
			
		||||
      this.centervisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.orderAdd.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    },
 | 
			
		||||
    // 下发新增
 | 
			
		||||
    addWorkOrderCancel() {
 | 
			
		||||
      this.$refs.addWorkOrder.formClear()
 | 
			
		||||
      this.addWorkOrdervisible = false
 | 
			
		||||
    },
 | 
			
		||||
    addWorkOrderConfirm() {
 | 
			
		||||
      this.$refs.addWorkOrder.addWorkOrderSubmit()
 | 
			
		||||
    },
 | 
			
		||||
    addWorkOrderSubmit() {
 | 
			
		||||
      this.addWorkOrderCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    }
 | 
			
		||||
    // bindWorkOrderCancel() {
 | 
			
		||||
    //   this.$refs.bindWorkOrder.formClear()
 | 
			
		||||
    //   this.bindWorkOrdervisible = false
 | 
			
		||||
    // },
 | 
			
		||||
    // bindWorkOrderConfirm() {
 | 
			
		||||
    //   this.$refs.bindWorkOrder.bindWorkOrderSubmit()
 | 
			
		||||
    // },
 | 
			
		||||
    // bindWorkOrderSubmit() {
 | 
			
		||||
    //   this.bindWorkOrderCancel()
 | 
			
		||||
    //   this.getList()
 | 
			
		||||
    // }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	name: 'OrderManage',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '订单名称',
 | 
			
		||||
					placeholder: '订单名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '状态',
 | 
			
		||||
					selectOptions: this.getDictDatas(this.DICT_TYPE.ORDER_STATUS),
 | 
			
		||||
					labelField: 'label',
 | 
			
		||||
					valueField: 'value',
 | 
			
		||||
					param: 'status',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间段',
 | 
			
		||||
					dateType: 'daterange',
 | 
			
		||||
					format: 'yyyy-MM-dd',
 | 
			
		||||
					valueFormat: 'yyyy-MM-dd',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'timeVal',
 | 
			
		||||
					defaultSelect: [],
 | 
			
		||||
					width: 250,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:order-manage:create')
 | 
			
		||||
						? 'separate'
 | 
			
		||||
						: '',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				name: null,
 | 
			
		||||
				status: null,
 | 
			
		||||
				lastIssuedTime: [],
 | 
			
		||||
			},
 | 
			
		||||
			total: 0,
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:order-manage:addWorkOrder')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'add',
 | 
			
		||||
							btnName: '新增',
 | 
			
		||||
							showTip: '新增工单',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'less',
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										value: 3,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-manage:bindWorkOrder')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'bind',
 | 
			
		||||
							btnName: '绑定',
 | 
			
		||||
							showTip: '绑定工单',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'less',
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										value: 3,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-manage:complete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'complete',
 | 
			
		||||
							btnName: '完成',
 | 
			
		||||
							showTip: '完成订单',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'equal',
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										value: 3,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-manage:termination')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'termination',
 | 
			
		||||
							btnName: '终止',
 | 
			
		||||
							showTip: '终止',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'equal',
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										value: 3,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-manage:cancel')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'cancel',
 | 
			
		||||
							btnName: '作废',
 | 
			
		||||
							showTip: '作废',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'less',
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										value: 2,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-manage:detail')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'detail',
 | 
			
		||||
							btnName: '详情',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:order-manage:edit')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
							showParam: {
 | 
			
		||||
								type: '&',
 | 
			
		||||
								data: [
 | 
			
		||||
									{
 | 
			
		||||
										type: 'less',
 | 
			
		||||
										name: 'status',
 | 
			
		||||
										value: 2,
 | 
			
		||||
									},
 | 
			
		||||
								],
 | 
			
		||||
							},
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			addOrEditTitle: '',
 | 
			
		||||
			centervisible: false,
 | 
			
		||||
			priorityList: this.getDictDatas(this.DICT_TYPE.ORDER_PRIORITY),
 | 
			
		||||
			workIssueTitle: '',
 | 
			
		||||
			addWorkOrdervisible: false,
 | 
			
		||||
			orderDetailVisible: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: { OrderAdd, AddWorkOrder },
 | 
			
		||||
	created() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getList() {
 | 
			
		||||
			getOrderPage({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				let arr = res.data.records || [];
 | 
			
		||||
				this.total = res.data.total || 0;
 | 
			
		||||
				if (arr.length > 0) {
 | 
			
		||||
					customerList().then((result) => {
 | 
			
		||||
						let tempData = result.data || [];
 | 
			
		||||
						if (tempData.length > 0) {
 | 
			
		||||
							arr.map((item) => {
 | 
			
		||||
								for (let i of tempData) {
 | 
			
		||||
									if (item.customerId === i.id) {
 | 
			
		||||
										item.customerId = i.name;
 | 
			
		||||
									}
 | 
			
		||||
								}
 | 
			
		||||
								item.price = item.price ? item.price.toFixed(2) : '0.00';
 | 
			
		||||
							});
 | 
			
		||||
							this.list = arr;
 | 
			
		||||
						}
 | 
			
		||||
					});
 | 
			
		||||
				} else {
 | 
			
		||||
					this.list = arr;
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			if (val.btnName === 'search') {
 | 
			
		||||
				this.queryParams.name = val.name;
 | 
			
		||||
				this.queryParams.status = val.status;
 | 
			
		||||
				if (val.timeVal && val.timeVal.length > 0) {
 | 
			
		||||
					this.queryParams.lastIssuedTime[0] = val.timeVal[0] + ' 00:00:00';
 | 
			
		||||
					this.queryParams.lastIssuedTime[1] = val.timeVal[1] + ' 23:59:59';
 | 
			
		||||
				} else {
 | 
			
		||||
					this.queryParams.lastIssuedTime = [];
 | 
			
		||||
				}
 | 
			
		||||
				this.getList();
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addOrEditTitle = '新增';
 | 
			
		||||
				this.centervisible = true;
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
					this.$refs.orderAdd.init();
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			switch (val.type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.addOrEditTitle = '编辑';
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.orderAdd.init(val.data.id);
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				case 'cancel':
 | 
			
		||||
					this.handleEditStatus(val.data, '作废', '6');
 | 
			
		||||
					break;
 | 
			
		||||
				case 'termination':
 | 
			
		||||
					this.handleEditStatus(val.data, '终止', '5');
 | 
			
		||||
					break;
 | 
			
		||||
				case 'detail':
 | 
			
		||||
					this.$router.push({
 | 
			
		||||
						path:
 | 
			
		||||
							'/order/base/order-manage/order-detail-data?orderId=' +
 | 
			
		||||
							val.data.id,
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				case 'add':
 | 
			
		||||
					this.workIssueTitle = '新增工单';
 | 
			
		||||
					this.addWorkOrdervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.addWorkOrder.init(val.data, 'add');
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				case 'bind':
 | 
			
		||||
					this.workIssueTitle = '绑定工单';
 | 
			
		||||
					this.addWorkOrdervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.addWorkOrder.init(val.data, 'bind');
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				case 'complete':
 | 
			
		||||
					this.handleEditStatus(val.data, '完成', '4');
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 完成,终止,作废
 | 
			
		||||
		handleEditStatus(val, tip, status) {
 | 
			
		||||
			let _this = this;
 | 
			
		||||
			if (val.workOrderNum > 0) {
 | 
			
		||||
				//有下级工单
 | 
			
		||||
				_this
 | 
			
		||||
					.$confirm('是否将"' + tip + '"操作同步至下级工单?', '确认信息', {
 | 
			
		||||
						type: 'warning',
 | 
			
		||||
						distinguishCancelAndClose: true,
 | 
			
		||||
						confirmButtonText: '同步',
 | 
			
		||||
						cancelButtonText: '不同步',
 | 
			
		||||
					})
 | 
			
		||||
					.then(function () {
 | 
			
		||||
						console.log('同步');
 | 
			
		||||
						orderStatusSet({ id: val.id, status: status, isSync: true }).then(
 | 
			
		||||
							() => {
 | 
			
		||||
								_this.getList();
 | 
			
		||||
								_this.$modal.msgSuccess('操作成功');
 | 
			
		||||
							}
 | 
			
		||||
						);
 | 
			
		||||
					})
 | 
			
		||||
					.catch((action) => {
 | 
			
		||||
						if (action === 'cancel') {
 | 
			
		||||
							console.log('不同步');
 | 
			
		||||
							orderStatusSet({
 | 
			
		||||
								id: val.id,
 | 
			
		||||
								status: status,
 | 
			
		||||
								isSync: false,
 | 
			
		||||
							}).then(() => {
 | 
			
		||||
								_this.getList();
 | 
			
		||||
								_this.$modal.msgSuccess('操作成功');
 | 
			
		||||
							});
 | 
			
		||||
						} else {
 | 
			
		||||
							return console.log('关闭');
 | 
			
		||||
						}
 | 
			
		||||
					});
 | 
			
		||||
			} else {
 | 
			
		||||
				// 无下级工单
 | 
			
		||||
				_this.$modal
 | 
			
		||||
					.confirm(
 | 
			
		||||
						'是否确认"' + tip + '"厂务订单名称为"' + val.name + '"的数据项?'
 | 
			
		||||
					)
 | 
			
		||||
					.then(function () {
 | 
			
		||||
						return orderStatusSet({ id: val.id, status: status });
 | 
			
		||||
					})
 | 
			
		||||
					.then(() => {
 | 
			
		||||
						_this.getList();
 | 
			
		||||
						_this.$modal.msgSuccess('操作成功');
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 新增
 | 
			
		||||
		handleCancel() {
 | 
			
		||||
			this.$refs.orderAdd.formClear();
 | 
			
		||||
			this.centervisible = false;
 | 
			
		||||
			this.addOrEditTitle = '';
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm() {
 | 
			
		||||
			this.$refs.orderAdd.submitForm();
 | 
			
		||||
		},
 | 
			
		||||
		successSubmit() {
 | 
			
		||||
			this.handleCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		// 下发新增
 | 
			
		||||
		addWorkOrderCancel() {
 | 
			
		||||
			this.$refs.addWorkOrder.formClear();
 | 
			
		||||
			this.addWorkOrdervisible = false;
 | 
			
		||||
		},
 | 
			
		||||
		addWorkOrderConfirm() {
 | 
			
		||||
			this.$refs.addWorkOrder.addWorkOrderSubmit();
 | 
			
		||||
		},
 | 
			
		||||
		addWorkOrderSubmit() {
 | 
			
		||||
			this.addWorkOrderCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
		// bindWorkOrderCancel() {
 | 
			
		||||
		//   this.$refs.bindWorkOrder.formClear()
 | 
			
		||||
		//   this.bindWorkOrdervisible = false
 | 
			
		||||
		// },
 | 
			
		||||
		// bindWorkOrderConfirm() {
 | 
			
		||||
		//   this.$refs.bindWorkOrder.bindWorkOrderSubmit()
 | 
			
		||||
		// },
 | 
			
		||||
		// bindWorkOrderSubmit() {
 | 
			
		||||
		//   this.bindWorkOrderCancel()
 | 
			
		||||
		//   this.getList()
 | 
			
		||||
		// }
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -56,6 +56,7 @@ import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import { orderGroupMonitor } from '@/api/base/orderGroup';
 | 
			
		||||
import MonitoringRingCharts from './../components/monitoringRingCharts';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
@@ -141,6 +142,7 @@ const tableProps = [
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
	name: 'OrderCompletionMonitoring',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
@@ -177,7 +179,6 @@ export default {
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			tableH: this.tableHeight(260),
 | 
			
		||||
			total: 0,
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:order-completion-monitoring:orderDet')
 | 
			
		||||
@@ -242,9 +243,6 @@ export default {
 | 
			
		||||
	},
 | 
			
		||||
	components: { MonitoringRingCharts },
 | 
			
		||||
	mounted() {
 | 
			
		||||
		window.addEventListener('resize', () => {
 | 
			
		||||
			this.tableH = this.tableHeight(260);
 | 
			
		||||
		});
 | 
			
		||||
		let start = moment().subtract(30, 'days').format('yyyy-MM-DD');
 | 
			
		||||
		let end = moment().format('yyyy-MM-DD');
 | 
			
		||||
		this.formConfig[1].defaultSelect = [start, end];
 | 
			
		||||
 
 | 
			
		||||
@@ -1,185 +1,188 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container vocHis">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
      :row-class-name="tableRowClassName"
 | 
			
		||||
    />
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container vocHis">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH"
 | 
			
		||||
			:row-class-name="tableRowClassName" />
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
 | 
			
		||||
import moment from 'moment'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import {
 | 
			
		||||
	environmentalCheckRecordPage,
 | 
			
		||||
	environmentalCheckRecordExport,
 | 
			
		||||
	environmentalCheckPage,
 | 
			
		||||
} from '@/api/safetyEnvironmental/environmental';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'checkName',
 | 
			
		||||
    label: '指标名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'checkValue',
 | 
			
		||||
    label: '检测数值'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位',
 | 
			
		||||
    filter: publicFormatter('environment_check_unit')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'checkTime',
 | 
			
		||||
    label: '检测时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'origin',
 | 
			
		||||
    label: '来源',
 | 
			
		||||
    filter: (val) => ['手动', '自动'][val]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'recordPerson',
 | 
			
		||||
    label: '录入人'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'recordTime',
 | 
			
		||||
    label: '录入时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'checkName',
 | 
			
		||||
		label: '指标名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'checkValue',
 | 
			
		||||
		label: '检测数值',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'unit',
 | 
			
		||||
		label: '单位',
 | 
			
		||||
		filter: publicFormatter('environment_check_unit'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'checkTime',
 | 
			
		||||
		label: '检测时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'origin',
 | 
			
		||||
		label: '来源',
 | 
			
		||||
		filter: (val) => ['手动', '自动'][val],
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'recordPerson',
 | 
			
		||||
		label: '录入人',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'recordTime',
 | 
			
		||||
		label: '录入时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'VocDetectionHistory',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '指标名称',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          param: 'checkId',
 | 
			
		||||
          filterable: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '时间',
 | 
			
		||||
          dateType: 'datetimerange',
 | 
			
		||||
          format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: "timestamp",
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          startPlaceholder: '开始时间',
 | 
			
		||||
          endPlaceholder: '结束时间',
 | 
			
		||||
          param: 'timeVal',
 | 
			
		||||
          defaultSelect: [],
 | 
			
		||||
          width: 350
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:voc:export') ? 'button' : '',
 | 
			
		||||
          btnName: '导出',
 | 
			
		||||
          name: 'export',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        checkId: null,
 | 
			
		||||
        checkType: 3,
 | 
			
		||||
        startTime: null,
 | 
			
		||||
        endTime: null
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableH: this.tableHeight(260)
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
 | 
			
		||||
    let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf()
 | 
			
		||||
    this.formConfig[1].defaultSelect = [start, end]
 | 
			
		||||
    this.queryParams.startTime = start
 | 
			
		||||
    this.queryParams.endTime = end
 | 
			
		||||
    this.getSelectList()
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      this.queryParams.pageNo = 1;
 | 
			
		||||
      this.queryParams.checkId = val.checkId
 | 
			
		||||
      this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
 | 
			
		||||
      this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.getList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$modal.confirm('是否确认导出').then(() => {
 | 
			
		||||
            return environmentalCheckRecordExport({...this.queryParams});
 | 
			
		||||
          }).then(response => {
 | 
			
		||||
            this.$download.excel(response, '废水检测历史记录.xls');
 | 
			
		||||
          }).catch(() => {})
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      environmentalCheckRecordPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    getSelectList() {
 | 
			
		||||
      environmentalCheckPage({
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 100,
 | 
			
		||||
        checkType: 3
 | 
			
		||||
      }).then(res => {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        this.formConfig[0].selectOptions = res.data.list || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    tableRowClassName({row, rowIndex}) {
 | 
			
		||||
      console.log(row)
 | 
			
		||||
      if (row.markRed) {
 | 
			
		||||
        return 'warning-row'
 | 
			
		||||
      }else {
 | 
			
		||||
        return ''
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	name: 'VocDetectionHistory',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '指标名称',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'checkId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间',
 | 
			
		||||
					dateType: 'datetimerange',
 | 
			
		||||
					format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					valueFormat: 'timestamp',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'timeVal',
 | 
			
		||||
					defaultSelect: [],
 | 
			
		||||
					width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:voc:export') ? 'separate' : '',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:voc:export') ? 'button' : '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				checkId: null,
 | 
			
		||||
				checkType: 3,
 | 
			
		||||
				startTime: null,
 | 
			
		||||
				endTime: null,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			total: 0,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
 | 
			
		||||
		let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf();
 | 
			
		||||
		this.formConfig[1].defaultSelect = [start, end];
 | 
			
		||||
		this.queryParams.startTime = start;
 | 
			
		||||
		this.queryParams.endTime = end;
 | 
			
		||||
		this.getSelectList();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.queryParams.checkId = val.checkId;
 | 
			
		||||
			this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
 | 
			
		||||
			this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
 | 
			
		||||
			if (val.btnName === 'search') {
 | 
			
		||||
				this.getList();
 | 
			
		||||
			} else {
 | 
			
		||||
				this.$modal
 | 
			
		||||
					.confirm('是否确认导出')
 | 
			
		||||
					.then(() => {
 | 
			
		||||
						return environmentalCheckRecordExport({ ...this.queryParams });
 | 
			
		||||
					})
 | 
			
		||||
					.then((response) => {
 | 
			
		||||
						this.$download.excel(response, '废水检测历史记录.xls');
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		getList() {
 | 
			
		||||
			environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				this.list = res.data.list || [];
 | 
			
		||||
				this.total = res.data.total || 0;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		getSelectList() {
 | 
			
		||||
			environmentalCheckPage({
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 100,
 | 
			
		||||
				checkType: 3,
 | 
			
		||||
			}).then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				this.formConfig[0].selectOptions = res.data.list || [];
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		tableRowClassName({ row, rowIndex }) {
 | 
			
		||||
			console.log(row);
 | 
			
		||||
			if (row.markRed) {
 | 
			
		||||
				return 'warning-row';
 | 
			
		||||
			} else {
 | 
			
		||||
				return '';
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss'>
 | 
			
		||||
.vocHis {
 | 
			
		||||
  .el-table .warning-row {
 | 
			
		||||
    background: #fee1e1;
 | 
			
		||||
  }
 | 
			
		||||
	.el-table .warning-row {
 | 
			
		||||
		background: #fee1e1;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -1,205 +1,210 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="80"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 新增&编辑 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
      :dialogTitle="addOrEditTitle"
 | 
			
		||||
      :dialogVisible="centervisible"
 | 
			
		||||
      @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm"
 | 
			
		||||
      :before-close="handleCancel"
 | 
			
		||||
      width='60%'
 | 
			
		||||
    >
 | 
			
		||||
      <voc-add ref="vocAdd" @successSubmit="successSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 新增&编辑 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="centervisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="60%">
 | 
			
		||||
			<voc-add
 | 
			
		||||
				ref="vocAdd"
 | 
			
		||||
				@successSubmit="successSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import VocAdd from './components/vocAdd'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import VocAdd from './components/vocAdd';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import {
 | 
			
		||||
	environmentalCheckPage,
 | 
			
		||||
	environmentalCheckDelete,
 | 
			
		||||
} from '@/api/safetyEnvironmental/environmental';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '指标名称',
 | 
			
		||||
    minWidth: 120,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '指标编码',
 | 
			
		||||
    minWidth: 120
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位',
 | 
			
		||||
    filter: publicFormatter('environment_check_unit')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'minValue',
 | 
			
		||||
    label: '最小值'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'maxValue',
 | 
			
		||||
    label: '最大值'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'creator',
 | 
			
		||||
    label: '创建人'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '创建时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '指标名称',
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '指标编码',
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'unit',
 | 
			
		||||
		label: '单位',
 | 
			
		||||
		filter: publicFormatter('environment_check_unit'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'minValue',
 | 
			
		||||
		label: '最小值',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'maxValue',
 | 
			
		||||
		label: '最大值',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'creator',
 | 
			
		||||
		label: '创建人',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '创建时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'VocDetectionIndication',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '指标名称',
 | 
			
		||||
          placeholder: '指标名称',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:voc:create') ? 'button' : '',
 | 
			
		||||
          btnName: '新增',
 | 
			
		||||
          name: 'add',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        checkType: 3,
 | 
			
		||||
        name: null
 | 
			
		||||
      },
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi('base:voc:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'edit',
 | 
			
		||||
              btnName: '编辑'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:voc:delete')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'delete',
 | 
			
		||||
              btnName: '删除'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v)=>v),
 | 
			
		||||
      addOrEditTitle: '',
 | 
			
		||||
      centervisible: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { VocAdd },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList() {
 | 
			
		||||
      environmentalCheckPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.queryParams.name = val.name
 | 
			
		||||
        this.getList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.addOrEditTitle = '新增'
 | 
			
		||||
        this.centervisible = true
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.vocAdd.init()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.vocAdd.init(val.data.id)
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
          this.handleDelete(val.data)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 删除
 | 
			
		||||
    handleDelete(val) {
 | 
			
		||||
      this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
 | 
			
		||||
        return environmentalCheckDelete({ id: val.id })
 | 
			
		||||
      }).then(() => {
 | 
			
		||||
        this.getList();
 | 
			
		||||
        this.$modal.msgSuccess("操作成功");
 | 
			
		||||
      }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    // 新增
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.vocAdd.formClear()
 | 
			
		||||
      this.centervisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.vocAdd.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	name: 'VocDetectionIndication',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '指标名称',
 | 
			
		||||
					placeholder: '指标名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:voc:create') ? 'separate' : '',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:voc:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				checkType: 3,
 | 
			
		||||
				name: null,
 | 
			
		||||
			},
 | 
			
		||||
			total: 0,
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:voc:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:voc:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			addOrEditTitle: '',
 | 
			
		||||
			centervisible: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: { VocAdd },
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getList() {
 | 
			
		||||
			environmentalCheckPage({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				this.list = res.data.list || [];
 | 
			
		||||
				this.total = res.data.total || 0;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			if (val.btnName === 'search') {
 | 
			
		||||
				this.queryParams.name = val.name;
 | 
			
		||||
				this.getList();
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addOrEditTitle = '新增';
 | 
			
		||||
				this.centervisible = true;
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
					this.$refs.vocAdd.init();
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			switch (val.type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.addOrEditTitle = '编辑';
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.vocAdd.init(val.data.id);
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.handleDelete(val.data);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 删除
 | 
			
		||||
		handleDelete(val) {
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除"' + val.name + '"的数据项?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return environmentalCheckDelete({ id: val.id });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('操作成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		// 新增
 | 
			
		||||
		handleCancel() {
 | 
			
		||||
			this.$refs.vocAdd.formClear();
 | 
			
		||||
			this.centervisible = false;
 | 
			
		||||
			this.addOrEditTitle = '';
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm() {
 | 
			
		||||
			this.$refs.vocAdd.submitForm();
 | 
			
		||||
		},
 | 
			
		||||
		successSubmit() {
 | 
			
		||||
			this.handleCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,185 +1,188 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container wasteGasHis">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
      :row-class-name="tableRowClassName"
 | 
			
		||||
    />
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container wasteGasHis">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH"
 | 
			
		||||
			:row-class-name="tableRowClassName" />
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
 | 
			
		||||
import moment from 'moment'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import {
 | 
			
		||||
	environmentalCheckRecordPage,
 | 
			
		||||
	environmentalCheckRecordExport,
 | 
			
		||||
	environmentalCheckPage,
 | 
			
		||||
} from '@/api/safetyEnvironmental/environmental';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'checkName',
 | 
			
		||||
    label: '指标名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'checkValue',
 | 
			
		||||
    label: '检测数值'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位',
 | 
			
		||||
    filter: publicFormatter('environment_check_unit')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'checkTime',
 | 
			
		||||
    label: '检测时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'origin',
 | 
			
		||||
    label: '来源',
 | 
			
		||||
    filter: (val) => ['手动', '自动'][val]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'recordPerson',
 | 
			
		||||
    label: '录入人'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'recordTime',
 | 
			
		||||
    label: '录入时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'checkName',
 | 
			
		||||
		label: '指标名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'checkValue',
 | 
			
		||||
		label: '检测数值',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'unit',
 | 
			
		||||
		label: '单位',
 | 
			
		||||
		filter: publicFormatter('environment_check_unit'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'checkTime',
 | 
			
		||||
		label: '检测时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'origin',
 | 
			
		||||
		label: '来源',
 | 
			
		||||
		filter: (val) => ['手动', '自动'][val],
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'recordPerson',
 | 
			
		||||
		label: '录入人',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'recordTime',
 | 
			
		||||
		label: '录入时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'WasteGasDetectionHistory',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '指标名称',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          param: 'checkId',
 | 
			
		||||
          filterable: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '时间',
 | 
			
		||||
          dateType: 'datetimerange',
 | 
			
		||||
          format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: "timestamp",
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          startPlaceholder: '开始时间',
 | 
			
		||||
          endPlaceholder: '结束时间',
 | 
			
		||||
          param: 'timeVal',
 | 
			
		||||
          defaultSelect: [],
 | 
			
		||||
          width: 350
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:waste-gas:export') ? 'button' : '',
 | 
			
		||||
          btnName: '导出',
 | 
			
		||||
          name: 'export',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        checkId: null,
 | 
			
		||||
        checkType: 2,
 | 
			
		||||
        startTime: null,
 | 
			
		||||
        endTime: null
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableH: this.tableHeight(260)
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
 | 
			
		||||
    let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf()
 | 
			
		||||
    this.formConfig[1].defaultSelect = [start, end]
 | 
			
		||||
    this.queryParams.startTime = start
 | 
			
		||||
    this.queryParams.endTime = end
 | 
			
		||||
    this.getSelectList()
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      this.queryParams.pageNo = 1;
 | 
			
		||||
      this.queryParams.checkId = val.checkId
 | 
			
		||||
      this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
 | 
			
		||||
      this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.getList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$modal.confirm('是否确认导出').then(() => {
 | 
			
		||||
            return environmentalCheckRecordExport({...this.queryParams});
 | 
			
		||||
          }).then(response => {
 | 
			
		||||
            this.$download.excel(response, '废气检测历史记录.xls');
 | 
			
		||||
          }).catch(() => {})
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      environmentalCheckRecordPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    getSelectList() {
 | 
			
		||||
      environmentalCheckPage({
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 100,
 | 
			
		||||
        checkType: 2
 | 
			
		||||
      }).then(res => {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        this.formConfig[0].selectOptions = res.data.list || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    tableRowClassName({row, rowIndex}) {
 | 
			
		||||
      console.log(row)
 | 
			
		||||
      if (row.markRed) {
 | 
			
		||||
        return 'warning-row'
 | 
			
		||||
      }else {
 | 
			
		||||
        return ''
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	name: 'WasteGasDetectionHistory',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '指标名称',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'checkId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '时间',
 | 
			
		||||
					dateType: 'datetimerange',
 | 
			
		||||
					format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					valueFormat: 'timestamp',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'timeVal',
 | 
			
		||||
					defaultSelect: [],
 | 
			
		||||
					width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:waste-gas:export') ? 'separate' : '',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:waste-gas:export') ? 'button' : '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				checkId: null,
 | 
			
		||||
				checkType: 2,
 | 
			
		||||
				startTime: null,
 | 
			
		||||
				endTime: null,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			total: 0,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
 | 
			
		||||
		let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf();
 | 
			
		||||
		this.formConfig[1].defaultSelect = [start, end];
 | 
			
		||||
		this.queryParams.startTime = start;
 | 
			
		||||
		this.queryParams.endTime = end;
 | 
			
		||||
		this.getSelectList();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.queryParams.checkId = val.checkId;
 | 
			
		||||
			this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
 | 
			
		||||
			this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
 | 
			
		||||
			if (val.btnName === 'search') {
 | 
			
		||||
				this.getList();
 | 
			
		||||
			} else {
 | 
			
		||||
				this.$modal
 | 
			
		||||
					.confirm('是否确认导出')
 | 
			
		||||
					.then(() => {
 | 
			
		||||
						return environmentalCheckRecordExport({ ...this.queryParams });
 | 
			
		||||
					})
 | 
			
		||||
					.then((response) => {
 | 
			
		||||
						this.$download.excel(response, '废气检测历史记录.xls');
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		getList() {
 | 
			
		||||
			environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				this.list = res.data.list || [];
 | 
			
		||||
				this.total = res.data.total || 0;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		getSelectList() {
 | 
			
		||||
			environmentalCheckPage({
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 100,
 | 
			
		||||
				checkType: 2,
 | 
			
		||||
			}).then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				this.formConfig[0].selectOptions = res.data.list || [];
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		tableRowClassName({ row, rowIndex }) {
 | 
			
		||||
			console.log(row);
 | 
			
		||||
			if (row.markRed) {
 | 
			
		||||
				return 'warning-row';
 | 
			
		||||
			} else {
 | 
			
		||||
				return '';
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss'>
 | 
			
		||||
.wasteGasHis {
 | 
			
		||||
  .el-table .warning-row {
 | 
			
		||||
    background: #fee1e1;
 | 
			
		||||
  }
 | 
			
		||||
	.el-table .warning-row {
 | 
			
		||||
		background: #fee1e1;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -1,205 +1,210 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="80"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 新增&编辑 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
      :dialogTitle="addOrEditTitle"
 | 
			
		||||
      :dialogVisible="centervisible"
 | 
			
		||||
      @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm"
 | 
			
		||||
      :before-close="handleCancel"
 | 
			
		||||
      width='60%'
 | 
			
		||||
    >
 | 
			
		||||
      <waste-gas-add ref="wasteGasAdd" @successSubmit="successSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 新增&编辑 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="centervisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="60%">
 | 
			
		||||
			<waste-gas-add
 | 
			
		||||
				ref="wasteGasAdd"
 | 
			
		||||
				@successSubmit="successSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import WasteGasAdd from './components/wasteGasAdd'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import WasteGasAdd from './components/wasteGasAdd';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import {
 | 
			
		||||
	environmentalCheckPage,
 | 
			
		||||
	environmentalCheckDelete,
 | 
			
		||||
} from '@/api/safetyEnvironmental/environmental';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '指标名称',
 | 
			
		||||
    minWidth: 120,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '指标编码',
 | 
			
		||||
    minWidth: 120
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位',
 | 
			
		||||
    filter: publicFormatter('environment_check_unit')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'minValue',
 | 
			
		||||
    label: '最小值'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'maxValue',
 | 
			
		||||
    label: '最大值'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'creator',
 | 
			
		||||
    label: '创建人'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '创建时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '指标名称',
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '指标编码',
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'unit',
 | 
			
		||||
		label: '单位',
 | 
			
		||||
		filter: publicFormatter('environment_check_unit'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'minValue',
 | 
			
		||||
		label: '最小值',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'maxValue',
 | 
			
		||||
		label: '最大值',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'creator',
 | 
			
		||||
		label: '创建人',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '创建时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'WasteGasDetectionIndication',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '指标名称',
 | 
			
		||||
          placeholder: '指标名称',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:waste-gas:create') ? 'button' : '',
 | 
			
		||||
          btnName: '新增',
 | 
			
		||||
          name: 'add',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        checkType: 2,
 | 
			
		||||
        name: null
 | 
			
		||||
      },
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi('base:waste-gas:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'edit',
 | 
			
		||||
              btnName: '编辑'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:waste-gas:delete')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'delete',
 | 
			
		||||
              btnName: '删除'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v)=>v),
 | 
			
		||||
      addOrEditTitle: '',
 | 
			
		||||
      centervisible: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { WasteGasAdd },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList() {
 | 
			
		||||
      environmentalCheckPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.queryParams.name = val.name
 | 
			
		||||
        this.getList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.addOrEditTitle = '新增'
 | 
			
		||||
        this.centervisible = true
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.wasteGasAdd.init()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.wasteGasAdd.init(val.data.id)
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
          this.handleDelete(val.data)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 删除
 | 
			
		||||
    handleDelete(val) {
 | 
			
		||||
      this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
 | 
			
		||||
        return environmentalCheckDelete({ id: val.id })
 | 
			
		||||
      }).then(() => {
 | 
			
		||||
        this.getList();
 | 
			
		||||
        this.$modal.msgSuccess("操作成功");
 | 
			
		||||
      }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    // 新增
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.wasteGasAdd.formClear()
 | 
			
		||||
      this.centervisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.wasteGasAdd.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	name: 'WasteGasDetectionIndication',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '指标名称',
 | 
			
		||||
					placeholder: '指标名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:waste-gas:create') ? 'separate' : '',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:waste-gas:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				checkType: 2,
 | 
			
		||||
				name: null,
 | 
			
		||||
			},
 | 
			
		||||
			total: 0,
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:waste-gas:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:waste-gas:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			addOrEditTitle: '',
 | 
			
		||||
			centervisible: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: { WasteGasAdd },
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getList() {
 | 
			
		||||
			environmentalCheckPage({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				this.list = res.data.list || [];
 | 
			
		||||
				this.total = res.data.total || 0;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			if (val.btnName === 'search') {
 | 
			
		||||
				this.queryParams.name = val.name;
 | 
			
		||||
				this.getList();
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addOrEditTitle = '新增';
 | 
			
		||||
				this.centervisible = true;
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
					this.$refs.wasteGasAdd.init();
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			switch (val.type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.addOrEditTitle = '编辑';
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.wasteGasAdd.init(val.data.id);
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.handleDelete(val.data);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 删除
 | 
			
		||||
		handleDelete(val) {
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除"' + val.name + '"的数据项?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return environmentalCheckDelete({ id: val.id });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('操作成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		// 新增
 | 
			
		||||
		handleCancel() {
 | 
			
		||||
			this.$refs.wasteGasAdd.formClear();
 | 
			
		||||
			this.centervisible = false;
 | 
			
		||||
			this.addOrEditTitle = '';
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm() {
 | 
			
		||||
			this.$refs.wasteGasAdd.submitForm();
 | 
			
		||||
		},
 | 
			
		||||
		successSubmit() {
 | 
			
		||||
			this.handleCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
@@ -1,185 +1,190 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container wasteWaterHis">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
      :row-class-name="tableRowClassName"
 | 
			
		||||
    />
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container wasteWaterHis">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH"
 | 
			
		||||
			:row-class-name="tableRowClassName" />
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import { environmentalCheckRecordPage, environmentalCheckRecordExport, environmentalCheckPage } from '@/api/safetyEnvironmental/environmental'
 | 
			
		||||
import moment from 'moment'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import {
 | 
			
		||||
	environmentalCheckRecordPage,
 | 
			
		||||
	environmentalCheckRecordExport,
 | 
			
		||||
	environmentalCheckPage,
 | 
			
		||||
} from '@/api/safetyEnvironmental/environmental';
 | 
			
		||||
import moment from 'moment';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'checkName',
 | 
			
		||||
    label: '指标名称'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'checkValue',
 | 
			
		||||
    label: '检测数值'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位',
 | 
			
		||||
    filter: publicFormatter('environment_check_unit')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'checkTime',
 | 
			
		||||
    label: '检测时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'origin',
 | 
			
		||||
    label: '来源',
 | 
			
		||||
    filter: (val) => ['手动', '自动'][val]
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'recordPerson',
 | 
			
		||||
    label: '录入人'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'recordTime',
 | 
			
		||||
    label: '录入时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'checkName',
 | 
			
		||||
		label: '指标名称',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'checkValue',
 | 
			
		||||
		label: '检测数值',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'unit',
 | 
			
		||||
		label: '单位',
 | 
			
		||||
		filter: publicFormatter('environment_check_unit'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'checkTime',
 | 
			
		||||
		label: '检测时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'origin',
 | 
			
		||||
		label: '来源',
 | 
			
		||||
		filter: (val) => ['手动', '自动'][val],
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'recordPerson',
 | 
			
		||||
		label: '录入人',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'recordTime',
 | 
			
		||||
		label: '录入时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'WasteWaterDetectionHistory',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'select',
 | 
			
		||||
          label: '指标名称',
 | 
			
		||||
          selectOptions: [],
 | 
			
		||||
          param: 'checkId',
 | 
			
		||||
          filterable: true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'datePicker',
 | 
			
		||||
          label: '检测时间',
 | 
			
		||||
          dateType: 'datetimerange',
 | 
			
		||||
          format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
          valueFormat: "timestamp",
 | 
			
		||||
          rangeSeparator: '-',
 | 
			
		||||
          startPlaceholder: '开始时间',
 | 
			
		||||
          endPlaceholder: '结束时间',
 | 
			
		||||
          param: 'timeVal',
 | 
			
		||||
          defaultSelect: [],
 | 
			
		||||
          width: 350
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:waste-water:export') ? 'separate' : '',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '',
 | 
			
		||||
          btnName: '导出',
 | 
			
		||||
          name: 'export',
 | 
			
		||||
          color: 'primary',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        checkId: null,
 | 
			
		||||
        checkType: 1,
 | 
			
		||||
        startTime: null,
 | 
			
		||||
        endTime: null
 | 
			
		||||
      },
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableH: this.tableHeight(260)
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  created() {
 | 
			
		||||
    window.addEventListener('resize', () => {
 | 
			
		||||
      this.tableH = this.tableHeight(260)
 | 
			
		||||
    })
 | 
			
		||||
    let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf()
 | 
			
		||||
    let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf()
 | 
			
		||||
    this.formConfig[1].defaultSelect = [start, end]
 | 
			
		||||
    this.queryParams.startTime = start
 | 
			
		||||
    this.queryParams.endTime = end
 | 
			
		||||
    this.getSelectList()
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      this.queryParams.pageNo = 1;
 | 
			
		||||
      this.queryParams.checkId = val.checkId
 | 
			
		||||
      this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null
 | 
			
		||||
      this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.getList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$modal.confirm('是否确认导出').then(() => {
 | 
			
		||||
            return environmentalCheckRecordExport({...this.queryParams});
 | 
			
		||||
          }).then(response => {
 | 
			
		||||
            this.$download.excel(response, '废水检测历史记录.xls');
 | 
			
		||||
          }).catch(() => {})
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    getList() {
 | 
			
		||||
      environmentalCheckRecordPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    getSelectList() {
 | 
			
		||||
      environmentalCheckPage({
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 100,
 | 
			
		||||
        checkType: 1
 | 
			
		||||
      }).then(res => {
 | 
			
		||||
        console.log(res)
 | 
			
		||||
        this.formConfig[0].selectOptions = res.data.list || []
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    tableRowClassName({row, rowIndex}) {
 | 
			
		||||
      console.log(row)
 | 
			
		||||
      if (row.markRed) {
 | 
			
		||||
        return 'warning-row'
 | 
			
		||||
      }else {
 | 
			
		||||
        return ''
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	name: 'WasteWaterDetectionHistory',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'select',
 | 
			
		||||
					label: '指标名称',
 | 
			
		||||
					selectOptions: [],
 | 
			
		||||
					param: 'checkId',
 | 
			
		||||
					filterable: true,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'datePicker',
 | 
			
		||||
					label: '检测时间',
 | 
			
		||||
					dateType: 'datetimerange',
 | 
			
		||||
					format: 'yyyy-MM-dd HH:mm:ss',
 | 
			
		||||
					valueFormat: 'timestamp',
 | 
			
		||||
					rangeSeparator: '-',
 | 
			
		||||
					startPlaceholder: '开始时间',
 | 
			
		||||
					endPlaceholder: '结束时间',
 | 
			
		||||
					param: 'timeVal',
 | 
			
		||||
					defaultSelect: [],
 | 
			
		||||
					width: 350,
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:waste-water:export')
 | 
			
		||||
						? 'separate'
 | 
			
		||||
						: '',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:waste-water:export') ? 'button' : '',
 | 
			
		||||
					btnName: '导出',
 | 
			
		||||
					name: 'export',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				checkId: null,
 | 
			
		||||
				checkType: 1,
 | 
			
		||||
				startTime: null,
 | 
			
		||||
				endTime: null,
 | 
			
		||||
			},
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			total: 0,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	created() {
 | 
			
		||||
		let end = moment(moment().format('YYYY-MM-DD 23:59:59')).valueOf();
 | 
			
		||||
		let start = moment(moment().format('YYYY-MM-DD 00:00:00')).valueOf();
 | 
			
		||||
		this.formConfig[1].defaultSelect = [start, end];
 | 
			
		||||
		this.queryParams.startTime = start;
 | 
			
		||||
		this.queryParams.endTime = end;
 | 
			
		||||
		this.getSelectList();
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			this.queryParams.pageNo = 1;
 | 
			
		||||
			this.queryParams.checkId = val.checkId;
 | 
			
		||||
			this.queryParams.startTime = val.timeVal ? val.timeVal[0] : null;
 | 
			
		||||
			this.queryParams.endTime = val.timeVal ? val.timeVal[1] : null;
 | 
			
		||||
			if (val.btnName === 'search') {
 | 
			
		||||
				this.getList();
 | 
			
		||||
			} else {
 | 
			
		||||
				this.$modal
 | 
			
		||||
					.confirm('是否确认导出')
 | 
			
		||||
					.then(() => {
 | 
			
		||||
						return environmentalCheckRecordExport({ ...this.queryParams });
 | 
			
		||||
					})
 | 
			
		||||
					.then((response) => {
 | 
			
		||||
						this.$download.excel(response, '废水检测历史记录.xls');
 | 
			
		||||
					})
 | 
			
		||||
					.catch(() => {});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		getList() {
 | 
			
		||||
			environmentalCheckRecordPage({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				this.list = res.data.list || [];
 | 
			
		||||
				this.total = res.data.total || 0;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		getSelectList() {
 | 
			
		||||
			environmentalCheckPage({
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 100,
 | 
			
		||||
				checkType: 1,
 | 
			
		||||
			}).then((res) => {
 | 
			
		||||
				console.log(res);
 | 
			
		||||
				this.formConfig[0].selectOptions = res.data.list || [];
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		tableRowClassName({ row, rowIndex }) {
 | 
			
		||||
			console.log(row);
 | 
			
		||||
			if (row.markRed) {
 | 
			
		||||
				return 'warning-row';
 | 
			
		||||
			} else {
 | 
			
		||||
				return '';
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style lang='scss'>
 | 
			
		||||
.wasteWaterHis {
 | 
			
		||||
  .el-table .warning-row {
 | 
			
		||||
    background: #fee1e1;
 | 
			
		||||
  }
 | 
			
		||||
	.el-table .warning-row {
 | 
			
		||||
		background: #fee1e1;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@@ -1,205 +1,212 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="app-container">
 | 
			
		||||
    <!-- 搜索工作栏 -->
 | 
			
		||||
    <search-bar
 | 
			
		||||
      :formConfigs="formConfig"
 | 
			
		||||
      ref="searchBarForm"
 | 
			
		||||
      @headBtnClick="buttonClick"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 列表 -->
 | 
			
		||||
    <base-table
 | 
			
		||||
      :page="queryParams.pageNo"
 | 
			
		||||
      :limit="queryParams.pageSize"
 | 
			
		||||
      :table-props="tableProps"
 | 
			
		||||
      :table-data="list"
 | 
			
		||||
      :max-height="tableH"
 | 
			
		||||
    >
 | 
			
		||||
      <method-btn
 | 
			
		||||
        v-if="tableBtn.length"
 | 
			
		||||
        slot="handleBtn"
 | 
			
		||||
        :width="80"
 | 
			
		||||
        label="操作"
 | 
			
		||||
        :method-list="tableBtn"
 | 
			
		||||
        @clickBtn="handleClick"
 | 
			
		||||
      />
 | 
			
		||||
    </base-table>
 | 
			
		||||
    <pagination
 | 
			
		||||
      :page.sync="queryParams.pageNo"
 | 
			
		||||
      :limit.sync="queryParams.pageSize"
 | 
			
		||||
      :total="total"
 | 
			
		||||
      @pagination="getList"
 | 
			
		||||
    />
 | 
			
		||||
    <!-- 新增&编辑 -->
 | 
			
		||||
    <base-dialog
 | 
			
		||||
      :dialogTitle="addOrEditTitle"
 | 
			
		||||
      :dialogVisible="centervisible"
 | 
			
		||||
      @cancel="handleCancel"
 | 
			
		||||
      @confirm="handleConfirm"
 | 
			
		||||
      :before-close="handleCancel"
 | 
			
		||||
      width='60%'
 | 
			
		||||
    >
 | 
			
		||||
      <waste-water-add ref="wasteWaterAdd" @successSubmit="successSubmit" />
 | 
			
		||||
    </base-dialog>
 | 
			
		||||
  </div>
 | 
			
		||||
	<div class="app-container">
 | 
			
		||||
		<!-- 搜索工作栏 -->
 | 
			
		||||
		<search-bar
 | 
			
		||||
			:formConfigs="formConfig"
 | 
			
		||||
			ref="searchBarForm"
 | 
			
		||||
			@headBtnClick="buttonClick" />
 | 
			
		||||
		<!-- 列表 -->
 | 
			
		||||
		<base-table
 | 
			
		||||
			:page="queryParams.pageNo"
 | 
			
		||||
			:limit="queryParams.pageSize"
 | 
			
		||||
			:table-props="tableProps"
 | 
			
		||||
			:table-data="list"
 | 
			
		||||
			:max-height="tableH">
 | 
			
		||||
			<method-btn
 | 
			
		||||
				v-if="tableBtn.length"
 | 
			
		||||
				slot="handleBtn"
 | 
			
		||||
				:width="80"
 | 
			
		||||
				label="操作"
 | 
			
		||||
				:method-list="tableBtn"
 | 
			
		||||
				@clickBtn="handleClick" />
 | 
			
		||||
		</base-table>
 | 
			
		||||
		<pagination
 | 
			
		||||
			:page.sync="queryParams.pageNo"
 | 
			
		||||
			:limit.sync="queryParams.pageSize"
 | 
			
		||||
			:total="total"
 | 
			
		||||
			@pagination="getList" />
 | 
			
		||||
		<!-- 新增&编辑 -->
 | 
			
		||||
		<base-dialog
 | 
			
		||||
			:dialogTitle="addOrEditTitle"
 | 
			
		||||
			:dialogVisible="centervisible"
 | 
			
		||||
			@cancel="handleCancel"
 | 
			
		||||
			@confirm="handleConfirm"
 | 
			
		||||
			:before-close="handleCancel"
 | 
			
		||||
			width="60%">
 | 
			
		||||
			<waste-water-add
 | 
			
		||||
				ref="wasteWaterAdd"
 | 
			
		||||
				@successSubmit="successSubmit" />
 | 
			
		||||
		</base-dialog>
 | 
			
		||||
	</div>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi'
 | 
			
		||||
import WasteWaterAdd from './components/wasteWaterAdd'
 | 
			
		||||
import { publicFormatter } from '@/utils/dict'
 | 
			
		||||
import { environmentalCheckPage, environmentalCheckDelete } from '@/api/safetyEnvironmental/environmental'
 | 
			
		||||
import { parseTime } from '@/utils/ruoyi';
 | 
			
		||||
import WasteWaterAdd from './components/wasteWaterAdd';
 | 
			
		||||
import { publicFormatter } from '@/utils/dict';
 | 
			
		||||
import {
 | 
			
		||||
	environmentalCheckPage,
 | 
			
		||||
	environmentalCheckDelete,
 | 
			
		||||
} from '@/api/safetyEnvironmental/environmental';
 | 
			
		||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
 | 
			
		||||
const tableProps = [
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'name',
 | 
			
		||||
    label: '指标名称',
 | 
			
		||||
    minWidth: 120,
 | 
			
		||||
    showOverflowtooltip: true
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'code',
 | 
			
		||||
    label: '指标编码',
 | 
			
		||||
    minWidth: 120
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'unit',
 | 
			
		||||
    label: '单位',
 | 
			
		||||
    filter: publicFormatter('environment_check_unit')
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'minValue',
 | 
			
		||||
    label: '最小值'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'maxValue',
 | 
			
		||||
    label: '最大值'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'creator',
 | 
			
		||||
    label: '创建人'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    prop: 'createTime',
 | 
			
		||||
    label: '创建时间',
 | 
			
		||||
    filter: parseTime,
 | 
			
		||||
    minWidth: 160
 | 
			
		||||
  }
 | 
			
		||||
]
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'name',
 | 
			
		||||
		label: '指标名称',
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
		showOverflowtooltip: true,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'code',
 | 
			
		||||
		label: '指标编码',
 | 
			
		||||
		minWidth: 120,
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'unit',
 | 
			
		||||
		label: '单位',
 | 
			
		||||
		filter: publicFormatter('environment_check_unit'),
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'minValue',
 | 
			
		||||
		label: '最小值',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'maxValue',
 | 
			
		||||
		label: '最大值',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'creator',
 | 
			
		||||
		label: '创建人',
 | 
			
		||||
	},
 | 
			
		||||
	{
 | 
			
		||||
		prop: 'createTime',
 | 
			
		||||
		label: '创建时间',
 | 
			
		||||
		filter: parseTime,
 | 
			
		||||
		minWidth: 160,
 | 
			
		||||
	},
 | 
			
		||||
];
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'WasteWaterDetectionIndication',
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      formConfig: [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'input',
 | 
			
		||||
          label: '指标名称',
 | 
			
		||||
          placeholder: '指标名称',
 | 
			
		||||
          param: 'name'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: 'button',
 | 
			
		||||
          btnName: '查询',
 | 
			
		||||
          name: 'search',
 | 
			
		||||
          color: 'primary'
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:waste-water:create') ? 'separate' : '',
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '',
 | 
			
		||||
          btnName: '新增',
 | 
			
		||||
          name: 'add',
 | 
			
		||||
          color: 'success',
 | 
			
		||||
          plain: true
 | 
			
		||||
        }
 | 
			
		||||
      ],
 | 
			
		||||
      // 查询参数
 | 
			
		||||
      queryParams: {
 | 
			
		||||
        pageNo: 1,
 | 
			
		||||
        pageSize: 20,
 | 
			
		||||
        checkType: 1,
 | 
			
		||||
        name: null
 | 
			
		||||
      },
 | 
			
		||||
      total: 0,
 | 
			
		||||
      tableProps,
 | 
			
		||||
      list: [],
 | 
			
		||||
      tableH: this.tableHeight(260),
 | 
			
		||||
      tableBtn: [
 | 
			
		||||
        this.$auth.hasPermi('base:waste-water:update')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'edit',
 | 
			
		||||
              btnName: '编辑'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined,
 | 
			
		||||
        this.$auth.hasPermi('base:waste-water:delete')
 | 
			
		||||
          ? {
 | 
			
		||||
              type: 'delete',
 | 
			
		||||
              btnName: '删除'
 | 
			
		||||
            }
 | 
			
		||||
          : undefined
 | 
			
		||||
      ].filter((v)=>v),
 | 
			
		||||
      addOrEditTitle: '',
 | 
			
		||||
      centervisible: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  components: { WasteWaterAdd },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.getList()
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getList() {
 | 
			
		||||
      environmentalCheckPage({...this.queryParams}).then(res => {
 | 
			
		||||
        this.list = res.data.list || []
 | 
			
		||||
        this.total = res.data.total || 0
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    buttonClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      if (val.btnName === 'search') {
 | 
			
		||||
        this.queryParams.name = val.name
 | 
			
		||||
        this.getList()
 | 
			
		||||
      } else {
 | 
			
		||||
        this.addOrEditTitle = '新增'
 | 
			
		||||
        this.centervisible = true
 | 
			
		||||
        this.$nextTick(() => {
 | 
			
		||||
          this.$refs.wasteWaterAdd.init()
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    handleClick(val) {
 | 
			
		||||
      console.log(val)
 | 
			
		||||
      switch (val.type) {
 | 
			
		||||
        case 'edit':
 | 
			
		||||
          this.addOrEditTitle = '编辑'
 | 
			
		||||
          this.centervisible = true
 | 
			
		||||
          this.$nextTick(() => {
 | 
			
		||||
            this.$refs.wasteWaterAdd.init(val.data.id)
 | 
			
		||||
          })
 | 
			
		||||
          break
 | 
			
		||||
        default:
 | 
			
		||||
          this.handleDelete(val.data)
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    // 删除
 | 
			
		||||
    handleDelete(val) {
 | 
			
		||||
      this.$modal.confirm('是否确认删除"' + val.name + '"的数据项?').then(function() {
 | 
			
		||||
        return environmentalCheckDelete({ id: val.id })
 | 
			
		||||
      }).then(() => {
 | 
			
		||||
        this.getList();
 | 
			
		||||
        this.$modal.msgSuccess("操作成功");
 | 
			
		||||
      }).catch(() => {});
 | 
			
		||||
    },
 | 
			
		||||
    // 新增
 | 
			
		||||
    handleCancel() {
 | 
			
		||||
      this.$refs.wasteWaterAdd.formClear()
 | 
			
		||||
      this.centervisible = false
 | 
			
		||||
      this.addOrEditTitle = ''
 | 
			
		||||
    },
 | 
			
		||||
    handleConfirm() {
 | 
			
		||||
      this.$refs.wasteWaterAdd.submitForm()
 | 
			
		||||
    },
 | 
			
		||||
    successSubmit() {
 | 
			
		||||
      this.handleCancel()
 | 
			
		||||
      this.getList()
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
	name: 'WasteWaterDetectionIndication',
 | 
			
		||||
	mixins: [tableHeightMixin],
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			formConfig: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'input',
 | 
			
		||||
					label: '指标名称',
 | 
			
		||||
					placeholder: '指标名称',
 | 
			
		||||
					param: 'name',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'button',
 | 
			
		||||
					btnName: '查询',
 | 
			
		||||
					name: 'search',
 | 
			
		||||
					color: 'primary',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:waste-water:create')
 | 
			
		||||
						? 'separate'
 | 
			
		||||
						: '',
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: this.$auth.hasPermi('base:waste-water:create') ? 'button' : '',
 | 
			
		||||
					btnName: '新增',
 | 
			
		||||
					name: 'add',
 | 
			
		||||
					color: 'success',
 | 
			
		||||
					plain: true,
 | 
			
		||||
				},
 | 
			
		||||
			],
 | 
			
		||||
			// 查询参数
 | 
			
		||||
			queryParams: {
 | 
			
		||||
				pageNo: 1,
 | 
			
		||||
				pageSize: 20,
 | 
			
		||||
				checkType: 1,
 | 
			
		||||
				name: null,
 | 
			
		||||
			},
 | 
			
		||||
			total: 0,
 | 
			
		||||
			tableProps,
 | 
			
		||||
			list: [],
 | 
			
		||||
			tableBtn: [
 | 
			
		||||
				this.$auth.hasPermi('base:waste-water:update')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'edit',
 | 
			
		||||
							btnName: '编辑',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
				this.$auth.hasPermi('base:waste-water:delete')
 | 
			
		||||
					? {
 | 
			
		||||
							type: 'delete',
 | 
			
		||||
							btnName: '删除',
 | 
			
		||||
					  }
 | 
			
		||||
					: undefined,
 | 
			
		||||
			].filter((v) => v),
 | 
			
		||||
			addOrEditTitle: '',
 | 
			
		||||
			centervisible: false,
 | 
			
		||||
		};
 | 
			
		||||
	},
 | 
			
		||||
	components: { WasteWaterAdd },
 | 
			
		||||
	mounted() {
 | 
			
		||||
		this.getList();
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getList() {
 | 
			
		||||
			environmentalCheckPage({ ...this.queryParams }).then((res) => {
 | 
			
		||||
				this.list = res.data.list || [];
 | 
			
		||||
				this.total = res.data.total || 0;
 | 
			
		||||
			});
 | 
			
		||||
		},
 | 
			
		||||
		buttonClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			if (val.btnName === 'search') {
 | 
			
		||||
				this.queryParams.name = val.name;
 | 
			
		||||
				this.getList();
 | 
			
		||||
			} else {
 | 
			
		||||
				this.addOrEditTitle = '新增';
 | 
			
		||||
				this.centervisible = true;
 | 
			
		||||
				this.$nextTick(() => {
 | 
			
		||||
					this.$refs.wasteWaterAdd.init();
 | 
			
		||||
				});
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		handleClick(val) {
 | 
			
		||||
			console.log(val);
 | 
			
		||||
			switch (val.type) {
 | 
			
		||||
				case 'edit':
 | 
			
		||||
					this.addOrEditTitle = '编辑';
 | 
			
		||||
					this.centervisible = true;
 | 
			
		||||
					this.$nextTick(() => {
 | 
			
		||||
						this.$refs.wasteWaterAdd.init(val.data.id);
 | 
			
		||||
					});
 | 
			
		||||
					break;
 | 
			
		||||
				default:
 | 
			
		||||
					this.handleDelete(val.data);
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		// 删除
 | 
			
		||||
		handleDelete(val) {
 | 
			
		||||
			this.$modal
 | 
			
		||||
				.confirm('是否确认删除"' + val.name + '"的数据项?')
 | 
			
		||||
				.then(function () {
 | 
			
		||||
					return environmentalCheckDelete({ id: val.id });
 | 
			
		||||
				})
 | 
			
		||||
				.then(() => {
 | 
			
		||||
					this.getList();
 | 
			
		||||
					this.$modal.msgSuccess('操作成功');
 | 
			
		||||
				})
 | 
			
		||||
				.catch(() => {});
 | 
			
		||||
		},
 | 
			
		||||
		// 新增
 | 
			
		||||
		handleCancel() {
 | 
			
		||||
			this.$refs.wasteWaterAdd.formClear();
 | 
			
		||||
			this.centervisible = false;
 | 
			
		||||
			this.addOrEditTitle = '';
 | 
			
		||||
		},
 | 
			
		||||
		handleConfirm() {
 | 
			
		||||
			this.$refs.wasteWaterAdd.submitForm();
 | 
			
		||||
		},
 | 
			
		||||
		successSubmit() {
 | 
			
		||||
			this.handleCancel();
 | 
			
		||||
			this.getList();
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
		Reference in New Issue
	
	Block a user