feat(cms):
重写了刀具报废新增逻辑,
从通过刀具信息选取刀具改为通过刀具库存里的数据获取刀具
修改库存id存入刀具id的错误
| | |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <!-- <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button>--> |
| | | <!-- <a-button type="primary" icon="download" @click="handleExportXls('åå
·æ¥åºæç»')">导åº</a-button> |
| | | <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | |
| | |
| | | <!-- 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> |
| | | |
| | |
| | | </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> |
| | |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | align: 'center', |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title:'ç³è¯·äºº', |
| | | align:"center", |
| | | align: 'center', |
| | | dataIndex: 'applicant_dictText' |
| | | }, |
| | | { |
| | | title:'ç³è¯·æ¶é´', |
| | | align:"center", |
| | | align: 'center', |
| | | dataIndex: 'applicationTime', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title:'ç³è¯·è¯´æ', |
| | | align:"center", |
| | | align: 'center', |
| | | dataIndex: 'applicationComment' |
| | | }, |
| | | { |
| | | title:'确认人', |
| | | align:"center", |
| | | align: 'center', |
| | | dataIndex: 'confirmer_dictText' |
| | | }, |
| | | { |
| | | title:'确认æ¶é´', |
| | | align:"center", |
| | | align: 'center', |
| | | dataIndex: 'confirmTime', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) |
| | | } |
| | | }, |
| | | { |
| | | title:'确认æè§', |
| | | align:"center", |
| | | align: 'center', |
| | | dataIndex: 'confirmComment' |
| | | }, |
| | | { |
| | | title:'æ¥åºåç¶æ', |
| | | align:"center", |
| | | align: 'center', |
| | | dataIndex: 'orderStatus' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/cms/cuttingScrap/list", |
| | | delete: "/cms/cuttingScrap/delete", |
| | | deleteBatch: "/cms/cuttingScrap/deleteBatch", |
| | | exportXlsUrl: "/cms/cuttingScrap/exportXls", |
| | | importExcelUrl: "cms/cuttingScrap/importExcel", |
| | | list: '/cms/cuttingScrap/list', |
| | | delete: '/cms/cuttingScrap/delete', |
| | | deleteBatch: '/cms/cuttingScrap/deleteBatch', |
| | | exportXlsUrl: '/cms/cuttingScrap/exportXls', |
| | | importExcelUrl: 'cms/cuttingScrap/importExcel' |
| | | |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | superFieldList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | this.getSuperFieldList() |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.$refs.cuttingScrapDetailList.dataSource = [] |
| | | this.loadData(1); |
| | | this.loadData(1) |
| | | }, |
| | | handleEdit: function (record) { |
| | | this.$refs.modalForm.edit(record) |
| | |
| | | this.$refs.modalForm.disableSubmit = false |
| | | }, |
| | | handleDetail:function(record){ |
| | | this.$refs.modalForm.edit(record); |
| | | this.$refs.modalForm.title="详æ
"; |
| | | this.$refs.modalForm.disableSubmit = true; |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = '详æ
' |
| | | this.$refs.modalForm.disableSubmit = true |
| | | }, |
| | | customRow(record) { |
| | | return { |
| | |
| | | for (let i = 0; i < children.length; i++) { |
| | | children[i].classList.add('checked-td-of-add-table') |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | export default { |
| | | name: 'CuttingInboundModal', |
| | | components: { |
| | | JSelectToolingModal, |
| | | JSelectInventoryModal, |
| | | JMultiSelectTag, |
| | | JDictSelectTag, |
| | |
| | | <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="['applicationComment', validatorRules.applicationComment]" /> |
| | | <a-textarea :disabled="disableSubmit" placeholder="请è¾å
¥ç³è¯·è¯´æ" |
| | | v-decorator="['applicationComment', validatorRules.applicationComment]" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | <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-form> |
| | | </a-spin> |
| | | <a-button type="primary" :style="{ marginBottom: '8px' }" @click="selectTooling()" |
| | | >éæ©åå
·</a-button |
| | | >éæ©æ¥åºåå
· |
| | | </a-button |
| | | > |
| | | <a-table |
| | | ref="table" |
| | |
| | | <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-scrap-modal ref="scrapModalForm" @ok="modalFormOk"></j-select-scrap-modal> |
| | | </a-modal> |
| | | </template> |
| | | |
| | |
| | | import JMultiSelectTag from '@/components/dict/JMultiSelectTag' |
| | | import { filterObj } from '@/utils/util' |
| | | import store from '@/store/' |
| | | import JSelectScrapModal from '@views/cms/modules/JSelectScrapModal.vue' |
| | | |
| | | export default { |
| | | name: 'CuttingInboundModal', |
| | | components: { |
| | | JSelectToolingModal, |
| | | JSelectScrapModal, |
| | | JMultiSelectTag, |
| | | JDictSelectTag, |
| | | store, |
| | | moment, |
| | | moment |
| | | }, |
| | | data () { |
| | | return { |
| | |
| | | }, |
| | | showQuickJumper: true, |
| | | showSizeChanger: true, |
| | | total: 0, |
| | | total: 0 |
| | | }, |
| | | title:'æ°å¢', |
| | | visible: false, |
| | |
| | | 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: '#', |
| | |
| | | align: 'center', |
| | | 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: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' }, |
| | | }, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | add: '/cms/cuttingScrap/add', |
| | | detailList: '/cms/cuttingScrap/detailList', |
| | | detailList: '/cms/cuttingScrap/detailList' |
| | | }, |
| | | orderId:'', |
| | | disableSubmit:false |
| | |
| | | let ids = [] |
| | | for (let i = 0; i < this.dataSource.length; i++) { |
| | | ids.push(this.dataSource[i].cuttingId) |
| | | ids.push(this.dataSource[i].inventoryId) |
| | | } |
| | | this.$refs.toolingModalForm.showModal(ids) |
| | | this.$refs.toolingModalForm.title = 'éæ©åå
·' |
| | | this.$refs.toolingModalForm.disableSubmit = false |
| | | this.$refs.scrapModalForm.showModal(ids) |
| | | this.$refs.scrapModalForm.title = 'éæ©æ¥åºåå
·' |
| | | this.$refs.scrapModalForm.disableSubmit = false |
| | | }, |
| | | detailList(orderId) { |
| | | this.param.orderId = orderId |
| | |
| | | return |
| | | } |
| | | const that = this |
| | | |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true |
| | | let formData = Object.assign(this.model, values) |
| | | formData.detailData = this.dataSource |
| | | |
| | | // ç¡®ä¿ä¼ éç»åç«¯çæ°æ®å
嫿æå¿
è¦å段 |
| | | formData.detailData = this.dataSource.map(item => { |
| | | return { |
| | | // æç¡®æå®æ¯ä¸ªå段ï¼ç¡®ä¿ inventoryId 被æ£ç¡®ä¼ é |
| | | inventoryId: item.inventoryId, |
| | | cuttingId: item.cuttingId, |
| | | cuttingCode: item.cuttingCode, |
| | | cuttingName: item.cuttingName, |
| | | // å¦æè¿æå
¶ä»å段ä¹éè¦å
å« |
| | | ...item // å
å«å
¶ä»å¯è½åå¨çåæ®µ |
| | | } |
| | | }) |
| | | |
| | | postAction(that.url.add, formData) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$message.success('æ¥åºæå') |
| | | that.$emit('ok', new Date()) |
| | | that.$message.success('æ¥åºæå') |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | |
| | | this.dataSource = [] |
| | | this.visible = false |
| | | this.disableSubmit = false |
| | | }, |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | //getCurrSelected äºä»¶ æ¥æ¶ç»ä»¶ä¼ éçåæ° |
| | | for (let i = 0; i < data.length; i++) { |
| | | this.dataSource.push({ |
| | | cuttingId: data[i].id, |
| | | // cuttingId: data[i].id, |
| | | // cuttingCode: data[i].cuttingCode, |
| | | // cuttingName: data[i].cuttingName |
| | | 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: 'JSelectScrapModal', |
| | | 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, |
| | | }, |
| | | { |
| | | title:'åºåid', |
| | | align: 'center', |
| | | dataIndex: 'id', |
| | | 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) { |
| | | 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> |