| | |
| | | <a-icon type="down" /> |
| | | </a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-menu-item v-if="record.supplierStatus==1"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | |
| | | <a-icon type="down" /> |
| | | </a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-menu-item v-if="record.warehouseStatus==1"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | |
| | | :ok=false |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | :maskClosable="false" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | |
| | | :title="title" |
| | | :width="1000" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | :maskClosable="false" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é" |
| | |
| | | :title="title" |
| | | :width="1000" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | |
| | | <template> |
| | | <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" @cancel="handleCancel" cancelText="å
³é"> |
| | | <a-modal |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row :gutter="24"> |
| | |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | :maskClosable="false" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | |
| | | <a-icon type="down" /> |
| | | </a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-menu-item v-if="record.defectStatus==1"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | |
| | | <a-icon type="down" /> |
| | | </a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-menu-item v-if="record.itemStatus==1"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :md="6" :sm="8"> |
| | | <a-form-item label="æ£éªæ¹æ¡ç¼ç "> |
| | | <a-input placeholder="请è¾å
¥æ£éªæ¹æ¡ç¼ç " v-model="queryParam.planCode" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="6" :sm="8"> |
| | | <a-form-item label="æ£éªæ¹æ¡åç±»"> |
| | | <j-search-select-tag |
| | | placeholder="è¯·éæ©æ£éªæ¹æ¡åç±»" |
| | | v-model="queryParam.planCategory" |
| | | dict="plan_category" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="6" :sm="8"> |
| | | <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 --> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :customRow="customRow" |
| | | :rowClassName="tableRowClass" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}" |
| | | @change="handleTableChange" |
| | | > |
| | | <!--ç¶ææ 个æ§å±ç¤º--> |
| | | <span |
| | | slot="status" |
| | | slot-scope="text,record" |
| | | > |
| | | <a-badge |
| | | v-if="record.planStatus==1" |
| | | status="success" |
| | | /> |
| | | <span |
| | | v-if="record.planStatus==1" |
| | | class="success" |
| | | >å¯ç¨</span> |
| | | <a-badge |
| | | v-if="record.planStatus==0" |
| | | status="error" |
| | | /> |
| | | <span |
| | | v-if="record.planStatus==0" |
| | | class="error" |
| | | >ç¦ç¨</span> |
| | | </span> |
| | | <span |
| | | slot="publishStatus" |
| | | slot-scope="text,record" |
| | | > |
| | | <a-badge |
| | | v-if="record.publishStatus==1" |
| | | status="success" |
| | | /> |
| | | <span |
| | | v-if="record.publishStatus==1" |
| | | class="success" |
| | | >å·²åå¸</span> |
| | | <a-badge |
| | | v-if="record.publishStatus==0" |
| | | status="error" |
| | | /> |
| | | <span |
| | | v-if="record.publishStatus==0" |
| | | class="error" |
| | | >å¾
åå¸</span> |
| | | </span> |
| | | <span |
| | | slot="version" |
| | | slot-scope="text,record" |
| | | > |
| | | <span |
| | | v-if="record.planStatus==1" |
| | | class="success" |
| | | >{{record.version}}</span> |
| | | <span |
| | | v-if="record.planStatus==0" |
| | | class="error" |
| | | >{{record.version}}</span> |
| | | </span> |
| | | <span |
| | | slot="action" |
| | | slot-scope="text, record" |
| | | v-if="record.isNewVersion == 1" |
| | | > |
| | | <a-popconfirm |
| | | v-if="record.publishStatus == 0 && record.planStatus == 1" |
| | | title="ç¡®å®åå¸å?" |
| | | @confirm="() => handlePublish(record.id)" |
| | | > |
| | | <a>åå¸</a> |
| | | </a-popconfirm> |
| | | <a-popconfirm |
| | | v-if="record.publishStatus == 1 && record.planStatus == 1" |
| | | title="ç¡®å®åæ¶åå¸å?" |
| | | @confirm="() => handlePublish(record.id)" |
| | | > |
| | | <a>åæ¶åå¸</a> |
| | | </a-popconfirm> |
| | | <a-divider type="vertical" v-if="record.publishStatus == 1 && record.planStatus == 1"/> |
| | | <a-popconfirm |
| | | v-if="record.publishStatus == 1 && record.planStatus == 1" |
| | | title="ç¡®å®åçå?" |
| | | @confirm="() => handleVersion(record.id)" |
| | | > |
| | | <a>åç</a> |
| | | </a-popconfirm> |
| | | <a-divider type="vertical" v-if="record.planStatus == 1"/> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ |
| | | <a-icon type="down" /> |
| | | </a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item v-if="record.planStatus==1 && record.publishStatus==0"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a |
| | | href="javascript:;" |
| | | @click="handleDetail(record)" |
| | | >详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.publishStatus==0"> |
| | | <a-popconfirm |
| | | title="ç¡®å®å é¤å?" |
| | | @confirm="() => handleDelete(record.id)" |
| | | > |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.planStatus == 0"> |
| | | <a-popconfirm |
| | | title="ç¡®å®å¯ç¨å?" |
| | | @confirm="() => handleActive(record.id)" |
| | | > |
| | | <a>å¯ç¨</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.planStatus == 1 && record.publishStatus == 0"> |
| | | <a-popconfirm |
| | | title="ç¡®å®ç¦ç¨å?" |
| | | @confirm="() => handleActive(record.id)" |
| | | > |
| | | <a>ç¦ç¨</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | </a-table> |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane tab="æ£éªæ¹æ¡æ£éªé¡¹æç»" key="1"> |
| | | <inspection-plan-item-list ref="inspectionPlanItemList"></inspection-plan-item-list> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <!-- tableåºå-end --> |
| | | <inspection-plan-model ref="modalForm" @ok="modalFormOk"></inspection-plan-model> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import InspectionPlanModel from './modules/inspectionPlan/InspectionPlanModel' |
| | | import InspectionPlanItemList from './modules/inspectionPlan/InspectionPlanItemList' |
| | | import { requestPut,postAction,getAction } from '@/api/manage' |
| | | import JDictSelectTag from '@/components/dict/JDictSelectTag' |
| | | import JSearchSelectTag from '@/components/dict/JSearchSelectTag' |
| | | |
| | | export default { |
| | | name: 'InspectionPlanList', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | InspectionPlanModel, |
| | | InspectionPlanItemList, |
| | | JDictSelectTag, |
| | | JSearchSelectTag, |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'æ£éªæ¹æ¡', |
| | | url: { |
| | | list: '/qms/inspectionPlan/list', |
| | | importExcelUrl: '/qms/inspectionPlan/importExcel', |
| | | exportXlsUrl: '/qms/inspectionPlan/exportXls', |
| | | edit:'/qms/inspectionPlan/edit', |
| | | submit:'/qms/inspectionPlan/submit', |
| | | active: '/qms/inspectionPlan/active', |
| | | publish:'/qms/inspectionPlan/publish', |
| | | version:'/qms/inspectionPlan/version' |
| | | }, |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | }, |
| | | { |
| | | title: 'æ£éªæ¹æ¡ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'planCode', |
| | | sorter: true, |
| | | }, |
| | | { |
| | | title: 'æ£éªæ¹æ¡åç§°', |
| | | align: 'center', |
| | | dataIndex: 'planName', |
| | | }, |
| | | { |
| | | title: 'æ£éªæ¹æ¡åç±»', |
| | | align: 'center', |
| | | dataIndex: 'planCategory_dictText', |
| | | }, |
| | | { |
| | | title: 'ç©æç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'materialNumber', |
| | | }, |
| | | { |
| | | title: 'ç©æåç§°', |
| | | align: 'center', |
| | | dataIndex: 'materialName', |
| | | }, |
| | | { |
| | | title: 'æ½æ ·è§å', |
| | | align: 'center', |
| | | dataIndex: 'ruleId_dictText', |
| | | }, |
| | | { |
| | | title: 'æ¹æ¡æè¿°', |
| | | align: 'center', |
| | | dataIndex: 'descreption', |
| | | }, |
| | | { |
| | | title: 'çæ¬', |
| | | align: 'center', |
| | | scopedSlots: { |
| | | customRender: 'version', |
| | | }, |
| | | dataIndex: 'version', |
| | | }, |
| | | { |
| | | title: 'æ¹æ¡ç¶æ', |
| | | align: 'center', |
| | | scopedSlots: { |
| | | customRender: 'status', |
| | | }, |
| | | dataIndex: 'planStatus', |
| | | }, |
| | | { |
| | | title: 'åå¸ç¶æ', |
| | | align: 'center', |
| | | scopedSlots: { |
| | | customRender: 'publishStatus', |
| | | }, |
| | | dataIndex: 'publishStatus', |
| | | }, |
| | | { |
| | | width: 180, |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' }, |
| | | }, |
| | | ], |
| | | loading:false |
| | | } |
| | | }, |
| | | computed: { |
| | | /* 导å
¥è·¯å¾é¡µé¢éæ°è®¡ç® */ |
| | | importExcelUrl: function () { |
| | | // return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;//å¼åç¯å¢æå |
| | | return `${window._CONFIG['hxFileURL']}/${this.url.importExcelUrl}` |
| | | }, |
| | | }, |
| | | methods: { |
| | | searchQuery(){ |
| | | this.selectedRowKeys = [] |
| | | this.$refs.inspectionPlanItemList.dataSource = [] |
| | | this.loadData(1); |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.selectedRowKeys = [] |
| | | this.$refs.inspectionPlanItemList.dataSource = [] |
| | | this.loadData(1); |
| | | }, |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | | click: (e) => { |
| | | this.onSelectChange(record.id.split(","), [record]); |
| | | }, |
| | | }, |
| | | } |
| | | }, |
| | | onSelectChange(selectedRowKeys, selectionRows) { |
| | | this.selectedRowKeys = selectedRowKeys; |
| | | this.selectionRows = selectionRows; |
| | | //å°å½åéä¸çè®°å½ä¼ å°åé¡µé¢ |
| | | this.$bus.$emit('getInspectionPlanItemData', this.selectionRows[0]) |
| | | }, |
| | | handleEdit: function (record) { |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = 'ç¼è¾' |
| | | this.$refs.modalForm.disableSubmit = false |
| | | }, |
| | | handleAdd() { |
| | | this.$refs.modalForm.add() |
| | | this.$refs.modalForm.title = 'æ°å¢' |
| | | this.$refs.modalForm.disableSubmit = false |
| | | }, |
| | | handleSubmit(record) { |
| | | let that = this; |
| | | that.loading = true |
| | | getAction(that.url.submit, { id:record.id}).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.loading = false |
| | | }) |
| | | }, |
| | | //å¯ç¨ç¦ç¨ |
| | | 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); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | //åå¸ |
| | | handlePublish(id) { |
| | | if (!this.url.publish) { |
| | | this.$message.error("请设置url.publish!") |
| | | return |
| | | } |
| | | let that = this; |
| | | requestPut(that.url.publish, {}, { id: id }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | //åç |
| | | handleVersion(id) { |
| | | if (!this.url.version) { |
| | | this.$message.error("请设置url.version!") |
| | | return |
| | | } |
| | | let that = this; |
| | | requestPut(that.url.version, {}, { id: id }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message); |
| | | that.loadData(); |
| | | } else { |
| | | that.$message.warning(res.message); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | tableRowClass(record, index) { |
| | | if (record.isNewVersion != '1') { |
| | | return "frozenRowClass"; |
| | | } |
| | | return ""; |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | @import '~@assets/less/common.less'; |
| | | /deep/ .frozenRowClass { |
| | | color: #c9c9c9; |
| | | } |
| | | /deep/ .notshow { |
| | | display: none; |
| | | } |
| | | /deep/ .checked-td-of-add-table { |
| | | background-color: rgba(220, 220, 220, 1); |
| | | } |
| | | </style> |
| | |
| | | <a-icon type="down" /> |
| | | </a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-menu-item v-if="record.toolStatus==1"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | |
| | | <a-icon type="down" /> |
| | | </a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-menu-item v-if="record.ruleStatus==1"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | :maskClosable="false" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card |
| | | :bordered="false" |
| | | class="card-area" |
| | | > |
| | | <a-table |
| | | ref="table" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | @change="handleTableChange" |
| | | > |
| | | </a-table> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { requestPut } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'InspectionPlanItemList', |
| | | mixins: [JeecgListMixin], |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | url: { |
| | | list: '/qms/inspectionItem/queryListByPlanId', |
| | | }, |
| | | queryParam: {}, |
| | | nodeType: 0, |
| | | dataSource: [], |
| | | disableMixinCreated:true, |
| | | columns: [ |
| | | { |
| | | title: 'æ£éªé¡¹ç®ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'itemCode', |
| | | width: '10%', |
| | | }, |
| | | { |
| | | title: 'æ£éªé¡¹ç®åç§°', |
| | | dataIndex: 'itemName', |
| | | align: 'center', |
| | | }, |
| | | { |
| | | title: 'æ£éªé¡¹ç®åç±»', |
| | | dataIndex: 'itemCategoryName', |
| | | align: 'center', |
| | | }, |
| | | |
| | | { |
| | | title: 'å®é/宿§', |
| | | dataIndex: 'qualitativeOrQuantitativeName', |
| | | align: 'center', |
| | | }, |
| | | { |
| | | title: 'æµéå·¥å
·', |
| | | dataIndex: 'inspectionToolsNames', |
| | | align: 'center', |
| | | }, |
| | | { |
| | | title: 'æåº', |
| | | dataIndex: 'sorter', |
| | | align: 'center', |
| | | }, |
| | | { |
| | | title: 'æ åå¼', |
| | | dataIndex: 'standardValue', |
| | | align: 'center', |
| | | }, |
| | | { |
| | | title: 'ä¸å
¬å·®', |
| | | dataIndex: 'maxValue', |
| | | align: 'center', |
| | | }, |
| | | { |
| | | title: 'ä¸å
¬å·®', |
| | | dataIndex: 'minValue', |
| | | align: 'center', |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('getInspectionPlanItemData', (data) => { |
| | | this.queryParam.inspectionPlanId = data.id; |
| | | this.searchQuery(); |
| | | }) |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :visible="visible" |
| | | :fullScreen="true" |
| | | :width="1200" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | :maskClosable="false" |
| | | > |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="æ£éªæ¹æ¡ç¼ç "> |
| | | <a-input :disabled="disableSubmit" placeholder="请è¾å
¥æ£éªæ¹æ¡ç¼ç " v-decorator="['planCode', validatorRules.planCode]" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="æ£éªæ¹æ¡åç§°"> |
| | | <a-input :disabled="disableSubmit" placeholder="请è¾å
¥æ£éªæ¹æ¡åç§°" v-decorator="['planName', validatorRules.planName]" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="æ£éªæ¹æ¡åç±»"> |
| | | <j-dict-select-tag |
| | | :disabled="disableSubmit" |
| | | type="list" |
| | | v-decorator="['planCategory', validatorRules.planCategory]" |
| | | :triggerChange="true" |
| | | dictCode="plan_category" |
| | | placeholder="è¯·éæ©æ£éªæ¹æ¡åç±»" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="æ½æ ·è§å"> |
| | | <a-select |
| | | :disabled="disableSubmit" |
| | | :triggerChange="true" |
| | | :options="ruleOptions" |
| | | v-decorator="[ 'ruleId', validatorRules.ruleId ]" |
| | | placeholder='è¯·éæ©æ½æ ·è§å' |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="ç©æç¼ç "> |
| | | <a-input-search v-decorator="['materialNumber', validatorRules.materialNumber]" :disabled="disableSubmit" @search="materialSearch" enter-button |
| | | placeholder='è¯·éæ©ç©æä¿¡æ¯'/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="ç©æåç§°"> |
| | | <a-input :disabled="true" v-decorator="['materialName', validatorRules.materialName]" placeholder='éæ©ç©æåèªå¨å¸¦åº' /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24"> |
| | | <a-form-item :labelCol="{ span: 3 }" :wrapperCol="{ span: 21 }" label="æ¹æ¡æè¿°"> |
| | | <a-textarea |
| | | :disabled="disableSubmit" |
| | | :rows="2" |
| | | placeholder="..." |
| | | v-decorator="['descreption', validatorRules.descreption]" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </a-spin> |
| | | <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectInspectionItemList()" :disabled="disableSubmit">éæ©æ£éªé¡¹ç®</a-button> |
| | | <a-table |
| | | ref="table" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | @change="handleTableChange" |
| | | > |
| | | <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index"> |
| | | <div :key="col.dataIndex"> |
| | | <a-input-number |
| | | :disabled="disableSubmit" |
| | | v-if="col.dataIndex == 'sorter'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | | /> |
| | | </div> |
| | | <div :key="col.dataIndex"> |
| | | <a-input-number |
| | | :disabled="disableSubmit" |
| | | v-if="col.dataIndex == 'standardValue'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="0" |
| | | /> |
| | | </div> |
| | | <div :key="col.dataIndex"> |
| | | <a-input-number |
| | | :disabled="disableSubmit" |
| | | v-if="col.dataIndex == 'maxValue'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="0" |
| | | /> |
| | | </div> |
| | | <div :key="col.dataIndex"> |
| | | <a-input-number |
| | | :disabled="disableSubmit" |
| | | v-if="col.dataIndex == 'minValue'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="0" |
| | | /> |
| | | </div> |
| | | </template> |
| | | <span slot="action" slot-scope="text, record, index"> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record, index)" :disabled="disableSubmit"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </span> |
| | | </a-table> |
| | | <template slot="footer" v-if="disableSubmit == false"> |
| | | <a-button :style="{ marginRight: '8px' }" @click="handleCancel">å
³é</a-button> |
| | | <a-button @click="handleOk" :disabled="isDisabled" type="primary">ç¡®å®</a-button> |
| | | </template> |
| | | |
| | | <template slot="footer" v-if="disableSubmit == true"> |
| | | <a-button :style="{ marginRight: '8px' }" @click="handleCancel">å
³é</a-button> |
| | | </template> |
| | | <j-select-inspection-item-list-modal ref="inspectionItemForm" @ok="modalFormOk"></j-select-inspection-item-list-modal> |
| | | <material-list-modal ref="materialListModel" @sendSelectionRows="getMaterialRows"></material-list-modal> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import pick from 'lodash.pick' |
| | | import { ajaxGetDictItems } from '@/api/api' |
| | | import moment from 'moment' |
| | | import { getAction, postAction, requestPut } from '@/api/manage' |
| | | import JDictSelectTag from '@/components/dict/JDictSelectTag' |
| | | import JSearchSelectTag from '@/components/dict/JSearchSelectTag' |
| | | import JMultiSelectTag from '@/components/dict/JMultiSelectTag' |
| | | import { filterObj } from '@/utils/util' |
| | | import JSelectInspectionItemListModal from './JSelectInspectionItemListModal' |
| | | import store from '@/store' |
| | | import MaterialListModal from './MaterialListModal' |
| | | |
| | | export default { |
| | | name: 'InspectionPlanModel', |
| | | components: { |
| | | JMultiSelectTag, |
| | | JDictSelectTag, |
| | | JSelectInspectionItemListModal, |
| | | JSearchSelectTag, |
| | | store, |
| | | MaterialListModal |
| | | }, |
| | | data() { |
| | | return { |
| | | /* å页忰 */ |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | isDisabled: false, |
| | | selectedRowKeys: {}, |
| | | state: { |
| | | show: false, |
| | | maintenanceValue: 1, |
| | | checkValue: 1, |
| | | maintenanceState: false, |
| | | checkState: false, |
| | | }, |
| | | inboundDate: '', |
| | | applicationDate: '', |
| | | supplierShow: false, |
| | | disableSubmit: false, |
| | | numDisable:false, |
| | | quantityDisable:false, |
| | | onlyCodeDisable:true, |
| | | returnShow:false, |
| | | toolingShow:false, |
| | | sharpenShow:false, |
| | | addDisable:false, |
| | | toolinngOptions:[], |
| | | title: 'æä½', |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | }, |
| | | confirmLoading: false, |
| | | loading: false, |
| | | form: this.$form.createForm(this), |
| | | dataSource: [], |
| | | toolingTreeData:[], |
| | | warehouseOptions:[], |
| | | locationOptions:[], |
| | | allToolingList:[], |
| | | param: {}, |
| | | barcodeCurrentType: false, |
| | | planId:'', |
| | | validatorRules: { |
| | | planCode: { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥æ£éªæ¹æ¡ç¼ç !', |
| | | }, |
| | | ], |
| | | }, |
| | | planName: { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥æ£éªæ¹æ¡åç§°!', |
| | | }, |
| | | ], |
| | | }, |
| | | planCategory: { |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: 'è¯·éæ©æ£éªæ¹æ¡åç±»!', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | url: { |
| | | add: '/qms/inspectionPlan/add', |
| | | edit: '/qms/inspectionPlan/edit', |
| | | inpspectionItemList:'/qms/inspectionItem/list', |
| | | detailList:'/qms/inspectionItem/queryList', |
| | | }, |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | }, |
| | | { |
| | | title: 'æ£éªé¡¹ç®ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'itemCode', |
| | | width: 150, |
| | | }, |
| | | { |
| | | title: 'æ£éªé¡¹ç®åç§°', |
| | | align: 'center', |
| | | dataIndex: 'itemName' |
| | | }, |
| | | { |
| | | title: 'æ£éªé¡¹ç®åç±»', |
| | | align: 'center', |
| | | dataIndex: 'itemCategoryName', |
| | | }, |
| | | { |
| | | title: 'å®é/宿§', |
| | | align: 'center', |
| | | dataIndex: 'qualitativeOrQuantitativeName' |
| | | }, |
| | | { |
| | | title: 'æµéå·¥å
·', |
| | | align: 'center', |
| | | dataIndex: 'inspectionToolsNames', |
| | | }, |
| | | { |
| | | title: 'æåº', |
| | | dataIndex: 'sorter', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'sorter' }, |
| | | }, |
| | | { |
| | | title: 'æ åå¼', |
| | | dataIndex: 'standardValue', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'standardValue' }, |
| | | }, |
| | | { |
| | | title: 'ä¸å
¬å·®', |
| | | dataIndex: 'maxValue', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'maxValue' }, |
| | | }, |
| | | { |
| | | title: 'ä¸å
¬å·®', |
| | | dataIndex: 'minValue', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'minValue' }, |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' }, |
| | | }, |
| | | ], |
| | | ruleOptions:[] |
| | | } |
| | | }, |
| | | created() { |
| | | ajaxGetDictItems("qms_sampling_rules,rule_name,id", null).then((res) => { |
| | | if (res.success) { |
| | | this.ruleOptions = res.result |
| | | } |
| | | }) |
| | | }, |
| | | methods: { |
| | | |
| | | materialSearch() { |
| | | this.$refs.materialListModel.openPage() |
| | | this.$refs.materialListModel.title = 'éæ©ç©æ' |
| | | this.$refs.materialListModel.disableSubmit = false |
| | | }, |
| | | getMaterialRows(val) { |
| | | if (val.materialNumber) { |
| | | const initialData = { |
| | | materialNumber: val.materialNumber, |
| | | materialName: val.materialName |
| | | }; |
| | | this.form.setFieldsValue(initialData); |
| | | } |
| | | |
| | | }, |
| | | handleChange(value, key, column, index) { |
| | | const temp = [...this.dataSource] |
| | | const target = temp.filter(item => key === item.key)[index]; |
| | | if (target) { |
| | | target[column.dataIndex] = value |
| | | this.dataSource = temp |
| | | } |
| | | }, |
| | | modalFormOk() { |
| | | }, |
| | | getQueryParams() { |
| | | this.param.pageNo = this.ipagination.current |
| | | this.param.pageSize = this.ipagination.pageSize |
| | | return filterObj(this.param) |
| | | }, |
| | | add() { |
| | | this.handle = store.getters.userInfo.username |
| | | this.edit({}) |
| | | }, |
| | | edit(record) { |
| | | let that = this |
| | | this.form.resetFields() |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.isDisabled = false |
| | | this.disableSubmit = false |
| | | if (record.id) { |
| | | this.planId = record.id |
| | | this.detailList(this.planId) |
| | | } |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue( |
| | | pick(this.model, 'planCode', 'planName', 'planCategory', 'materialNumber', 'materialName','ruleId','planStatus','descreption') |
| | | ) |
| | | }) |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.dataSource = [] |
| | | this.visible = false |
| | | this.supplierShow = false, |
| | | this.disableSubmit = false, |
| | | this.numDisable = false, |
| | | this.quantityDisable = false, |
| | | this.onlyCodeDisable = true, |
| | | this.returnShow = false, |
| | | this.toolingShow = false, |
| | | this.sharpenShow = false, |
| | | this.addDisable = false |
| | | }, |
| | | handleTableChange(pagination, filters, sorter) { |
| | | this.ipagination = pagination |
| | | this.detailList(this.planId); |
| | | }, |
| | | handleOk() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true |
| | | let formData = Object.assign(this.model, values) |
| | | formData.detailData = this.dataSource |
| | | let http = '' |
| | | if(this.model.id){ |
| | | http = this.url.edit |
| | | }else{ |
| | | http = this.url.add |
| | | } |
| | | postAction(http, formData) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.$emit('ok', new Date()) |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | //鿩工å
· |
| | | selectInspectionItemList: function () { |
| | | let ids = [] |
| | | for (let i = 0; i < this.dataSource.length; i++) { |
| | | ids.push(this.dataSource[i].id) |
| | | } |
| | | this.$refs.inspectionItemForm.showModal(ids) |
| | | this.$refs.inspectionItemForm.title = 'éæ©æ£éªé¡¹ç®' |
| | | this.$refs.inspectionItemForm.disableSubmit = false |
| | | }, |
| | | handleDelete(record, index) { |
| | | this.dataSource.splice(index, 1) |
| | | }, |
| | | onChange() {}, |
| | | //æé人åå¼ |
| | | selectCurrentUserChange(e) { |
| | | console.log('å½åæé', e) |
| | | // this.form.setFieldsValue({ |
| | | // // userName: e, |
| | | // userNameId: e, |
| | | // }) |
| | | }, |
| | | detailList(planId) { |
| | | this.param.planId = planId |
| | | getAction(this.url.detailList, this.getQueryParams()).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records |
| | | this.ipagination.total = res.result.total; |
| | | } |
| | | }) |
| | | }, |
| | | filterOption(input, option) { |
| | | return ( |
| | | option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 |
| | | ); |
| | | }, |
| | | }, |
| | | watch: {}, |
| | | mounted() { |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | //getCurrSelected äºä»¶ æ¥æ¶ç»ä»¶ä¼ éçåæ° |
| | | for (let i = 0; i < data.length; i++) { |
| | | this.dataSource.push({ |
| | | id:data[i].id, |
| | | itemCode: data[i].itemCode, |
| | | itemName: data[i].itemName, |
| | | inspectionTools: data[i].inspectionTools, |
| | | inspectionToolsNames: data[i].inspectionToolsNames, |
| | | itemCategory: data[i].itemCategory, |
| | | itemCategoryName:data[i].itemCategoryName, |
| | | itemStatus:data[i].itemStatus, |
| | | qualitativeOrQuantitative:data[i].qualitativeOrQuantitative, |
| | | qualitativeOrQuantitativeName:data[i].qualitativeOrQuantitativeName |
| | | }) |
| | | } |
| | | //this.ipaginationm.total = this.dataSource.length |
| | | }) |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | |
| | | <style lang="less" 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; |
| | | } |
| | | |
| | | /deep/ .notshow { |
| | | display: none; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!--æ¯æå
¨å±ç¼©æ¾--> |
| | | <j-modal |
| | | :visible="visible" |
| | | :title="title" |
| | | switchFullscreen |
| | | :maskClosable="false" |
| | | :width="1200" |
| | | @ok="handleSubmit" |
| | | @cancel="close" |
| | | style="top: 50px" |
| | | cancelText="å
³é" |
| | | > |
| | | <a-card :bordered="false"> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æ£éªé¡¹ç®ç¼ç "> |
| | | <a-input placeholder="请è¾å
¥æ£éªé¡¹ç®ç¼ç ,æ¯ææ¨¡ç³æ¥è¯¢" v-model="queryParam.itemCode"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æ£éªé¡¹ç®åç§°"> |
| | | <a-input placeholder="请è¾å
¥æ£éªé¡¹ç®åç§°,æ¯ææ¨¡ç³æ¥è¯¢" v-model="queryParam.itemName"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="æ£éªé¡¹ç®åç±»"> |
| | | <j-search-select-tag |
| | | placeholder="è¯·éæ©æ£éªé¡¹ç®åç±»" |
| | | v-model="queryParam.itemCategory" |
| | | dict="item_category" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <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-row> |
| | | </a-form> |
| | | </div> |
| | | <!--æ£éªé¡¹ç®å表--> |
| | | <a-table |
| | | ref="table" |
| | | :scroll="scrollTrigger" |
| | | size="middle" |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :rowSelection="rowSelection" |
| | | :loading="loading" |
| | | @change="handleTableChange" |
| | | > |
| | | </a-table> |
| | | </a-card> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { filterObj } from '@/utils/util' |
| | | import { getAction } from '@/api/manage' |
| | | import JDictSelectTag from '@/components/dict/JDictSelectTag' |
| | | import JSearchSelectTag from '@/components/dict/JSearchSelectTag' |
| | | |
| | | export default { |
| | | name: 'JSelectInspectionItemListModal', |
| | | components: {JDictSelectTag,JSearchSelectTag}, |
| | | props: { |
| | | }, |
| | | data() { |
| | | return { |
| | | queryParam: {}, |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | }, |
| | | { |
| | | title: 'æ£éªé¡¹ç®ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'itemCode', |
| | | }, |
| | | { |
| | | title: 'æ£éªé¡¹ç®åç§°', |
| | | align: 'center', |
| | | dataIndex: 'itemName', |
| | | }, |
| | | { |
| | | title: 'æ£éªé¡¹ç®åç±»', |
| | | align: 'center', |
| | | dataIndex: 'itemCategoryName', |
| | | }, |
| | | { |
| | | title: 'å®é/宿§', |
| | | align: 'center', |
| | | dataIndex: 'qualitativeOrQuantitativeName', |
| | | }, |
| | | { |
| | | title: 'æµéå·¥å
·', |
| | | align: 'center', |
| | | dataIndex: 'inspectionToolsNames', |
| | | } |
| | | ], |
| | | selectedRowKeys: [], |
| | | oldSlelectRows: [], |
| | | scrollTrigger: {}, |
| | | dataSource: [], |
| | | selectionRows: [], |
| | | title: 'æ ¹æ®æ¥è¯¢ç»æéæ©æ£éªé¡¹ç®', |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['5', '10', '20'], |
| | | showTotal: (total, range) => { |
| | | return range[0] + '-' + range[1] + ' å
±' + total + 'æ¡' |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0, |
| | | }, |
| | | departTree: [], |
| | | visible: false, |
| | | loading: false, |
| | | url: { |
| | | list: '/qms/inspectionItem/queryList', |
| | | }, |
| | | } |
| | | }, |
| | | computed: { |
| | | rowSelection() { |
| | | return { |
| | | type: 'checkbox', |
| | | onChange: (selectedRowKeys, selectedRows) => { |
| | | this.selectedRowKeys = selectedRowKeys |
| | | this.onSelectChange(selectedRows) |
| | | }, |
| | | getCheckboxProps: (record) => ({ |
| | | props: { |
| | | disabled: record.distable, |
| | | }, |
| | | }), |
| | | selectedRowKeys: this.selectedRowKeys, |
| | | } |
| | | }, |
| | | }, |
| | | watch: {}, |
| | | created() {}, |
| | | methods: { |
| | | async loadData(arg) { |
| | | if (arg === 1) { |
| | | this.ipagination.current = 1 |
| | | } |
| | | let that = this |
| | | this.loading = true |
| | | let params = this.getQueryParams() //æ¥è¯¢æ¡ä»¶ |
| | | await getAction(this.url.list, params).then((res) => { |
| | | if (res.success) { |
| | | for (let i = 0; i < res.result.records.length; i++) { |
| | | if (that.oldSlelectRows.indexOf(res.result.records[i].id) > -1) { |
| | | res.result.records[i].distable = true |
| | | } else { |
| | | res.result.records[i].distable = false |
| | | } |
| | | } |
| | | this.dataSource = res.result.records |
| | | this.ipagination.total = res.result.total |
| | | } |
| | | if (res.code === 510) { |
| | | this.$message.warning(res.message) |
| | | } |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | showModal(oldSlelectRows) { |
| | | this.oldSlelectRows = oldSlelectRows |
| | | this.visible = true |
| | | this.loadData(1) |
| | | }, |
| | | getQueryParams() { |
| | | let param = Object.assign({}, this.queryParam) |
| | | param.field = this.getQueryField() |
| | | param.pageNo = this.ipagination.current |
| | | param.pageSize = this.ipagination.pageSize |
| | | return filterObj(param) |
| | | }, |
| | | //æ¥è¯¢æ¡ä»¶å¤ç |
| | | getQueryField() { |
| | | let str = 'id,' |
| | | for (let a = 0; a < this.columns.length; a++) { |
| | | str += ',' + this.columns[a].dataIndex |
| | | } |
| | | return str |
| | | }, |
| | | searchReset(num) { |
| | | let that = this |
| | | if (num !== 0) { |
| | | that.loadData(1) |
| | | } |
| | | that.selectborrowIds = [] |
| | | }, |
| | | close() { |
| | | this.searchReset(0) |
| | | this.selectedRowKeys = [] |
| | | this.visible = false |
| | | }, |
| | | handleTableChange(pagination, filters, sorter) { |
| | | //TODO çé |
| | | // if (Object.keys(sorter).length > 0) { |
| | | // this.isorter.column = sorter.field |
| | | // this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc' |
| | | // } |
| | | this.ipagination = pagination |
| | | this.loadData() |
| | | }, |
| | | handleSubmit() { |
| | | this.$bus.$emit('selectionRows', this.selectionRows) |
| | | this.searchReset(0) |
| | | this.close() |
| | | }, |
| | | onSelectChange(selectionRows) { |
| | | this.selectionRows = selectionRows |
| | | }, |
| | | onSearch() { |
| | | this.loadData(1) |
| | | }, |
| | | searchQuery() { |
| | | this.loadData(1); |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.loadData(1) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .ant-table-tbody .ant-table-row td { |
| | | padding-top: 10px; |
| | | padding-bottom: 10px; |
| | | } |
| | | |
| | | #components-layout-demo-custom-trigger .trigger { |
| | | font-size: 18px; |
| | | line-height: 64px; |
| | | padding: 0 24px; |
| | | cursor: pointer; |
| | | transition: color 0.3s; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal :title="title" :width="1000" :visible="visible" :maskClosable="false" @ok="handleOk" @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :md="9" :sm="9"> |
| | | <a-form-item label="ç©æç¼ç "> |
| | | <a-input placeholder="请è¾å
¥ç©æç¼ç " v-model="queryParam.materialNumber"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="9" :sm="9"> |
| | | <a-form-item label="ç©æåç§°"> |
| | | <a-input placeholder="请è¾å
¥ç©æåç§°" v-model="queryParam.materialName"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="3" :sm="3"> |
| | | <a-space> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload">éç½®</a-button> |
| | | </a-space> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <a-table bordered rowKey="materialNumber" :scroll="{Â y: 300Â }" :columns="columns" |
| | | :dataSource="dataSource" :pagination="ipagination" :loading="loading" :customRow="customRow" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'radio'}" |
| | | @change="handleTableChange"> |
| | | </a-table> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | </a-card> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'MaterialListModal', |
| | | mixins: [JeecgListMixin], |
| | | data() { |
| | | return { |
| | | title: '', |
| | | visible: false, |
| | | disableMixinCreated: true, |
| | | columns: [ |
| | | { |
| | | title: 'ç©æç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'materialNumber' |
| | | }, |
| | | { |
| | | title: 'ç©æåç§°', |
| | | align: 'center', |
| | | dataIndex: 'materialName' |
| | | }, |
| | | { |
| | | title: 'ç©æåå·', |
| | | align: 'center', |
| | | dataIndex: 'materialModel' |
| | | }, |
| | | { |
| | | title: 'ç©æç±»å', |
| | | align: 'center', |
| | | dataIndex: 'materialCategory' |
| | | }, |
| | | { |
| | | title: 'åä½', |
| | | align: 'center', |
| | | dataIndex: 'materialUnit' |
| | | } |
| | | ], |
| | | /* æåºåæ° */ |
| | | isorter: { |
| | | column: '', |
| | | order: '' |
| | | }, |
| | | url: { |
| | | list: '/lswmaterial/lswMaterial/list' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | openPage() { |
| | | this.visible = true |
| | | this.onClearSelected() |
| | | this.dataSource = [] |
| | | this.loadData() |
| | | }, |
| | | |
| | | /** |
| | | * èªå®ä¹è¡¨æ ¼è¡ |
| | | * @param record è¡¨æ ¼è¡ä¿¡æ¯ |
| | | * @returns {{style: {cursor: string}, on: {click: on.click}}} |
| | | */ |
| | | customRow(record) { |
| | | return { |
| | | style: { |
| | | cursor: 'pointer' |
| | | }, |
| | | on: { |
| | | click: () => { |
| | | this.onSelectChange([record.materialNumber], [record]) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | |
| | | handleOk() { |
| | | this.$emit('sendSelectionRows', this.selectionRows[0]) |
| | | this.close() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
| | |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | :maskClosable="false" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | |
| | | :width="800" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | :maskClosable="false" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |