<template>
|
<a-card :bordered="false" :class="'cust-erp-sub-tab'">
|
<!-- 查询区域 -->
|
<div class="table-page-search-wrapper">
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
<a-row>
|
<a-col :span="3" class="colright">
|
<a-form-item label='状态'>
|
<a-input
|
:value="obj.status == 1 ? '新建' : obj.status == 2 ? '待维修' : obj.status == 3 ? '已维修' : obj.status == 4 ? '已确认' : ''"
|
readOnly></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col :span="4" class="colright">
|
<a-form-item label='检定单号'>
|
<a-input v-model="obj.num" readOnly></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col :span="3" class="colright">
|
<a-form-item label='统一编码'>
|
<a-input v-model="obj.numCode" readOnly></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col :span="3" class="colright">
|
<a-form-item label='设备名称'>
|
<a-input v-model="obj.numName" readOnly></a-input>
|
</a-form-item>
|
</a-col>
|
<a-col :span="3" class="colright">
|
<a-form-item label='设备型号'>
|
<a-input v-model="obj.numModel" readOnly></a-input>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
<!-- 查询区域-END -->
|
<div class="table-operator">
|
<a-row :gutter="24">
|
<a-col :md="24">
|
<!-- v-if="hasBtnPerm('CertifiedWorkOrder:add')" -->
|
<a-button v-if="obj.status == '2'" @click="handleCommit('commit')" type="primary">
|
提交
|
</a-button>
|
<a-button v-if="obj.status == '3'" @click="handleCommit('back')" type="primary">
|
撤回
|
</a-button>
|
<a-button @click="handleSave('temp')" type="primary">
|
暂存
|
</a-button>
|
<a-button @click="handleSave('perp')" type="primary">
|
保存
|
</a-button>
|
</a-col>
|
</a-row>
|
</div>
|
<!-- 操作按钮区域 -->
|
<div class="table-operator" v-if="mainId">
|
<!-- <a-button @click="handleAdd" type="primary" icon="plus" :disabled="!this.mainId">新增</a-button> -->
|
<a-button type="primary" icon="download" @click="handleExportXls('仓库服务对象')" v-if="false">导出</a-button>
|
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
|
@change="handleImportExcel">
|
<a-button type="primary" icon="import" v-if="false">导入</a-button>
|
</a-upload>
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
<a-menu slot="overlay">
|
<a-menu-item key="1" @click="batchDel"><a-icon type="delete" />删除</a-menu-item>
|
</a-menu>
|
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
|
</a-dropdown>
|
</div>
|
<a-tabs default-active-key="1" @change="callback">
|
<a-tab-pane key="1" tab="检定参数">
|
<a-table ref="table" size="middle" bordered rowKey="id" :scroll="{ x: true }" :columns="columns"
|
:dataSource="dataSource" :pagination="ipagination" :loading="loading" @change="handleTableChange">
|
<template slot="htmlSlot" slot-scope="text">
|
<div v-html="text"></div>
|
</template>
|
<template slot="imgSlot" slot-scope="text,record">
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
|
<img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt=""
|
style="max-width:80px;font-size: 12px;font-style: italic;" />
|
</template>
|
<template slot="fileSlot" slot-scope="text">
|
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
<a-button v-else :ghost="true" type="primary" icon="download" size="small"
|
@click="downloadFile(text)">
|
下载
|
</a-button>
|
</template>
|
<template slot="actualValue" slot-scope="text, record">
|
<a-input v-model="record.actualValue"></a-input>
|
</template>
|
</a-table>
|
</a-tab-pane>
|
<a-tab-pane key="2" tab="检定附件报告">
|
<AttachedReportList :mainId="mainId" ref="clint" />
|
</a-tab-pane>
|
</a-tabs>
|
<!-- table区域-begin -->
|
|
<warehouseClient-modal ref="modalForm" @ok="modalFormOk" :mainId="mainId" :enterpriseId="enterpriseId"
|
:originTargetKeys="originTargetKeys"></warehouseClient-modal>
|
</a-card>
|
</template>
|
|
<script>
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
import WarehouseClientModal from './modules/WarehouseClientModal'
|
import { getAction, postAction, putAction } from '@/api/manage'
|
import AttachedReportList from './AttachedReportList.vue'
|
export default {
|
name: "WarehouseClientList",
|
mixins: [JeecgListMixin],
|
components: { WarehouseClientModal, AttachedReportList },
|
props: {
|
mainId: {
|
type: String,
|
default: '',
|
required: false
|
},
|
enterpriseId: {
|
type: String,
|
default: '',
|
required: false
|
}
|
},
|
watch: {
|
mainId: {
|
immediate: true,
|
handler(val) {
|
if (!this.mainId) {
|
this.clearList()
|
} else {
|
this.queryParam['calibrationOrderId'] = val;
|
this.queryParam['delFlag'] = '0';
|
this.isButtonShow = true;
|
this.loadData(1);
|
this.selectedRowKeys = [];
|
}
|
}
|
}
|
},
|
|
data() {
|
return {
|
description: '检定单',
|
disableMixinCreated: true,
|
// 表头
|
columns: [
|
{
|
title: '精度参数编码',
|
dataIndex: 'precisionParametersNum',
|
align: "center",
|
},
|
{
|
title: '精度参数名称',
|
dataIndex: 'precisionParametersName',
|
align: "center",
|
},
|
{
|
title: '计量单位',
|
dataIndex: 'precisionParametersUnitName',
|
align: "center",
|
},
|
{
|
title: '检验范围',
|
dataIndex: 'precisionParametersUnitName1',
|
align: "center",
|
},
|
{
|
title: '允差',
|
dataIndex: 'precisionParametersUnitName2',
|
align: "center",
|
},
|
{
|
title: '初始测定值',
|
dataIndex: 'actualValue1',
|
align: "center",
|
width: 120
|
},
|
{
|
title: '实际测定值',
|
dataIndex: 'actualValue',
|
align: "center",
|
width: 120,
|
scopedSlots: { customRender: 'actualValue' }
|
},
|
{
|
title: '判定结果',
|
align: "center",
|
dataIndex: 'elementType',
|
|
}
|
],
|
url: {
|
list: "/eam/calibrationOrderDetail/list",
|
edit: "/eam/calibrationOrder/edit",
|
save: '/eam/calibrationOrderDetail/preserve',
|
delete: "/eam/calibrationOrderDetail/delete",
|
deleteBatch: "/eam/calibrationOrderDetail/deleteBatch",
|
exportXlsUrl: "/eam/calibrationOrderDetail/exportWarehouseClient",
|
importUrl: "/eam/calibrationOrderDetail/importWarehouseClient",
|
},
|
dictOptions: {
|
},
|
originTargetKeys: [],
|
activeKey: '1',
|
obj: {}
|
}
|
},
|
created() {
|
this.mainId = JSON.parse(this.$route.query.obj).id
|
this.obj = JSON.parse(this.$route.query.obj)
|
},
|
computed: {
|
importExcelUrl() {
|
return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`;
|
}
|
},
|
methods: {
|
handleCommit(params) {
|
// params commit/提交 back/撤回
|
params == 'commit' ? this.obj.status = '3' : this.obj.status = '2'
|
putAction(this.url.edit, this.obj).then((res) => {
|
if (res.success) {
|
this.$message.success(res.message);
|
} else {
|
this.$message.warning(res.message);
|
}
|
})
|
},
|
handleSave(params) {
|
// params temp/暂存 perp/保存
|
if (params == 'perp') {
|
const dataSource = [...this.dataSource];
|
dataSource.forEach(res => {
|
res.calibrationOrderId = this.mainId
|
})
|
postAction(this.url.save, dataSource).then((res) => {
|
if (res.success) {
|
this.$message.success(res.message)
|
} else {
|
this.$message.warning(res.message)
|
}
|
}).catch((error) => {
|
this.$message.error(error)
|
})
|
}
|
},
|
callback(key) {
|
console.log(key);
|
},
|
clearList() {
|
this.dataSource = []
|
this.selectedRowKeys = []
|
this.ipagination.current = 1
|
},
|
loadData(arg) {
|
if (!this.url.list) {
|
this.$message.error("请设置url.list属性!")
|
return
|
}
|
//加载数据 若传入参数1则加载第一页的内容
|
if (arg === 1) {
|
this.ipagination.current = 1;
|
}
|
var params = this.getQueryParams();//查询条件
|
this.loading = true;
|
this.originTargetKeys = [];
|
getAction(this.url.list, params).then((res) => {
|
if (res.success) {
|
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
this.dataSource = res.result.records || res.result;
|
for (var i = 0; i < res.result.records.length; i++) {
|
var clientId = res.result.records[i]['clientId']
|
this.originTargetKeys.push(clientId)
|
}
|
if (res.result.total) {
|
this.ipagination.total = res.result.total;
|
} else {
|
this.ipagination.total = 0;
|
}
|
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
} else {
|
this.$message.warning(res.message)
|
}
|
}).finally(() => {
|
this.loading = false
|
})
|
},
|
|
}
|
}
|
</script>
|
<style scoped lang="less">
|
// @import '@assets/less/common.less'
|
.colright {
|
margin-right: 20px;
|
}
|
</style>
|