| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365 |
- <!-- 不良品列表 -->
- <template>
- <div class="ele-body">
- <el-card shadow="never" v-loading="loading">
- <order-search @search="reload" ref="searchRef"> </order-search>
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- :pageSize="20"
- :height="tableHeight"
- @fullscreen-change="fullscreenChange"
- >
- <!-- 操作列 -->
- <template v-slot:toolbar>
- <el-button type="primary" @click="open()">新建</el-button>
- </template>
- <template v-slot:unqualifiedProductsCode="{ row }">
- <el-link
- type="primary"
- :underline="false"
- @click="goDetail(row, 'detail')"
- >{{ row.unqualifiedProductsCode }}</el-link
- >
- </template>
- <template v-slot:qualityType="{ row }">
- {{ getQuality(row) }}
- </template>
- <template v-slot:quantity="{ row }">
- {{ row.quantity }}{{ row.measureUnit }}
- </template>
- <template v-slot:status="{ row }">
- {{ getDispose(row) }}
- </template>
- <template v-slot:action="{ row }">
- <el-link
- v-if="row.status == 0"
- type="primary"
- :underline="false"
- icon="el-icon-truck"
- @click="open(row)"
- >
- 编辑
- </el-link>
- <el-popconfirm
- class="ele-action"
- title="确定要删除吗?"
- v-if="row.status == 0"
- @confirm="remove(row)"
- >
- <template v-slot:reference>
- <el-link type="danger" :underline="false" icon="el-icon-delete">
- 删除
- </el-link>
- </template>
- </el-popconfirm>
- <el-link
- v-if="row.status == 0 || row.status == 1"
- type="primary"
- :underline="false"
- icon="el-icon-edit"
- @click="goDetail(row)"
- >
- 处置
- </el-link>
- </template>
- </ele-pro-table>
- </el-card>
- <Create ref="create" @refresh="reload" />
- </div>
- </template>
- <script>
- import OrderSearch from './components/order-search.vue';
- import dictMixins from '@/mixins/dictMixins';
- import { unacceptedProductStatus } from '@/utils/util';
- import Create from './components/create.vue';
- import { getByCode } from '@/api/system/dictionary-data';
- import { getList } from '@/api/unacceptedProduct/index';
- import { getQualityDetails } from '@/api/manufacture/spreadWorkOrder';
- export default {
- components: {
- OrderSearch,
- Create
- },
- mixins: [dictMixins],
- data() {
- return {
- visible: false,
- loading: false,
- releasParams: {
- teamId: '',
- id: ''
- },
- current: null,
- qualityList: [],
- disposeList: [],
- tableHeight: 'calc(100vh - 340px)'
- };
- },
- computed: {
- // 表格列配置
- columns() {
- return [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'unqualifiedProductsCode',
- label: '编码',
- slot: 'unqualifiedProductsCode',
- align: 'center',
- width: 150,
- showOverflowTooltip: true
- },
- {
- prop: 'sourceCode',
- label: '来源编码',
- align: 'center',
- width: 150,
- showOverflowTooltip: true
- },
- {
- prop: 'categoryCode',
- label: '物品编码',
- align: 'center',
- width: 160,
- showOverflowTooltip: true
- },
- {
- prop: 'categoryName',
- label: '物品名称',
- align: 'center',
- showOverflowTooltip: true
- },
- {
- prop: 'specification',
- label: '规格',
- align: 'center',
- width: 100,
- showOverflowTooltip: true
- },
- {
- prop: 'brandNum',
- label: '牌号',
- align: 'center',
- width: 100,
- showOverflowTooltip: true
- },
- {
- prop: 'modelType',
- label: '型号',
- align: 'center',
- width: 160,
- showOverflowTooltip: true
- },
- {
- prop: 'quantity',
- slot: 'quantity',
- label: '数量',
- align: 'center',
- width: 80,
- showOverflowTooltip: true
- },
- // {
- // prop: 'unit',
- // label: '计量单位',
- // align: 'center',
- // width: 100,
- // showOverflowTooltip: true
- // },
- {
- prop: 'batchNo',
- label: '批次号',
- align: 'center',
- width: 100,
- showOverflowTooltip: true
- },
- {
- prop: 'workOrderCode',
- label: '工单编号',
- align: 'center',
- width: 100,
- showOverflowTooltip: true
- },
- // {
- // prop: 'produceRoutingName',
- // label: '工艺路线',
- // align: 'center',
- // width: 120,
- // showOverflowTooltip: true
- // },
- // {
- // prop: 'taskName',
- // label: '工序',
- // align: 'center',
- // width: 120,
- // showOverflowTooltip: true
- // },
- {
- prop: 'disposeTime',
- label: '处置时间',
- align: 'center',
- width: 180,
- showOverflowTooltip: true
- },
- {
- prop: 'qualityType',
- slot: 'qualityType',
- label: '质检类型',
- align: 'center',
- width: 120,
- showOverflowTooltip: true
- },
- {
- prop: 'status',
- slot: 'status',
- label: '状态',
- align: 'center',
- width: 80
- // formatter: (row, column, cellValue) => {
- // console.log(this.getDictName('处置状态', cellValue));
- // return this.getDictName('处置状态', cellValue);
- // }
- },
- {
- columnKey: 'action',
- label: '操作',
- width: 200,
- align: 'center',
- resizable: false,
- fixed: 'right',
- slot: 'action'
- }
- ];
- }
- },
- created() {
- this.requestDict('质检计划类型');
- this.requestDict('处置状态');
- this.getDisposeList('dispose_status');
- this.getQualityList('inspection_plan_type');
- },
- filters: {},
- methods: {
- //处置
- goDetail(row, type) {
- this.$router.push({
- path: '/unacceptedProduct/detailList',
- query: {
- id: row.id,
- qualityType: row.qualityType,
- workOrderCode: row.workOrderCode,
- type
- }
- });
- },
- /* 表格数据源 */
- datasource({ page, limit, where }) {
- return getList({
- pageNum: page,
- size: limit,
- ...where
- });
- },
- open(row) {
- this.$refs.create.open(row ? JSON.parse(JSON.stringify(row)) : '');
- },
- remove(row) {
- deleteUnacceptedProduct(row.id).then((res) => {
- this.$message.success('删除' + res);
- this.reload();
- });
- },
- // // 下达
- // toRelease(row) {
- // this.current = row;
- // this.visible = true;
- // },
- // // 下达
- // confirm(row) {
- // this.$confirm('确认下发选中的任务吗?', '提示', {
- // confirmButtonText: '确定',
- // cancleButtonText: '取消',
- // type: 'warning'
- // })
- // .then(async () => {
- // const res = await issuedPutMeshWorkOrder({
- // id: [row.id],
- // status: 1
- // });
- // this.$message.success('任务下发成功!');
- // this.reload();
- // })
- // .catch(() => {});
- // },
- /* 刷新表格 */
- reload(where) {
- this.$nextTick(() => {
- this.$refs.table.reload({ page: 1, where });
- });
- },
- fullscreenChange(fullscreen) {
- if (fullscreen) {
- this.tableHeight = 'calc(100vh - 120px)';
- } else {
- this.tableHeight = 'calc(100vh - 340px)';
- }
- },
- getDispose(item) {
- const data = this.disposeList.find((it) => it.value == item.status);
- return data ? data.label : '';
- },
- getQuality(item) {
- for (let i = 0; i < this.qualityList.length; i++) {
- if (this.qualityList[i].value == item.qualityType) {
- return this.qualityList[i].label;
- }
- }
- },
- async getDisposeList(code) {
- let res = await getByCode(code);
- if (res?.code == 0) {
- let list = res.data.map((item) => {
- let key = Object.keys(item)[0];
- return { value: Number(key), label: item[key] };
- });
- this.disposeList = list;
- }
- },
- async getQualityList(code) {
- let res = await getByCode(code);
- if (res?.code == 0) {
- let list = res.data.map((item) => {
- let key = Object.keys(item)[0];
- return { value: Number(key), label: item[key] };
- });
- this.qualityList = list;
- }
- }
- }
- };
- </script>
- <style lang="scss" scoped></style>
|