| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <template>
- <div>
- <!-- 查询区域 -->
- <div class="table-page-search-wrapper">
- <!-- 操作按钮区域 -->
- <a-form layout="inline" @keyup.enter.native="searchQuery">
- <a-form-item>
- <a-tree-select
- v-model="queryParam.deptId"
- style="width: 150px"
- :show-search="true"
- allow-clear
- placeholder="选择车间"
- :tree-data="treeData"
- tree-node-filter-prop="label"
- :replace-fields="{children:'children', title:'label', key:'id', value: 'id' }"
- />
- </a-form-item>
- <a-form-item>
- <a-select
- v-model="queryParam.labId"
- placeholder="选择实验室"
- style="width:150px"
- >
- <a-select-option value="">
- 请选择
- </a-select-option>
- <a-select-option
- v-for="(item,index) in dictOptions"
- :key="index"
- :value="item.deptId"
- >
- <span style="display: inline-block;width: 100%" :title=" item.deptName ">
- {{ item.deptName }}
- </span>
- </a-select-option>
- </a-select>
- </a-form-item>
- <a-form-item>
- <a-date-picker
- v-model="queryParam.endTime"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- placeholder="选择实验截止日期"
- />
- </a-form-item>
- <a-form-item>
- <a-button type="primary" @click="searchQuery">查询</a-button>
- <a-button style="margin-left: 8px" @click="searchReset">重置</a-button>
- </a-form-item>
- </a-form>
- </div>
- <!-- table区域-begin -->
- <div style="margin-top: 10px">
- <a-table
- ref="table"
- size="middle"
- bordered
- row-key="id"
- :columns="columns"
- :data-source="dataSource"
- :pagination="ipagination"
- :loading="loading"
- @change="handleTableChange"
- >
- <span slot="action" slot-scope="text, record">
- <a-button size="small" type="link" @click="handleEdit(record)">
- 完成实验
- </a-button>
- </span>
- </a-table>
- </div>
- <!-- table区域-end -->
- <!-- 表单区域 -->
- <dy-list ref="modalForm" />
- </div>
- </template>
- <script>
- import { listMixin } from '@/mixin/listMixin'
- import columns from './indexColumns'
- import { getAction, httpAction } from '@/api/request'
- import dyList from './dyList'
- export default {
- components: { dyList },
- mixins: [listMixin],
- data() {
- return {
- // 查询条件
- queryParam: { state: 0 },
- treeData: [],
- dictOptions: [],
- // 表头
- columns: columns(this),
- url: {
- list: '/business/safetool/sec/experiment/list',
- tree: '/system/dept/treeSelect',
- sysListL: '/system/dept/listLab'
- }
- }
- },
- created() {
- this.loadTree()
- this.getSysList()
- },
- methods: {
- handleEdit: function(record) {
- httpAction('/business/safetool/sec/experiment/expEnd', record, 'post').then((res) => {
- if (res.code === 200) {
- this.$refs.modalForm.edit(record)
- this.$refs.modalForm.title = '编辑'
- this.$refs.modalForm.disableSubmit = false
- this.$message.success(res.msg)
- } else {
- this.$message.error(res.msg)
- console.log(res)
- }
- })
- },
- loadTree() {
- this.treeData = []
- getAction(this.url.tree).then((res) => {
- if (res.code === 200) {
- this.treeData = res.data
- }
- })
- },
- getSysList() {
- getAction(this.url.sysListL).then((res) => {
- if (res.code === 200) {
- this.dictOptions = res.data
- }
- })
- }
- }
- }
- </script>
- <style scoped>
- @import '~@/assets/less/common.less'
- </style>
|