From 6bbceeae0a692ef60f429dbca889752fcb09ec9a Mon Sep 17 00:00:00 2001 From: houshuai <17802598606@163.com> Date: 星期四, 03 七月 2025 19:42:01 +0800 Subject: [PATCH] 线边库和订单 基本页面搭建 --- src/views/qms/DefectList.vue | 322 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 322 insertions(+), 0 deletions(-) diff --git a/src/views/qms/DefectList.vue b/src/views/qms/DefectList.vue new file mode 100644 index 0000000..5cf5eef --- /dev/null +++ b/src/views/qms/DefectList.vue @@ -0,0 +1,322 @@ +<template> + <a-card + :bordered="false" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="30"> + + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="缂洪櫡缂栫爜"> + <j-input + placeholder="璇疯緭鍏ョ己闄风紪鐮�" + v-model="queryParam.defectCode" + ></j-input> + </a-form-item> + </a-col> + + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <a-form-item label="缂洪櫡鍚嶇О"> + <j-input + placeholder="璇疯緭鍏ョ己闄峰悕绉�" + v-model="queryParam.defectName" + ></j-input> + </a-form-item> + </a-col> + + <a-col :xl="6" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + >鏂板</a-button> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + filterMultiple="filterMultiple" + :columns="columns" + :rowClassName="tableRowClass" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + > + <!--鐘舵�佹爮涓�у睍绀�--> + <span + slot="status" + slot-scope="text,record" + > + <a-badge + v-if="record.defectStatus==1" + status="success" + /> + <span + v-if="record.defectStatus==1" + class="success" + >鍚敤</span> + <a-badge + v-if="record.defectStatus==0" + status="error" + /> + <span + v-if="record.defectStatus==0" + class="error" + >绂佺敤</span> + </span> + <span + slot="action" + slot-scope="text, record" + > + <a + href="javascript:;" + @click="handleDetail(record)" + >璇︽儏</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 + <a-icon type="down" /> + </a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleEdit(record)">缂栬緫</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + + </a-menu-item> + <a-menu-item v-if="record.defectStatus == 0"> + <a-popconfirm + title="纭畾鍚敤鍚�?" + @confirm="() => handleActive(record.id)" + > + <a>鍚敤</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item v-if="record.defectStatus == 1"> + <a-popconfirm + title="纭畾绂佺敤鍚�?" + @confirm="() => handleActive(record.id)" + > + <a>绂佺敤</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <defect-model + ref="modalForm" + @ok="modalFormOk" + ></defect-model> + </a-card> +</template> + +<script> +//鎸夐渶寮曞叆 缁勪欢 +import DefectModel from './modules/defect/DefectModel' + +import { deleteAction, requestPut, getAction } from '@/api/manage' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import JEllipsis from '@/components/jeecg/JEllipsis' +import JInput from '@/components/jeecg/JInput' + +export default { + name: 'DefectList', + mixins: [JeecgListMixin], + components: { + DefectModel, + JEllipsis, + JInput, + }, + data() { + return { + dataSource: [], + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 5, + pageSizeOptions: ['5', '10', '20'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + total: 0 + }, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + }, + { + title: '缂洪櫡缂栫爜', + align: "center", + dataIndex: 'defectCode' + }, + { + title: '缂洪櫡鍚嶇О', + align: "center", + dataIndex: 'defectName' + }, + { + title: '缂洪櫡鍒嗙被', + align: "center", + dataIndex: 'defectCategory_dictText' + }, + { + title: '鎻忚堪', + align: 'center', + dataIndex: 'descreption' + }, + { + width: 100, + title: '鐘舵��', + align: 'center', + scopedSlots: { + customRender: 'status', + }, + dataIndex: 'defectStatus' + }, + { + width: 150, + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: '/qms/defect/list', + delete: '/qms/defect/delete', + active: '/qms/defect/active', + }, + } + }, + mounted() { + }, + methods: { + loadData(arg) { + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records; + this.ipagination.total = res.result.total; + } + if (res.code === 510) { + this.$message.warning(res.message) + } + this.loading = false; + }) + }, + //绂佺敤鐘舵�佹牱寮� + tableRowClass(record, index) { + if (record.warehouseStatus != "1") { + return "frozenRowClass"; + } + return ""; + }, + //鍚敤绂佺敤 + handleActive(id) { + if (!this.url.active) { + this.$message.error("璇疯缃畊rl.active!") + return + } + let that = this; + requestPut(that.url.active, {}, { id: id }).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.loadData(); + } else { + that.$message.warning(res.message); + } + }); + }, + }, + +} +</script> +<style lang="less" scoped> +@import '~@assets/less/common.less'; +.frozenRowClass { + color: #c9c9c9; +} +.success { + color: green; +} +.error { + color: red; +} +.fontweight { + font-weight: bold; +} +.ant-card-body .table-operator { + margin-bottom: 18px; +} + +.ant-table-tbody .ant-table-row td { + padding-top: 15px; + padding-bottom: 15px; +} + +.anty-row-operator button { + margin: 0 5px; +} + +/deep/.ant-btn-danger { + background-color: #ffffff; +} + +.ant-modal-cust-warp { + height: 100%; +} + +.ant-modal-cust-warp .ant-modal-body { + height: calc(100% - 110px) !important; + overflow-y: auto; +} + +.ant-modal-cust-warp .ant-modal-content { + height: 90% !important; + overflow-y: hidden; +} +</style> \ No newline at end of file -- Gitblit v1.9.3