| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386 |
- <template>
- <div class="ele-body">
- <el-card shadow="never">
- <seek-page :seekList="seekList" @search="search"></seek-page>
- <ele-pro-table
- ref="table"
- row-key="id"
- :columns="columns"
- :datasource="datasource"
- @columns-change="handleColumnChange"
- :cache-key="cacheKeyUrl"
- autoAmendPage
- >
- <template v-slot:toolbar>
- <el-button type="primary" size="mini" @click="addSampleOpen('add')"
- v-if="$hasPermission('qms:samplingrecord:save')"
- >新增</el-button
- >
- </template>
- <template v-slot:code="{ row }">
- <el-link
- type="primary"
- :underline="false"
- @click="addSampleOpen('view', row)"
- >
- {{ row.code }}
- </el-link>
- </template>
- <template v-slot:action="{ row }">
- <el-link
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="addSampleOpen('edit', row)"
- v-if="[0, 3].includes(row.approvalStatus)&&$hasPermission('qms:samplingrecord:update')"
- >
- 编辑
- </el-link>
- <el-link
- type="primary"
- :underline="false"
- v-if="[0, 3].includes(row.approvalStatus)&&$hasPermission('qms:samplingrecord:update')"
- @click="approvalSubmit(row)"
- >提交</el-link
- >
- <!-- <el-popconfirm
- class="ele-action"
- title="确定要删除此条数据吗?"
- @confirm="deleteRow(row)"
- v-if="[0, 3].includes(row.approvalStatus)&&$hasPermission('qms:samplingrecord:update')"
- >
- <template v-slot:reference>
- <el-link type="danger" :underline="false" icon="el-icon-delete">
- 删除
- </el-link>
- </template>
- </el-popconfirm> -->
- </template>
- </ele-pro-table>
- </el-card>
- <addSample ref="addSampleRef" @reload="search" :isSampleRecord="true"></addSample>
- <processSubmitDialog
- :processSubmitDialogFlag.sync="processSubmitDialogFlag"
- v-if="processSubmitDialogFlag"
- ref="processSubmitDialogRef"
- @reload="search"
- ></processSubmitDialog>
- </div>
- </template>
- <script>
- import dictMixins from '@/mixins/dictMixins';
- import tableColumnsMixin from '@/mixins/tableColumnsMixin';
- import addSample from './components/addSample.vue';
- import { samplingRecordsPage } from '@/api/samplingRecords';
- import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
- import { reviewStatus } from '@/enum/dict';
- export default {
- mixins: [dictMixins, tableColumnsMixin],
- components: {
- addSample,
- processSubmitDialog
- },
- data() {
- return {
- processSubmitDialogFlag: false,
- cacheKeyUrl: 'qms-2511141047-sampleRecord-table',
- columns: [
- {
- width: 50,
- type: 'index',
- columnKey: 'index',
- align: 'center',
- label: '序号'
- },
- {
- prop: 'code',
- label: '取样记录编码',
- slot: 'code',
- align: 'center',
- minWidth: 150,
- showOverflowTooltip: true
- },
- {
- prop: 'qualityWorkOrderCode',
- label: '质检工单编码',
- align: 'center',
- minWidth: 150,
- showOverflowTooltip: true
- },
- {
- prop: 'qualityWorkOrderName',
- label: '质检工单名称',
- align: 'center',
- minWidth: 120,
- showOverflowTooltip: true
- },
- {
- prop: 'sourceCode',
- label: '来源单号',
- align: 'center',
- minWidth: 150,
- showOverflowTooltip: true
- },
- {
- prop: 'qualityType',
- label: '类型',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 100,
- formatter: (row) => {}
- },
- {
- prop: 'qualityMode',
- label: '质检方式',
- align: 'center',
- minWidth: 100,
- formatter: (row) => {
- return row.qualityMode == 1 ? '全检' : '抽检';
- },
- showOverflowTooltip: true
- },
- {
- prop: 'productCode',
- label: '编码',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'productName',
- label: '名称',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'batchNo',
- label: '批次号',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'specification',
- label: '规格',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'modelType',
- label: '型号',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'brandNo',
- label: '牌号',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'produceTaskName',
- label: '工序名称',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'pleasePurpose',
- label: '请样目的',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'pleaseQuantity',
- label: '请样数量',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'pleaseUnit',
- label: '单位',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'conditionType',
- label: '取样',
- formatter: (row) => {
- return row.conditionType == 1 ? '整样' : '小样';
- },
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'recordingMethod',
- label: '记录方法',
- align: 'center',
- formatter: (row) => {
- return row.recordingMethod == 1 ? '批样' : '单样全部';
- },
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'quantity',
- label: '取样数量',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'unit',
- label: '单位',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'status',
- label: '状态',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true,
- formatter: (_row, _column, cellValue) => {
- return _row.status == 1
- ? '审核中'
- : _row.status == 2
- ? '已取样'
- : '未提交';
- }
- },
- {
- prop: 'approvalStatus',
- label: '审核状态',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true,
- formatter: (_row, _column, cellValue) => {
- return reviewStatus[_row.approvalStatus];
- }
- },
- {
- prop: 'createUserName',
- label: '创建人',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'createTime',
- label: '创建时间',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'approvalUserName',
- label: '审批人',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- prop: 'approvalTime',
- label: '审批时间',
- align: 'center',
- minWidth: 110,
- showOverflowTooltip: true
- },
- {
- columnKey: 'action',
- label: '操作',
- width: 220,
- align: 'center',
- resizable: false,
- fixed: 'right',
- slot: 'action',
- showOverflowTooltip: true
- }
- ]
- };
- },
- computed: {
- seekList() {
- return [
- {
- label: '质检工单编码:',
- value: 'workOrderCode',
- type: 'input',
- placeholder: '请输入'
- },
- {
- label: '来源单号:',
- value: 'workOrderCode',
- type: 'input',
- placeholder: '请输入'
- },
- {
- label: '类型:',
- value: 'type',
- type: 'select',
- placeholder: '请输入',
- planList: [
- { label: '类型一', value: '1' },
- { label: '类型二', value: '2' }
- ]
- }
- ];
- }
- },
- methods: {
- // 刷新表格
- reload(where = {}) {
- this.$refs.table.reload({
- where
- });
- },
- addSampleOpen(type, row) {
- this.$refs.addSampleRef.open(type, row);
- },
- approvalSubmit(res) {
- this.processSubmitDialogFlag = true;
- this.$nextTick(() => {
- let params = {
- businessId: res.id,
- businessKey: 'sampling_approval_process',
- formCreateUserId: res.createUserId,
- variables: {
- businessCode: res.code,
- businessName: res.name,
- businessType: '取样'
- }
- };
- this.$refs.processSubmitDialogRef.init(params);
- });
- },
- /* 表格数据源 */
- datasource({ page, limit, where, order }) {
- // 参数
- const body = {
- ...where,
- ...order,
- pageNum: page,
- size: limit
- };
- return samplingRecordsPage(body);
- },
- search(where) {
- this.reload(where);
- }
- }
- };
- </script>
- <style></style>
|