| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <template>
- <div>
- <j-modal
- :title="title"
- width="70%"
- :visible="visible"
- :mask-closable="false"
- cancel-text="关闭"
- @close="close"
- >
- <!-- 操作按钮区域 -->
- <div class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="searchQuery">
- <a-form-item>
- <j-dict-select-tag
- v-model="queryParam.toolType"
- style="width: 150px"
- placeholder="选择工具名称"
- dict-code="tool_type"
- />
- </a-form-item>
- <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-input
- v-model="queryParam.storePlace"
- style="width: 150px"
- placeholder="输入存放处"
- />
- </a-form-item>
- <a-form-item>
- <a-date-picker
- v-model="queryParam.lastTestDate"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- placeholder="上次检验日期"
- />
- </a-form-item>
- <a-form-item>
- <a-input
- v-model="queryParam.toolCode"
- style="width: 150px"
- 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="toolId"
- :columns="columns"
- :data-source="dataSource"
- :pagination="ipagination"
- :loading="loading"
- @change="handleTableChange"
- >
- <template slot="isok" slot-scope="text, record">
- <span>{{ record.isok==='1'?'合格':'不合格' }}</span>
- </template>
- </a-table>
- </div>
- <!-- table区域-end -->
- <!-- 表单区域 -->
- </j-modal>
- </div>
- </template>
- <script>
- import { listMixin } from '@/mixin/listMixin'
- import { getAction, httpAction } from '@/api/request'
- import JModal from '@/components/JModal'
- import columns from './syColumns'
- export default {
- name: 'SyList',
- components: {
- JModal
- },
- mixins: [listMixin],
- data() {
- return {
- title: '完成试验',
- visible: false,
- queryParam: {},
- // 表头
- isNotCreateLoad: true,
- columns: columns(this),
- treeData: [],
- id: '',
- url: {
- list: '/business/safetool/base/safety/tool/listExperimentTool',
- tree: '/system/dept/treeSelect'
- }
- }
- },
- created() {
- },
- methods: {
- edit(record) {
- this.id = record.id
- this.loadTree()
- this.loadData()
- this.visible = true
- },
- loadData() {
- if (!this.url.list) {
- this.$message.error('请设置url.list属性!')
- return
- }
- var params = this.getQueryParams()// 查询条件
- this.queryParam = Object.assign({}, params, { id: this.id })
- this.loading = true
- getAction(this.url.list, this.queryParam).then((res) => {
- if (res.code === 200) {
- this.dataSource = res.rows || res.data
- if (res.total) {
- this.ipagination.total = res.total
- } else {
- this.ipagination.total = 0
- }
- } else {
- this.$message.warning(res.msg)
- }
- }).finally(() => {
- this.loading = false
- })
- },
- loadTree() {
- this.treeData = []
- getAction(this.url.tree).then((res) => {
- if (res.code === 200) {
- this.treeData = res.data
- }
- })
- },
- close() {
- this.visible = false
- }
- }
- }
- </script>
|