| | |
| | | <!-- æ¥è¯¢åºå --> |
| | | <a-form layout="inline" class="j-inline-form"> |
| | | <!-- åºå®æ¡ä»¶ --> |
| | | <a-form-item :label="(queryParamText||name)"> |
| | | <!-- <a-form-item :label="(queryParamText||name)"> |
| | | <a-input v-model="queryParam[queryParamCode||valueKey]" :placeholder="'请è¾å
¥' + (queryParamText||name)" @pressEnter="searchQuery"/> |
| | | </a-form-item> |
| | | </a-form-item> --> |
| | | <!-- 卿çæçæ¥è¯¢æ¡ä»¶ --> |
| | | <j-select-biz-query-item v-if="queryConfig.length>0" v-show="showMoreQueryItems" :queryParam="queryParam" :queryConfig="queryConfig" @pressEnter="searchQuery"/> |
| | | <j-select-biz-query-item v-if="queryConfig.length>0" :queryParam="queryParam" :queryConfig="queryConfig" @pressEnter="searchQuery"/> |
| | | <!-- æé® --> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | <a v-if="queryConfig.length>0" @click="showMoreQueryItems=!showMoreQueryItems" style="margin-left: 8px"> |
| | | <!-- <a v-if="queryConfig.length>0" @click="showMoreQueryItems=!showMoreQueryItems" style="margin-left: 8px"> |
| | | {{ showMoreQueryItems ? 'æ¶èµ·' : 'å±å¼' }} |
| | | <a-icon :type="showMoreQueryItems ? 'up' : 'down'"/> |
| | | </a> |
| | | </a> --> |
| | | </a-form> |
| | | |
| | | <a-table |
| | |
| | | } |
| | | }, |
| | | |
| | | searchQuery() { |
| | | this.loadData(1); |
| | | this.selectedRowKeys = [] |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.loadData(1); |
| | | this.selectedRowKeys = [] |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | // 夿¡ä»¶æ¥è¯¢é
ç½® |
| | | queryConfigDefault: [ |
| | | { |
| | | key: 'username', |
| | | label: 'è´¦å·', |
| | | }, |
| | | { |
| | | key: 'sex', |
| | | label: 'æ§å«', |
| | | // 妿å
å« dictCodeï¼é£ä¹å°±ä¼æ¾ç¤ºæä¸ææ¡ |
| | | dictCode: 'sex', |
| | | }, |
| | | { |
| | | key: 'birthday', |
| | | label: 'çæ¥', |
| | | placeholder: 'è¯·éæ©åºçæ¥æ', |
| | | // 妿æ³è¦ä½¿ç¨å±é¨æ³¨åçç»ä»¶ï¼å°±å¿
é¡»è¦ä½¿ç¨ç®å¤´å½æ° |
| | | customRender: ({key, queryParam, options}) => { |
| | | return <j-date {...options} vModel={queryParam[key]} style="width:180px;"/> |
| | | }, |
| | | }, |
| | | // { |
| | | // key: 'birthday', |
| | | // label: 'çæ¥', |
| | | // placeholder: 'è¯·éæ©åºçæ¥æ', |
| | | // // 妿æ³è¦ä½¿ç¨å±é¨æ³¨åçç»ä»¶ï¼å°±å¿
é¡»è¦ä½¿ç¨ç®å¤´å½æ° |
| | | // customRender: ({key, queryParam, options}) => { |
| | | // return <j-date {...options} vModel={queryParam[key]} style="width:180px;"/> |
| | | // }, |
| | | // }, |
| | | ], |
| | | } |
| | | }, |
| | |
| | | <!-- æç´¢åºå --> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :md="12" :sm="8"> |
| | | <a-col :md="6" :sm="8"> |
| | | <a-form-item label="çç»åç§°" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}"> |
| | | <a-input placeholder="" v-model="queryParam.groupName"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-col :md="12" :sm="24"> |
| | | <a-col :md="6" :sm="24"> |
| | | <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">æ¥è¯¢</a-button> |
| | | <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | </a-col> |
| | |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="çæ¬¡ç¼å·"> |
| | | <j-input placeholder="请è¾å
¥ç次ç¼å·" v-model="queryParam.shiftCode"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="çæ¬¡åç§°"> |
| | | <j-input placeholder="请è¾å
¥ç次åç§°" v-model="queryParam.shiftName"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <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> |
| | |
| | | > |
| | | <a-row :gutter="30"> |
| | | |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ä¾åºåç¼å·"> |
| | | <j-input |
| | | placeholder="请è¾å
¥ä¾åºåç¼å·æ£ç´¢" |
| | |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ä¾åºååç§°"> |
| | | <j-input |
| | | placeholder="请è¾å
¥ä¾åºååç§°æ£ç´¢" |
| | |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <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> |
| | |
| | | > |
| | | <a-row :gutter="30"> |
| | | |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ä»åºç¼å·"> |
| | | <j-input |
| | | placeholder="请è¾å
¥ä»åºç¼å·æ£ç´¢" |
| | |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="ä»åºåç§°"> |
| | | <j-input |
| | | placeholder="请è¾å
¥ä»åºåç§°æ£ç´¢" |
| | |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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("请设置url.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> |
| | |
| | | > |
| | | <a-row :gutter="30"> |
| | | |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æ£éªé¡¹ç®ç¼å·"> |
| | | <j-input |
| | | placeholder="请è¾å
¥æ£éªé¡¹ç®ç¼å·æ£ç´¢" |
| | |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æ£éªé¡¹ç®åç§°"> |
| | | <j-input |
| | | placeholder="请è¾å
¥æ£éªé¡¹ç®åç§°æ£ç´¢" |
| | |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <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> |
| | |
| | | { |
| | | title: 'æ£éªé¡¹ç®åç±»', |
| | | align: "center", |
| | | dataIndex: 'itemCategory' |
| | | dataIndex: 'itemCategoryName' |
| | | }, |
| | | { |
| | | title: 'å®é/宿§', |
| | | align: "center", |
| | | dataIndex: 'qualitativeOrQuantitative' |
| | | dataIndex: 'qualitativeOrQuantitativeName' |
| | | }, |
| | | { |
| | | title: 'æµéå·¥å
·', |
| | | align: "center", |
| | | dataIndex: 'inspectionTools' |
| | | dataIndex: 'inspectionToolsNames' |
| | | }, |
| | | { |
| | | title: '夿³¨', |
| | |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/qms/inspectionItem/list', |
| | | list: '/qms/inspectionItem/queryList', |
| | | delete: '/qms/inspectionItem/delete', |
| | | active: '/qms/inspectionItem/active', |
| | | }, |
| | |
| | | > |
| | | <a-row :gutter="30"> |
| | | |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æ£éªå·¥å
·ç¼ç "> |
| | | <j-input |
| | | placeholder="请è¾å
¥æ£éªå·¥å
·ç¼ç æ£ç´¢" |
| | |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æ£éªå·¥å
·åç§°"> |
| | | <j-input |
| | | placeholder="请è¾å
¥æ£éªå·¥å
·åç§°æ£ç´¢" |
| | |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :xl="4" :lg="7" :md="8" :sm="24"> |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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.ruleCode" |
| | | ></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.ruleName" |
| | | ></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.ruleStatus==1" |
| | | status="success" |
| | | /> |
| | | <span |
| | | v-if="record.ruleStatus==1" |
| | | class="success" |
| | | >å¯ç¨</span> |
| | | <a-badge |
| | | v-if="record.ruleStatus==0" |
| | | status="error" |
| | | /> |
| | | <span |
| | | v-if="record.ruleStatus==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.ruleStatus == 0"> |
| | | <a-popconfirm |
| | | title="ç¡®å®å¯ç¨å?" |
| | | @confirm="() => handleActive(record.id)" |
| | | > |
| | | <a>å¯ç¨</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.ruleStatus == 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 --> |
| | | |
| | | <!-- 表ååºå --> |
| | | <sampling-rules-model |
| | | ref="modalForm" |
| | | @ok="modalFormOk" |
| | | ></sampling-rules-model> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | //æéå¼å
¥ ç»ä»¶ |
| | | import SamplingRulesModel from './modules/samplingRules/SamplingRulesModel' |
| | | |
| | | 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: 'SamplingRulesList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | SamplingRulesModel, |
| | | 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: 'ruleCode' |
| | | }, |
| | | { |
| | | title: 'æ½æ ·è§ååç§°', |
| | | align: "center", |
| | | dataIndex: 'ruleName' |
| | | }, |
| | | { |
| | | title: 'æ½æ ·è§ååç±»', |
| | | align: "center", |
| | | dataIndex: 'ruleCategory_dictText' |
| | | }, |
| | | { |
| | | title: 'æ½æ ·æ°é', |
| | | align: "center", |
| | | dataIndex: 'samplingQuantity' |
| | | }, |
| | | { |
| | | title: 'æ¹éä¸éå¼', |
| | | align: "center", |
| | | dataIndex: 'batchUpperLimit' |
| | | }, |
| | | { |
| | | title: 'æ¹éä¸éå¼', |
| | | align: "center", |
| | | dataIndex: 'batchLowerLimit' |
| | | }, |
| | | { |
| | | title: 'æå¤§ä¸åæ ¼æ°', |
| | | align: "center", |
| | | dataIndex: 'maxUnqualifiedQuantity' |
| | | }, |
| | | { |
| | | title: '夿³¨', |
| | | align: 'center', |
| | | dataIndex: 'remark' |
| | | }, |
| | | { |
| | | width: 100, |
| | | title: 'ç¶æ', |
| | | align: 'center', |
| | | scopedSlots: { |
| | | customRender: 'status', |
| | | }, |
| | | dataIndex: 'ruleStatus' |
| | | }, |
| | | { |
| | | width: 150, |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' }, |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/qms/samplingRules/list', |
| | | delete: '/qms/samplingRules/delete', |
| | | active: '/qms/samplingRules/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("请设置url.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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="缺é·ç¼ç " |
| | | > |
| | | <a-input |
| | | :disabled="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥ç¼ºé·ç¼ç " |
| | | v-decorator="['defectCode', validatorRules.defectCode ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="缺é·åç§°" |
| | | > |
| | | <a-input |
| | | :disabled="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥ç¼ºé·åç§°" |
| | | v-decorator="['defectName', validatorRules.defectName ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="缺é·åç±»" |
| | | > |
| | | <j-dict-select-tag |
| | | :disabled="disableSubmit" |
| | | placeholder="请è¾å
¥ç¼ºé·åç±»" |
| | | v-decorator="['defectCategory', validatorRules.defectCategory ]" |
| | | dictCode="defect_category" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="æè¿°" |
| | | > |
| | | <a-textarea :disabled="disableSubmit" placeholder="请è¾å
¥æè¿°" v-decorator="['descreption', validatorRules.descreption ]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import pick from 'lodash.pick' |
| | | import { duplicateCheck } from '@/api/api'//é夿 ¡éª |
| | | import JDictSelectTag from '../../../../components/dict/JDictSelectTag.vue' |
| | | |
| | | export default { |
| | | components: { JDictSelectTag }, |
| | | name: "DefectModal", |
| | | data() { |
| | | return { |
| | | title: "æä½", |
| | | visible: false, |
| | | disableSubmit: false, |
| | | model: {}, |
| | | defectId: "", //ä¿å缺é·id |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | defectCode: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥ç¼ºé·ç¼ç ' }, |
| | | { validator: this.validateNum }, |
| | | ] |
| | | }, |
| | | defectName: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥ç¼ºé·åç§°' }, |
| | | { validator: this.validateName }, |
| | | ] |
| | | }, |
| | | defectCategory: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©ç¼ºé·åç±»' }, |
| | | ] |
| | | }, |
| | | }, |
| | | url: { |
| | | add: "/qms/defect/add", |
| | | edit: "/qms/defect/edit", |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit({}); |
| | | }, |
| | | edit(record) { |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.defectId = record.id; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue( |
| | | pick(this.model, 'defectCode', 'defectName','defectCategory','defectStatus','descreption') |
| | | ) |
| | | }); |
| | | }, |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk() { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if (!this.model.id) { |
| | | httpurl += this.url.add; |
| | | method = 'post'; |
| | | } else { |
| | | httpurl += this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | let formData = Object.assign(this.model, values); |
| | | httpAction(httpurl, formData, method).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | //éªè¯ ç¼å· |
| | | validateNum(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'qms_defect', |
| | | fieldName: 'defect_code', |
| | | fieldVal: value, |
| | | dataId: this.defectId, |
| | | //æ°æ®åºä¸åå¨å段del_flag并使ç¨è¯¥å段ä½ä¸ºæªå é¤çç¥ï¼çå é¤ï¼false åå é¤ï¼true |
| | | delFlag: 'true', |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback(); |
| | | } else { |
| | | callback("缺é·ç¼ç å·²åå¨!"); |
| | | } |
| | | }) |
| | | }, |
| | | //éªè¯ åç§° |
| | | validateName(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'qms_defect', |
| | | fieldName: 'defect_name', |
| | | fieldVal: value, |
| | | dataId: this.defectId, |
| | | //æ°æ®åºä¸åå¨å段del_flag并使ç¨è¯¥å段ä½ä¸ºæªå é¤çç¥ï¼çå é¤ï¼false åå é¤ï¼true |
| | | delFlag: 'true', |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback(); |
| | | } else { |
| | | callback("缺é·åç§°å·²åå¨!"); |
| | | } |
| | | }) |
| | | }, |
| | | // å
³éå¼¹çªæ¶æ¸
é¤è¡¨åæ ¡éª |
| | | removeValidate() { |
| | | if (this.$refs.form) this.$refs.form.clearValidate() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-btn { |
| | | padding: 0 10px; |
| | | margin-left: 3px; |
| | | } |
| | | |
| | | .ant-form-item-control { |
| | | line-height: 0px; |
| | | } |
| | | |
| | | /** 主表åè¡é´è· */ |
| | | .ant-form .ant-form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | /** Tab页é¢è¡é´è· */ |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | </style> |
| | |
| | | :wrapperCol="wrapperCol" |
| | | label="æµéå·¥å
·" |
| | | > |
| | | <a-input |
| | | :disabled="disableSubmit" |
| | | allow-clear |
| | | placeholder="è¯·éæ©æµéå·¥å
·" |
| | | v-decorator="['inspectionTools', validatorRules.inspectionTools ]" |
| | | /> |
| | | <j-select-multi-inspection-tools |
| | | :disabled="disableSubmit" |
| | | v-decorator="['inspectionTools', validatorRules.inspectionTools ]" |
| | | valueKey="id"> |
| | | </j-select-multi-inspection-tools> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import pick from 'lodash.pick' |
| | | import { duplicateCheck } from '@/api/api'//é夿 ¡éª |
| | | import JSelectMultiInspectionTools from './JSelectMultiInspectionTools' |
| | | |
| | | export default { |
| | | name: "InspectionItemModal", |
| | | components: {JSelectMultiInspectionTools}, |
| | | data() { |
| | | return { |
| | | title: "æä½", |
| | |
| | | //éªè¯ åç§° |
| | | validateName(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'qms_inspection_items', |
| | | tableName: 'qms_inspection_item', |
| | | fieldName: 'item_name', |
| | | fieldVal: value, |
| | | dataId: this.inspectionItemId, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- å®ä¹å¨è¿éç忰齿¯ä¸å¯å¨å¤é¨è¦ççï¼é²æ¢åºç°é®é¢ --> |
| | | <j-select-biz-component |
| | | :value="value" |
| | | :ellipsisLength="25" |
| | | :listUrl="url.list" |
| | | :columns="columns" |
| | | v-on="$listeners" |
| | | v-bind="attrs" |
| | | /> |
| | | </template> |
| | | |
| | | <script> |
| | | import JDate from '@comp/jeecg/JDate' |
| | | import JSelectBizComponent from '../../../../components/jeecgbiz/JSelectBizComponent' |
| | | |
| | | export default { |
| | | name: 'JSelectMultiInspectionTools', |
| | | components: {JDate, JSelectBizComponent}, |
| | | props: { |
| | | value: null, // any type |
| | | queryConfig: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | url: { list: '/qms/inspectionTools/list' }, |
| | | columns: [ |
| | | { title: 'å·¥å
·ç¼ç ', align: 'center', width: '25%', widthRight: '70%', dataIndex: 'toolCode' }, |
| | | { title: 'å·¥å
·åç§°', align: 'center', width: '25%', dataIndex: 'toolName' }, |
| | | { title: 'å·¥å
·ç¶æ', align: 'center', width: '20%', dataIndex: 'toolStatus' }, |
| | | { title: '夿³¨', align: 'center', width: '20%', dataIndex: 'remark' } |
| | | ], |
| | | // å®ä¹å¨è¿éç忰齿¯å¯ä»¥å¨å¤é¨ä¼ éè¦ççï¼å¯ä»¥æ´çµæ´»çå®å¶å使ç¨çç»ä»¶ |
| | | default: { |
| | | name: 'å·¥å
·', |
| | | width: 1200, |
| | | displayKey: 'toolCode', |
| | | returnKeys: ['id', 'toolName'], |
| | | queryParamText: 'å·¥å
·ç¼ç ', |
| | | }, |
| | | // 夿¡ä»¶æ¥è¯¢é
ç½® |
| | | queryConfigDefault: [ |
| | | { |
| | | key: 'toolName', |
| | | label: 'æ£éªå·¥å
·åç§°', |
| | | }, |
| | | ], |
| | | } |
| | | }, |
| | | computed: { |
| | | attrs() { |
| | | return Object.assign(this.default, this.$attrs, { |
| | | queryConfig: this.queryConfigDefault.concat(this.queryConfig) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="è§åç¼ç " |
| | | > |
| | | <a-input |
| | | :disabled="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥è§åç¼ç " |
| | | v-decorator="['ruleCode', validatorRules.ruleCode ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="è§ååç§°" |
| | | > |
| | | <a-input |
| | | :disabled="disableSubmit" |
| | | allow-clear |
| | | placeholder="请è¾å
¥è§ååç§°" |
| | | v-decorator="['ruleName', validatorRules.ruleName ]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{ span: 3 }" |
| | | :wrapperCol="{ span: 21 }" |
| | | label="è§ååç±»" |
| | | > |
| | | <j-dict-select-tag |
| | | :disabled="disableSubmit" |
| | | placeholder="请è¾å
¥è§ååç±»" |
| | | v-decorator="['ruleCategory', validatorRules.ruleCategory ]" |
| | | dictCode="rule_category" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="æ½æ ·æ°é" |
| | | > |
| | | <a-input-number :disabled="disableSubmit" v-decorator="['samplingQuantity', validatorRules.samplingQuantity ]" :min="1" style="width: 100%" placeholder="请è¾å
¥æ½æ ·æ°é" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="æå¤§ä¸åæ ¼æ°" |
| | | > |
| | | <a-input-number :disabled="disableSubmit" v-decorator="['maxUnqualifiedQuantity', validatorRules.maxUnqualifiedQuantity ]" :min="1" style="width: 100%" placeholder="请è¾å
¥æå¤§ä¸åæ ¼æ°" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="æ¹éä¸éå¼" |
| | | > |
| | | <a-input-number :disabled="disableSubmit" v-decorator="['batchLowerLimit', validatorRules.batchLowerLimit ]" :min="1" style="width: 100%" placeholder="请è¾å
¥æ¹éä¸éå¼" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="æ¹éä¸éå¼" |
| | | > |
| | | <a-input-number :disabled="disableSubmit" v-decorator="['batchUpperLimit', validatorRules.batchUpperLimit ]" :min="1" style="width: 100%" placeholder="请è¾å
¥æ¹éä¸éå¼" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item |
| | | :labelCol="{ span: 3 }" |
| | | :wrapperCol="{ span: 21 }" |
| | | label="夿³¨" |
| | | > |
| | | <a-textarea :disabled="disableSubmit" placeholder="请è¾å
¥å¤æ³¨" v-decorator="['remark', validatorRules.remark ]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </a-spin> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction, getAction } from '@/api/manage' |
| | | import pick from 'lodash.pick' |
| | | import { duplicateCheck } from '@/api/api'//é夿 ¡éª |
| | | import JDictSelectTag from '../../../../components/dict/JDictSelectTag.vue' |
| | | |
| | | export default { |
| | | components: { JDictSelectTag }, |
| | | name: "SamplingRulesModal", |
| | | data() { |
| | | return { |
| | | title: "æä½", |
| | | visible: false, |
| | | disableSubmit: false, |
| | | model: {}, |
| | | samplingRulesId: "", //ä¿åæ½æ ·è§åid |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | ruleCode: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥è§åç¼ç ' }, |
| | | { validator: this.validateNum }, |
| | | ] |
| | | }, |
| | | ruleName: { |
| | | rules: [ |
| | | { required: true, message: '请è¾å
¥è§ååç§°' }, |
| | | { validator: this.validateName }, |
| | | ] |
| | | }, |
| | | ruleCategory: { |
| | | rules: [ |
| | | { required: true, message: 'è¯·éæ©è§ååç±»' }, |
| | | ] |
| | | }, |
| | | }, |
| | | url: { |
| | | add: "/qms/samplingRules/add", |
| | | edit: "/qms/samplingRules/edit", |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit({}); |
| | | }, |
| | | edit(record) { |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.samplingRulesId = record.id; |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue( |
| | | pick(this.model, 'ruleCode', 'ruleName','ruleCategory','ruleStatus','maxUnqualifiedQuantity', |
| | | 'samplingQuantity','batchLowerLimit','batchUpperLimit', 'remark') |
| | | ) |
| | | }); |
| | | }, |
| | | close() { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk() { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if (!this.model.id) { |
| | | httpurl += this.url.add; |
| | | method = 'post'; |
| | | } else { |
| | | httpurl += this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | let formData = Object.assign(this.model, values); |
| | | httpAction(httpurl, formData, method).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | //éªè¯ ç¼å· |
| | | validateNum(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'qms_sampling_rules', |
| | | fieldName: 'rule_code', |
| | | fieldVal: value, |
| | | dataId: this.samplingRulesId, |
| | | //æ°æ®åºä¸åå¨å段del_flag并使ç¨è¯¥å段ä½ä¸ºæªå é¤çç¥ï¼çå é¤ï¼false åå é¤ï¼true |
| | | delFlag: 'true', |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback(); |
| | | } else { |
| | | callback("è§åç¼ç å·²åå¨!"); |
| | | } |
| | | }) |
| | | }, |
| | | //éªè¯ åç§° |
| | | validateName(rule, value, callback) { |
| | | var params = { |
| | | tableName: 'qms_sampling_rules', |
| | | fieldName: 'rule_name', |
| | | fieldVal: value, |
| | | dataId: this.samplingRulesId, |
| | | //æ°æ®åºä¸åå¨å段del_flag并使ç¨è¯¥å段ä½ä¸ºæªå é¤çç¥ï¼çå é¤ï¼false åå é¤ï¼true |
| | | delFlag: 'true', |
| | | }; |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback(); |
| | | } else { |
| | | callback("è§ååç§°å·²åå¨!"); |
| | | } |
| | | }) |
| | | }, |
| | | // å
³éå¼¹çªæ¶æ¸
é¤è¡¨åæ ¡éª |
| | | removeValidate() { |
| | | if (this.$refs.form) this.$refs.form.clearValidate() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-btn { |
| | | padding: 0 10px; |
| | | margin-left: 3px; |
| | | } |
| | | |
| | | .ant-form-item-control { |
| | | line-height: 0px; |
| | | } |
| | | |
| | | /** 主表åè¡é´è· */ |
| | | .ant-form .ant-form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | /** Tab页é¢è¡é´è· */ |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | </style> |