| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- <template>
- <div class="ele-body">
- <el-card shadow="never">
- <!-- 搜索表单 -->
- <search @search="reload" />
- <!-- 数据表格 -->
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- :selection.sync="selection"
- row-key="code"
- :page-size="20"
- @columns-change="handleColumnChange"
- :cache-key="cacheKeyUrl"
- >
- <!-- 表头工具栏 -->
- <template v-slot:qualityType="{ row }">
- {{ getDictValue('质检计划类型', row.qualityType) }}
- </template>
- <template v-slot:qualityMode="{ row }">
- {{ getDictValue('取样类型', row.qualityMode) }}
- </template>
- <!-- 操作列 -->
- <template v-slot:action="{ row }">
- <el-link
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="sampleCollection(row)"
- v-if="row.status == 0"
- >
- 收样
- </el-link>
- <el-link
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="openEdit(row)"
- v-if="row.status == 1"
- >
- 报工
- </el-link>
- </template>
- </ele-pro-table>
- </el-card>
- <!-- 编辑弹窗 -->
- <edit ref="edit" />
- </div>
- </template>
- <script>
- import search from './components/search.vue';
- // import edit from './components/inspectionProjectTaskSend.vue';
- import tabMixins from '@/mixins/tableColumnsMixin';
- import { getList, sampleCollection } from '@/api/inspectionProjectTask';
- import dictMixins from '@/mixins/dictMixins';
- export default {
- components: {
- search
- // edit
- },
- mixins: [dictMixins, tabMixins],
- data() {
- return {
- cacheKeyUrl: 'qsm-c2e9664a-inspectionProjectTask',
- // 表格列配置
- columns: [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'code',
- label: '请托单号',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 130
- },
- {
- prop: 'name',
- label: '任务名称',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'executeDeptName',
- label: '受托部门',
- showOverflowTooltip: true,
- align: 'center',
- minWidth: 110
- },
- {
- prop: 'executeUserName',
- minWidth: 110,
- label: '执行人员',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'requiredCompletionTime',
- minWidth: 110,
- label: '完成日期',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'urgent',
- minWidth: 110,
- label: '紧急程度',
- align: 'center',
- formatter: (row) => {
- return row.urgent == 1
- ? '普通'
- : row.urgent == 2
- ? '紧急'
- : '重要';
- },
- showOverflowTooltip: true
- },
- {
- prop: 'qualityWorkOrderCode',
- minWidth: 110,
- label: '质检工单编码',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'qualityWorkOrderName',
- minWidth: 110,
- label: '质检工单名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'sourceCode',
- minWidth: 110,
- label: '来源单号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'qualityType',
- slot: 'qualityType',
- minWidth: 110,
- label: '类型',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- slot: 'qualityMode',
- prop: 'qualityMode',
- minWidth: 110,
- label: '质检方式',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productCode',
- minWidth: 110,
- label: '编码',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'productName',
- minWidth: 110,
- label: '名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'batchNo',
- minWidth: 110,
- label: '批次号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'specification',
- minWidth: 110,
- label: '规格',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'brandNo',
- minWidth: 110,
- label: '牌号',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'produceTaskName',
- minWidth: 110,
- label: '工序名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'status',
- minWidth: 110,
- label: '状态',
- align: 'center',
-
- showOverflowTooltip: true
- },
- {
- prop: 'createUserName',
- minWidth: 110,
- label: '创建人',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'createTime',
- minWidth: 110,
- label: '创建时间',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'sampleReceiverName',
- minWidth: 110,
- label: '收样人',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'sampleReceiverTime',
- minWidth: 110,
- label: '收样时间',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- columnKey: 'action',
- label: '操作',
- width: 220,
- align: 'center',
- resizable: false,
- slot: 'action',
- fixed: 'right',
- showOverflowTooltip: true
- }
- ]
- };
- },
- created() {
- this.requestDict('质检计划类型');
- this.requestDict('取样类型');
- },
- methods: {
- /*回显类型 */
- /* 表格数据源 */
- datasource({ page, where, limit }) {
- return getList({
- ...where,
- pageNum: page,
- size: limit
- });
- },
- /* 刷新表格 */
- reload(where) {
- this.$refs.table.reload({ page: 1, where: where });
- },
- uploadFile() {
- this.$refs.importDialogRef.open();
- },
- sampleCollection(row) {
- sampleCollection({ id: row.id }).then((res) => {
- this.$message.success('收样成功');
- this.reload();
- });
- },
- /* 打开编辑弹窗 */
- openEdit(row) {
- this.current = row;
- this.showEdit = true;
- this.$refs.userEdit.$refs.form &&
- this.$refs.userEdit.$refs.form.clearValidate();
- },
- /* 删除 */
- remove(row) {
- const loading = this.$loading({ lock: true });
- removeItem([row.id])
- .then((msg) => {
- loading.close();
- this.$message.success('删除' + msg);
- this.reload();
- })
- .catch((e) => {
- loading.close();
- });
- },
- /* 批量删除 */
- removeBatch() {
- if (!this.selection.length) {
- this.$message.error('请至少选择一条数据');
- return;
- }
- this.$confirm('确定要删除选中的质检吗?', '提示', {
- type: 'warning'
- })
- .then(() => {
- const loading = this.$loading({ lock: true });
- removeItem(this.selection.map((d) => d.id))
- .then((msg) => {
- loading.close();
- this.$message.success('删除' + msg);
- this.reload();
- })
- .catch((e) => {
- loading.close();
- });
- })
- .catch(() => {});
- }
- }
- };
- </script>
|