feat(cms): 选择刀具库存替代刀具信息
- 新增 JSelectInventoryModal 组件用于选择刀具库存
- 在 CuttingReceiveModal 中集成新组件,替换原有的 JSelectToolingModal
- 更新 CuttingReceiveDetailList 中的字段,增加刀具编码和刀具名称
- 调整 CuttingReceiveList 的样式和布局
| | |
| | | deleteBatch: "/cms/cuttingReceiveDetail/deleteBatch", |
| | | exportXlsUrl: "/cms/cuttingReceiveDetail/exportXls", |
| | | importExcelUrl: "cms/cuttingReceiveDetail/importExcel", |
| | | |
| | | |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | |
| | | let fieldList=[]; |
| | | fieldList.push({type:'string',value:'orderId',text:'é¢ç¨åID'}) |
| | | fieldList.push({type:'string',value:'cuttingId',text:'åå
·ID'}) |
| | | fieldList.push({type:'string',value:'cuttingCode',text:'åå
·ç¼ç '}) // æ·»å è¿ä¸è¡ |
| | | fieldList.push({type:'string',value:'cuttingName',text:'åå
·åç§°'}) // æ·»å è¿ä¸è¡ |
| | | fieldList.push({type:'string',value:'inventoryId',text:'åºåID'}) |
| | | fieldList.push({type:'string',value:'workpieceMaterial',text:'工件æè´¨'}) |
| | | fieldList.push({type:'int',value:'usedLife',text:'使ç¨å¯¿å½'}) |
| | |
| | | <a-col :md="6" :sm="8"> |
| | | <a-form-item label="é¢ç¨åç¶æ"> |
| | | <j-search-select-tag |
| | | placeholder="è¯·éæ©é¢ç¨åç¶æ" |
| | | v-model="queryParam.orderStatus" |
| | | dict="order_status" |
| | | /> |
| | | placeholder="è¯·éæ©é¢ç¨åç¶æ" |
| | | v-model="queryParam.orderStatus" |
| | | dict="order_status" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :md="6" :sm="8"> |
| | | <a-form-item label="é¢ç¨äºº"> |
| | | <j-search-select-tag |
| | | placeholder="è¯·éæ©é¢ç¨äºº" |
| | | v-model="queryParam.receiver" |
| | | dict="sys_user,realname,id,del_flag!=1" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | <a-form-item label="é¢ç¨äºº"> |
| | | <j-search-select-tag |
| | | placeholder="è¯·éæ©é¢ç¨äºº" |
| | | v-model="queryParam.receiver" |
| | | dict="sys_user,realname,id,del_flag!=1" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="6" |
| | | :sm="8" |
| | | > |
| | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a |
| | | style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | |
| | | </template> |
| | | <template slot="imgSlot" slot-scope="text,record"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ å¾ç</span> |
| | | <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
| | | <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" |
| | | style="max-width:80px;font-size: 12px;font-style: italic;" /> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | |
| | | |
| | | </a-table> |
| | | </div> |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane tab="åå
·é¢ç¨æç»" key="1"> |
| | | <cutting-receive-detail-list ref="cuttingReceiveDetailList"></cutting-receive-detail-list> |
| | | </a-tab-pane> |
| | |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import CuttingReceiveModal from './modules/CuttingReceiveModal' |
| | | import CuttingReceiveDetailList from './CuttingReceiveDetailList' |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import CuttingReceiveModal from './modules/CuttingReceiveModal' |
| | | import CuttingReceiveDetailList from './CuttingReceiveDetailList' |
| | | |
| | | export default { |
| | | name: 'CuttingReceiveList', |
| | | mixins:[JeecgListMixin, mixinDevice], |
| | | components: { |
| | | CuttingReceiveModal, |
| | | CuttingReceiveDetailList |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'åå
·é¢ç¨å管ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | } |
| | | }, |
| | | { |
| | | title:'é¢ç¨äºº', |
| | | align:"center", |
| | | dataIndex: 'receiver_dictText' |
| | | }, |
| | | { |
| | | title:'é¢ç¨æ¶é´', |
| | | align:"center", |
| | | dataIndex: 'receiveTime', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | } |
| | | }, |
| | | { |
| | | title:'é¢ç¨è¯´æ', |
| | | align:"center", |
| | | dataIndex: 'receiveComment' |
| | | }, |
| | | { |
| | | title:'确认人', |
| | | align:"center", |
| | | dataIndex: 'confirmer_dictText' |
| | | }, |
| | | { |
| | | title:'确认æ¶é´', |
| | | align:"center", |
| | | dataIndex: 'confirmTime', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | } |
| | | }, |
| | | { |
| | | title:'确认æè§', |
| | | align:"center", |
| | | dataIndex: 'confirmComment' |
| | | }, |
| | | { |
| | | title:'æ¯å¦ä¼å½è¿', |
| | | align:"center", |
| | | dataIndex: 'returnFlag' |
| | | }, |
| | | { |
| | | title:'å½è¿æ¶é´', |
| | | align:"center", |
| | | dataIndex: 'returnTime', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | } |
| | | }, |
| | | { |
| | | title:'å½è¿è¯´æ', |
| | | align:"center", |
| | | dataIndex: 'returnComment' |
| | | }, |
| | | { |
| | | title:'å½è¿ç¡®è®¤äºº', |
| | | align:"center", |
| | | dataIndex: 'returnConfirmer_dictText' |
| | | }, |
| | | { |
| | | title:'å½è¿ç¡®è®¤æ¶é´', |
| | | align:"center", |
| | | dataIndex: 'returnConfirmTime', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | } |
| | | }, |
| | | { |
| | | title:'å½è¿ç¡®è®¤æè§', |
| | | align:"center", |
| | | dataIndex: 'returnConfirmComment' |
| | | }, |
| | | { |
| | | title:'é¢ç¨åç¶æ', |
| | | align:"center", |
| | | dataIndex: 'orderStatus' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | export default { |
| | | name: 'CuttingReceiveList', |
| | | mixins: [JeecgListMixin, mixinDevice], |
| | | components: { |
| | | CuttingReceiveModal, |
| | | CuttingReceiveDetailList |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'åå
·é¢ç¨å管ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/cms/cuttingReceive/list", |
| | | delete: "/cms/cuttingReceive/delete", |
| | | deleteBatch: "/cms/cuttingReceive/deleteBatch", |
| | | exportXlsUrl: "/cms/cuttingReceive/exportXls", |
| | | importExcelUrl: "cms/cuttingReceive/importExcel", |
| | | |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | { |
| | | title: 'é¢ç¨äºº', |
| | | align: 'center', |
| | | dataIndex: 'receiver_dictText' |
| | | }, |
| | | { |
| | | title: 'é¢ç¨æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'receiveTime', |
| | | customRender: function(text) { |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: 'é¢ç¨è¯´æ', |
| | | align: 'center', |
| | | dataIndex: 'receiveComment' |
| | | }, |
| | | { |
| | | title: '确认人', |
| | | align: 'center', |
| | | dataIndex: 'confirmer_dictText' |
| | | }, |
| | | { |
| | | title: '确认æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'confirmTime', |
| | | customRender: function(text) { |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: '确认æè§', |
| | | align: 'center', |
| | | dataIndex: 'confirmComment' |
| | | }, |
| | | { |
| | | title: 'æ¯å¦ä¼å½è¿', |
| | | align: 'center', |
| | | dataIndex: 'returnFlag' |
| | | }, |
| | | { |
| | | title: 'å½è¿æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'returnTime', |
| | | customRender: function(text) { |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: 'å½è¿è¯´æ', |
| | | align: 'center', |
| | | dataIndex: 'returnComment' |
| | | }, |
| | | { |
| | | title: 'å½è¿ç¡®è®¤äºº', |
| | | align: 'center', |
| | | dataIndex: 'returnConfirmer_dictText' |
| | | }, |
| | | { |
| | | title: 'å½è¿ç¡®è®¤æ¶é´', |
| | | align: 'center', |
| | | dataIndex: 'returnConfirmTime', |
| | | customRender: function(text) { |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title: 'å½è¿ç¡®è®¤æè§', |
| | | align: 'center', |
| | | dataIndex: 'returnConfirmComment' |
| | | }, |
| | | { |
| | | title: 'é¢ç¨åç¶æ', |
| | | align: 'center', |
| | | dataIndex: 'orderStatus' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/cms/cuttingReceive/list', |
| | | delete: '/cms/cuttingReceive/delete', |
| | | deleteBatch: '/cms/cuttingReceive/deleteBatch', |
| | | exportXlsUrl: '/cms/cuttingReceive/exportXls', |
| | | importExcelUrl: 'cms/cuttingReceive/importExcel' |
| | | |
| | | }, |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | dictOptions: {}, |
| | | superFieldList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList() |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.$refs.cuttingReceiveDetailList.dataSource = [] |
| | | this.loadData(1); |
| | | this.loadData(1) |
| | | }, |
| | | handleEdit: function (record) { |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = 'ç¼è¾' |
| | | this.$refs.modalForm.disableSubmit = false |
| | | 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 |
| | | }, |
| | | handleDetail:function(record){ |
| | | this.$refs.modalForm.edit(record); |
| | | this.$refs.modalForm.title="详æ
"; |
| | | this.$refs.modalForm.disableSubmit = true; |
| | | handleDetail: function(record) { |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = '详æ
' |
| | | this.$refs.modalForm.disableSubmit = true |
| | | }, |
| | | customRow(record) { |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | | click: (e) => { |
| | |
| | | for (let i = 0; i < children.length; i++) { |
| | | children[i].classList.add('checked-td-of-add-table') |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
| | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item label="é¢ç¨äºº" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-search-select-tag |
| | | :disabled="disableSubmit" |
| | |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24"> |
| | | <a-form-item label="é¢ç¨è¯´æ" :labelCol="{span:3}" :wrapperCol="{span:21}"> |
| | | <a-textarea :disabled="disableSubmit" placeholder="请è¾å
¥é¢ç¨è¯´æ" v-decorator="['receiveComment', validatorRules.receiveComment]" /> |
| | | <a-textarea :disabled="disableSubmit" placeholder="请è¾å
¥é¢ç¨è¯´æ" |
| | | v-decorator="['receiveComment', validatorRules.receiveComment]" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-search-select-tag |
| | | :disabled="disableSubmit" |
| | |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24"> |
| | | <a-form-item label="确认æè§" :labelCol="{span:3}" :wrapperCol="{span:21}"> |
| | | <a-textarea :disabled="disableSubmit" placeholder="请è¾å
¥ç¡®è®¤æè§" v-decorator="['confirmComment', validatorRules.confirmComment]" /> |
| | | <a-textarea :disabled="disableSubmit" placeholder="请è¾å
¥ç¡®è®¤æè§" |
| | | v-decorator="['confirmComment', validatorRules.confirmComment]" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item label="æ¯å¦ä¼å½è¿" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input :disabled="disableSubmit" placeholder="请è¾å
¥æ¯å¦ä¼å½è¿" v-decorator="['returnFlag', validatorRules.returnFlag]" ></a-input> |
| | | <a-input :disabled="disableSubmit" placeholder="请è¾å
¥æ¯å¦ä¼å½è¿" |
| | | v-decorator="['returnFlag', validatorRules.returnFlag]"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24 / 2"> |
| | |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24"> |
| | | <a-form-item label="å½è¿è¯´æ" :labelCol="{span:3}" :wrapperCol="{span:21}"> |
| | | <a-textarea :disabled="disableSubmit" placeholder="请è¾å
¥å½è¿è¯´æ" v-decorator="['returnComment', validatorRules.returnComment]" /> |
| | | <a-textarea :disabled="disableSubmit" placeholder="请è¾å
¥å½è¿è¯´æ" |
| | | v-decorator="['returnComment', validatorRules.returnComment]" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item label="å½è¿ç¡®è®¤äºº" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-search-select-tag |
| | | :disabled="disableSubmit" |
| | |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row style="width: 100%"> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24"> |
| | | <a-form-item label="å½è¿ç¡®è®¤æè§" :labelCol="{span:3}" :wrapperCol="{span:21}"> |
| | | <a-textarea :disabled="disableSubmit" placeholder="请è¾å
¥å½è¿ç¡®è®¤æè§" v-decorator="['returnConfirmComment', validatorRules.returnConfirmComment]" /> |
| | | <a-textarea :disabled="disableSubmit" placeholder="请è¾å
¥å½è¿ç¡®è®¤æè§" |
| | | v-decorator="['returnConfirmComment', validatorRules.returnConfirmComment]" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </a-spin> |
| | | <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" |
| | | >éæ©åå
·</a-button |
| | | > |
| | | <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()">éæ©åå
·</a-button> |
| | | <a-table |
| | | ref="table" |
| | | bordered |
| | |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | > |
| | | <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index"> |
| | | <template v-for="col in columns" :slot="col.dataIndex" slot-scope="text, record, index" > |
| | | <div :key="col.dataIndex"> |
| | | <a-input |
| | | :value="text" |
| | | :disabled="disableSubmit" |
| | | v-if="col.dataIndex == 'workpieceMaterial'" |
| | | @change="(e)=>handleChange(e.target.value, record.key, col, index)" |
| | | /> |
| | | <a-input-number |
| | | v-if="col.dataIndex == 'usedLife'" |
| | | <a-input |
| | | :value="text" |
| | | :disabled="disableSubmit" |
| | | v-if="col.dataIndex === 'workpieceMaterial'" |
| | | @change="(e)=>handleChange(e.target.value, record.key, col, index)" |
| | | /> |
| | | <a-input-number |
| | | v-if="col.dataIndex === 'usedLife'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | |
| | | <template slot="footer" v-if="disableSubmit == true"> |
| | | <a-button :style="{ marginRight: '8px' }" @click="handleCancel">å
³é</a-button> |
| | | </template> |
| | | <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal> |
| | | <j-select-inventory-modal ref="inventoryModalForm" @ok="modalFormOk"></j-select-inventory-modal> |
| | | <!-- <j-select-tooling-modal ref="toolingModalForm" @ok="modalFormOk"></j-select-tooling-modal>--> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import pick from 'lodash.pick' |
| | | import JSelectToolingModal from './JSelectToolingModal' |
| | | 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 store from '@/store/' |
| | | export default { |
| | | name: 'CuttingInboundModal', |
| | | components: { |
| | | import pick from 'lodash.pick' |
| | | import JSelectToolingModal from './JSelectToolingModal' |
| | | 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 store from '@/store/' |
| | | import JSelectInventoryModal from '@views/cms/modules/JSelectInventoryModal.vue' |
| | | |
| | | export default { |
| | | name: 'CuttingInboundModal', |
| | | components: { |
| | | JSelectToolingModal, |
| | | JSelectInventoryModal, |
| | | JMultiSelectTag, |
| | | JDictSelectTag, |
| | | store, |
| | | moment, |
| | | moment |
| | | }, |
| | | data () { |
| | | return { |
| | | /* å页忰 */ |
| | | data() { |
| | | return { |
| | | /* å页忰 */ |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0, |
| | | total: 0 |
| | | }, |
| | | title:'æ°å¢', |
| | | visible: false, |
| | | selectedRowKeys: {}, |
| | | title: 'æ°å¢', |
| | | visible: false, |
| | | selectedRowKeys: {}, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | sm: { span: 18 } |
| | | }, |
| | | confirmLoading: false, |
| | | loading: false, |
| | | form: this.$form.createForm(this), |
| | | dataSource: [], |
| | | param: {}, |
| | | validatorRules: { |
| | | }, |
| | | validatorRules: {}, |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function (t, r, index) { |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | }, |
| | | } |
| | | }, |
| | | { |
| | | title: 'åå
·ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'cuttingCode', |
| | | width: 150, |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: 'åå
·åç§°', |
| | | align: 'center', |
| | | dataIndex: 'cuttingName', |
| | | dataIndex: 'cuttingName' |
| | | }, |
| | | { |
| | | title: '工件æè´¨', |
| | | align: 'center', |
| | | dataIndex: 'workpieceMaterial', |
| | | scopedSlots: { customRender: 'workpieceMaterial' }, |
| | | |
| | | scopedSlots: { customRender: 'workpieceMaterial' } |
| | | }, |
| | | { |
| | | title: '使ç¨å¯¿å½', |
| | | align: 'center', |
| | | dataIndex: 'usedLife', |
| | | scopedSlots: { customRender: 'usedLife' }, |
| | | scopedSlots: { customRender: 'usedLife' } |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' }, |
| | | }, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | add: '/cms/cuttingReceive/add', |
| | | detailList: '/cms/cuttingReceive/detailList', |
| | | detailList: '/cms/cuttingReceive/detailList' |
| | | }, |
| | | orderId:'', |
| | | disableSubmit:false |
| | | } |
| | | }, |
| | | methods: { |
| | | modalFormOk(){ |
| | | orderId: '', |
| | | disableSubmit: false |
| | | } |
| | | }, |
| | | methods: { |
| | | modalFormOk() { |
| | | |
| | | }, |
| | | getQueryParams() { |
| | | }, |
| | | getQueryParams() { |
| | | this.param.pageNo = this.ipagination.current |
| | | this.param.pageSize = this.ipagination.pageSize |
| | | return filterObj(this.param) |
| | | }, |
| | | add() { |
| | | add() { |
| | | let receiver = store.getters.userInfo.id |
| | | let receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') |
| | | this.edit({ receiver: receiver, receiveTime: receiveTime }) |
| | |
| | | ) |
| | | }) |
| | | }, |
| | | handleDelete(record, index) { |
| | | handleDelete(record, index) { |
| | | this.dataSource.splice(index, 1) |
| | | }, |
| | | handleChange(value, key, column, index) { |
| | |
| | | this.dataSource = temp |
| | | } |
| | | }, |
| | | selectTooling: function () { |
| | | selectTooling: function() { |
| | | let ids = [] |
| | | for (let i = 0; i < this.dataSource.length; i++) { |
| | | ids.push(this.dataSource[i].cuttingId) |
| | | ids.push(this.dataSource[i].inventoryId) |
| | | console.log('å½åæ°æ®æº:', this.dataSource) |
| | | } |
| | | this.$refs.toolingModalForm.showModal(ids) |
| | | this.$refs.toolingModalForm.title = 'éæ©åå
·' |
| | | this.$refs.toolingModalForm.disableSubmit = false |
| | | // this.$refs.toolingModalForm.showModal(ids) |
| | | // this.$refs.toolingModalForm.title = 'éæ©åå
·' |
| | | // this.$refs.toolingModalForm.disableSubmit = false |
| | | |
| | | this.$refs.inventoryModalForm.showModal(ids) |
| | | this.$refs.inventoryModalForm.title = 'éæ©åå
·' |
| | | this.$refs.inventoryModalForm.disableSubmit = false |
| | | |
| | | }, |
| | | detailList(orderId) { |
| | | this.param.orderId = orderId |
| | |
| | | that.confirmLoading = true |
| | | let formData = Object.assign(this.model, values) |
| | | formData.detailData = this.dataSource |
| | | postAction(that.url.add, formData) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$message.success('é¢ç¨æå') |
| | | that.$emit('ok', new Date()) |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | |
| | | // æ·»å æ´æ°åºåç¶æçé»è¾ |
| | | const inventoryIds = this.dataSource.map(item => item.inventoryId) |
| | | const updateInventoryStatus = inventoryIds.length > 0 ? |
| | | //éè¦åä¸ä¸ªæ´æ°åºåç¶æçæ¥å£å¨å端ï¼è¿æ²¡å25/9/9ï¼ |
| | | postAction('/cms/inventory/updateStatus', { |
| | | ids: inventoryIds, |
| | | status: 'å¾
åºåº' //设为å¾
åºåº |
| | | }) : Promise.resolve() |
| | | updateInventoryStatus.then(() => { |
| | | return postAction(that.url.add, formData) |
| | | }).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success('é¢ç¨æå') |
| | | that.$emit('ok', new Date()) |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).catch((error) => { |
| | | that.$message.error('æä½å¤±è´¥: ' + error.message) |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | this.dataSource = [] |
| | | this.visible = false |
| | | this.disableSubmit = false |
| | | }, |
| | | }, |
| | | mounted() { |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | console.log('æ¥æ¶å°çéæ©æ°æ®:', data) |
| | | //getCurrSelected äºä»¶ æ¥æ¶ç»ä»¶ä¼ éçåæ° |
| | | for (let i = 0; i < data.length; i++) { |
| | | this.dataSource.push({ |
| | | cuttingId: data[i].id, |
| | | inventoryId: data[i].id, |
| | | cuttingCode: data[i].cuttingCode, |
| | | cuttingName: data[i].cuttingName |
| | | cuttingName: data[i].cuttingName, |
| | | cuttingId: data[i].cuttingId |
| | | }) |
| | | } |
| | | console.log('æ´æ°åçæ°æ®æº:', this.dataSource) |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!--æ¯æå
¨å±ç¼©æ¾--> |
| | | <!--éæ©åå
·çå¼¹çªï¼æ ¹æ®è¿ä¸ªå¼¹çªå°éæ©åå
·ä»åå
·ä¿¡æ¯è¿ç§»å°åå
·åºåï¼ç¨æ¥é¢ç¨åå
·åºåéçåå
· --> |
| | | <j-modal |
| | | :visible="visible" |
| | | :title="title" |
| | | switchFullscreen |
| | | :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.cuttingCode"></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.cuttingName"></a-input> |
| | | </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' |
| | | |
| | | export default { |
| | | name: 'JSelectInventoryModal', |
| | | components: {}, |
| | | 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: 'cuttingCode', |
| | | sorter: true, |
| | | }, |
| | | { |
| | | title: 'åå
·åç§°', |
| | | align: 'center', |
| | | dataIndex: 'cuttingName', |
| | | sorter: true, |
| | | }, |
| | | { |
| | | title: 'åå
·åç±»', |
| | | align: 'center', |
| | | dataIndex: 'cuttingCategory', |
| | | sorter: true, |
| | | }, |
| | | { |
| | | title:'åå
·æ¡ç ', |
| | | align: 'center', |
| | | dataIndex: 'cuttingBarcode', |
| | | sorter: true, |
| | | }, |
| | | { |
| | | title:'åå
·å½å寿å½ï¼ç¾åæ¯ï¼', |
| | | align: 'center', |
| | | dataIndex: 'currentLife', |
| | | sorter: true, |
| | | }, |
| | | ], |
| | | 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, |
| | | }, |
| | | isorter: { |
| | | column: 'num', |
| | | order: 'desc', |
| | | }, |
| | | departTree: [], |
| | | visible: false, |
| | | loading: false, |
| | | url: { |
| | | // list: '/cms/cuttingTool/getCuttingToolList', |
| | | list:'/cms/cuttingReceive/getInventoryToolList' |
| | | }, |
| | | } |
| | | }, |
| | | 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, this.isorter) |
| | | 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> |