| | |
| | | } |
| | | return [target].concat(getParents(target), window) |
| | | } |
| | | |
| | | /** |
| | | * éå¤å¼éªè¯å·¥å
·æ¹æ³ |
| | | * |
| | | * 使ç¨ç¤ºä¾ï¼ |
| | | * { validator: (rule, value, callback) => validateDuplicateValue('sys_fill_rule', 'rule_code', value, this.model.id, callback) } |
| | | * |
| | | * @param tableName 被éªè¯ç表å |
| | | * @param fieldName 被éªè¯çåæ®µå |
| | | * @param fieldVal 被éªè¯çå¼ |
| | | * @param dataId æ°æ®IDï¼å¯ç©º |
| | | * @param delFlag å 餿 è®° |
| | | * @param callback |
| | | */ |
| | | export function validateDuplicateValueInDelFlag(tableName, fieldName, fieldVal, dataId, delFlag, callback) { |
| | | if (fieldVal) { |
| | | let params = { tableName, fieldName, fieldVal, dataId, delFlag } |
| | | api.duplicateCheck(params).then(res => { |
| | | res['success'] ? callback() : callback(res['message']) |
| | | }).catch(err => { |
| | | callback(err.message || err) |
| | | }) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | /** |
| | | * æ ¹æ®ç»ä»¶åè·åç¶çº§ |
| | | * @param vm |
| | |
| | | <!-- æç´¢åºå --> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :md="6" :sm="8"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="产线"> |
| | | <j-dict-select-tag placeholder="è¯·éæ©äº§çº¿" v-model="queryParam.factoryId" |
| | | dictCode="base_factory,factory_name,id,del_flag=0 and factory_category='3'"></j-dict-select-tag> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="çç»åç§°" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}"> |
| | | <a-input placeholder="" v-model="queryParam.groupName"></a-input> |
| | | </a-form-item> |
| | |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-col :md="9" :sm="24"> |
| | | <a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | <a-button type="info" @click="searchReset2" icon="reload" style="margin-left: 8px">éç½®</a-button> |
| | | |
| | | </a-col> |
| | | </span> |
| | |
| | | queryParam2: {}, |
| | | dataSource1: [], |
| | | dataSource2: [], |
| | | ipagination1: { |
| | | ipagination: { |
| | | current: 1, |
| | | pageSize: 10, |
| | | pageSizeOptions: ['10', '20', '30'], |
| | |
| | | showSizeChanger: true, |
| | | total: 0 |
| | | }, |
| | | isorter1: { |
| | | column: 'createTime', |
| | | order: 'desc' |
| | | isorter: { |
| | | column: 'groupCode', |
| | | order: 'asc' |
| | | }, |
| | | isorter2: { |
| | | column: 'createTime', |
| | |
| | | style="top:5%;height: 85%;overflow-y: hidden"> |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" v-bind="layout" :model="model" :rules="validatorRules"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
| | | <a-form-model-item label="çç»ç¼ç " required prop="groupCode" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-model="model.groupCode" :disabled="roleDisabled" placeholder="请è¾å
¥çç»ç¼ç "/> |
| | | <a-input v-model="model.groupCode" :disabled="roleDisabled" placeholder="请è¾å
¥çç»ç¼ç " /> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="çç»åç§°" required prop="groupName" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-model="model.groupName" placeholder="请è¾å
¥çç»åç§°"/> |
| | | <a-input v-model="model.groupName" placeholder="请è¾å
¥çç»åç§°" /> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="çç»é¿" prop="groupManager" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-form-model-item label="çç»é¿" prop="groupManager" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-search-select-tag |
| | | type="list" |
| | | v-model="model.groupManager" |
| | | :trigger-change="true" |
| | | dict="sys_user,realname,id, del_flag='0' and status='1'" |
| | | placeholder="è¯·éæ©çç»é¿" |
| | | /> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="产线" prop="factoryId" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-dict-select-tag placeholder="è¯·éæ©äº§çº¿" v-model="model.factoryId" |
| | | dictCode="base_factory,factory_name,id,del_flag=0 and factory_category='3'"></j-dict-select-tag> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="çæ¬¡" prop="shiftId" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-dict-select-tag |
| | | type="list" |
| | | v-model="model.groupManager" |
| | | :trigger-change="true" |
| | | dictCode="sys_user,realname,id" |
| | | placeholder="è¯·éæ©çç»é¿" |
| | | /> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="产线" prop="factoryId" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-select-factory |
| | | v-model="model.factoryId" |
| | | :multi="true" |
| | | @back="backFactoryInfo" |
| | | :backProduction="true" |
| | | :treeProductOpera="true" |
| | | ></j-select-factory> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="çæ¬¡" prop="shiftId" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-dict-select-tag |
| | | type="list" |
| | | v-model="model.shiftId" |
| | | :trigger-change="true" |
| | | dictCode="base_shift,shift_name,id" |
| | | placeholder="è¯·éæ©çæ¬¡" |
| | | /> |
| | | type="list" |
| | | v-model="model.shiftId" |
| | | :trigger-change="true" |
| | | dictCode="base_shift,shift_name,id" |
| | | placeholder="è¯·éæ©çæ¬¡" |
| | | /> |
| | | </a-form-model-item> |
| | | <a-form-model-item label="夿³¨" prop="remark" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-textarea :rows="5" v-model="model.remark" placeholder="请è¾å
¥å¤æ³¨"/> |
| | | <a-textarea :rows="5" v-model="model.remark" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </a-form-model-item> |
| | | </a-form-model> |
| | | </a-spin> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {duplicateCheck } from '@/api/api' |
| | | import {postAction,requestPut} from '@/api/manage' |
| | | import JDictSelectTag from '@/components/dict/JDictSelectTag' |
| | | import JSelectFactory from '../../../../components/jeecgbiz/JSelectFactory' |
| | | export default { |
| | | name: "GroupModal", |
| | | components: { |
| | | JDictSelectTag, |
| | | JSelectFactory |
| | | import { duplicateCheck } from '@/api/api' |
| | | import { postAction, requestPut } from '@/api/manage' |
| | | import JDictSelectTag from '@/components/dict/JDictSelectTag' |
| | | |
| | | export default { |
| | | name: 'GroupModal', |
| | | components: { |
| | | JDictSelectTag |
| | | }, |
| | | data () { |
| | | return { |
| | | title:"æä½", |
| | | visible: false, |
| | | roleDisabled: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules:{ |
| | | groupName: [ |
| | | { required: true, message: '请è¾å
¥çç»åç§°!' }, |
| | | { min: 2, max: 30, message: 'é¿åº¦å¨ 2 å° 30 个å符', trigger: 'blur' } |
| | | ], |
| | | groupCode: [ |
| | | { required: true, message: '请è¾å
¥çç»åç§°!'}, |
| | | { min: 0, max: 64, message: 'é¿åº¦ä¸è¶
è¿ 64 个å符', trigger: 'blur' }, |
| | | { validator: this.validategroupCode} |
| | | ], |
| | | remark: [ |
| | | { min: 0, max: 126, message: 'é¿åº¦ä¸è¶
è¿ 126 个å符', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: "/base/shiftGroup/add", |
| | | edit: "/base/shiftGroup/edit", |
| | | }, |
| | | nextFactoryOptions: [], |
| | | } |
| | | data() { |
| | | return { |
| | | title: 'æä½', |
| | | visible: false, |
| | | roleDisabled: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | groupName: [ |
| | | { required: true, message: '请è¾å
¥çç»åç§°!' }, |
| | | { min: 2, max: 30, message: 'é¿åº¦å¨ 2 å° 30 个å符', trigger: 'blur' } |
| | | ], |
| | | groupCode: [ |
| | | { required: true, message: '请è¾å
¥çç»åç§°!' }, |
| | | { min: 0, max: 64, message: 'é¿åº¦ä¸è¶
è¿ 64 个å符', trigger: 'blur' }, |
| | | { validator: this.validategroupCode } |
| | | ], |
| | | factoryId: [ |
| | | { required: true, message: 'è¯·éæ©äº§çº¿!' }, |
| | | ], |
| | | groupManager: [ |
| | | { required: true, message: 'è¯·éæ©çç»é¿!' }, |
| | | ], |
| | | shiftId: [ |
| | | { required: true, message: 'è¯·éæ©ççæ¬¡!' }, |
| | | ], |
| | | remark: [ |
| | | { min: 0, max: 126, message: 'é¿åº¦ä¸è¶
è¿ 126 个å符', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/base/shiftGroup/add', |
| | | edit: '/base/shiftGroup/edit' |
| | | }, |
| | | nextFactoryOptions: [] |
| | | } |
| | | }, |
| | | created() { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.edit(this.modelDefault) |
| | | }, |
| | | created () { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit(this.modelDefault); |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | }, |
| | | close () { |
| | | this.$refs.form.clearValidate(); |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk () { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true; |
| | | let obj; |
| | | if(!this.model.id){ |
| | | obj=postAction(this.url.add, this.model) |
| | | }else{ |
| | | obj=requestPut(this.url.edit, this.model, { |
| | | id: this.model.id |
| | | }) |
| | | } |
| | | obj.then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | close() { |
| | | this.$refs.form.clearValidate() |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | handleOk() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let obj |
| | | if (!this.model.id) { |
| | | obj = postAction(this.url.add, this.model) |
| | | } else { |
| | | obj = requestPut(this.url.edit, this.model, { |
| | | id: this.model.id |
| | | }) |
| | | }else{ |
| | | return false; |
| | | } |
| | | obj.then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | validategroupCode(rule, value, callback) { |
| | | if (/[\u4E00-\u9FA5]/g.test(value)) { |
| | | callback('çç»ç¼ç ä¸å¯è¾å
¥æ±å!') |
| | | } else { |
| | | let params = { |
| | | tableName: 'base_shift_group', |
| | | fieldName: 'group_code', |
| | | fieldVal: value, |
| | | dataId: this.model.id |
| | | } |
| | | duplicateCheck(params).then((res) => { |
| | | if (res.success) { |
| | | callback() |
| | | } else { |
| | | callback(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | validategroupCode(rule, value, callback){ |
| | | if(/[\u4E00-\u9FA5]/g.test(value)){ |
| | | callback("çç»ç¼ç ä¸å¯è¾å
¥æ±å!"); |
| | | }else{ |
| | | let params = { |
| | | tableName: "base_shift_group", |
| | | fieldName: "group_code", |
| | | fieldVal: value, |
| | | dataId: this.model.id, |
| | | }; |
| | | duplicateCheck(params).then((res)=>{ |
| | | if(res.success){ |
| | | callback(); |
| | | }else{ |
| | | callback(res.message); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | backFactoryInfo(info) { |
| | | this.model.factoryIds = this.model.factoryId |
| | | this.nextFactoryOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | | }, |
| | | } |
| | | }, |
| | | backFactoryInfo(info) { |
| | | this.model.factoryIds = this.model.factoryId |
| | | this.nextFactoryOptions = info.map((item, index, arr) => { |
| | | let c = { label: item.text, value: item.value + '' } |
| | | return c |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | <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="å
¥åºåç¶æ"> |
| | | <j-search-select-tag |
| | | 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 :md="6" :sm="8"> |
| | | <a-form-item label="确认人"> |
| | | <j-search-select-tag |
| | | v-model="queryParam.confirmer" |
| | | placeholder="è¯·éæ©ç¡®è®¤äºº" |
| | | dict="sys_user,realname,id,del_flag!=1" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <!-- <a-col :md="6" :sm="8">--> |
| | | <!-- <a-form-item label="å
¥åºæ¶é´">--> |
| | | <!-- <j-date--> |
| | | <!-- v-model="queryParam.receiveTime"--> |
| | | <!-- type="date"--> |
| | | <!-- value-format="YYYY-MM-DD"--> |
| | | <!-- />--> |
| | | <!-- </a-form-item>--> |
| | | <!-- </a-col>--> |
| | | <a-col |
| | | :md="6" |
| | | :sm="8" |
| | | > |
| | | <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="å
¥åºåç¶æ"> |
| | | <j-search-select-tag |
| | | 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 :md="6" :sm="8"> |
| | | <a-form-item label="确认人"> |
| | | <j-search-select-tag |
| | | v-model="queryParam.confirmer" |
| | | placeholder="è¯·éæ©ç¡®è®¤äºº" |
| | | dict="sys_user,realname,id,del_flag!=1" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <!-- <a-col :md="6" :sm="8">--> |
| | | <!-- <a-form-item label="å
¥åºæ¶é´">--> |
| | | <!-- <j-date--> |
| | | <!-- v-model="queryParam.receiveTime"--> |
| | | <!-- type="date"--> |
| | | <!-- value-format="YYYY-MM-DD"--> |
| | | <!-- />--> |
| | | <!-- </a-form-item>--> |
| | | <!-- </a-col>--> |
| | | <a-col |
| | | :md="6" |
| | | :sm="8" |
| | | > |
| | | <span |
| | | style="float: left;overflow: hidden;" |
| | | class="table-page-search-submitButtons" |
| | | style="float: left;overflow: hidden;" |
| | | class="table-page-search-submitButtons" |
| | | > |
| | | <a-button |
| | | type="primary" |
| | | @click="searchQuery" |
| | | icon="search" |
| | | type="primary" |
| | | @click="searchQuery" |
| | | icon="search" |
| | | >æ¥è¯¢</a-button> |
| | | <a-button |
| | | type="primary" |
| | | @click="searchReset" |
| | | icon="reload" |
| | | style="margin-left: 8px" |
| | | type="primary" |
| | | @click="searchReset" |
| | | icon="reload" |
| | | style="margin-left: 8px" |
| | | >éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <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-upload> |
| | | </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>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <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-upload> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | :customRow="customRow" |
| | | @change="handleTableChange"> |
| | | <!-- 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>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></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;"/> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | :customRow="customRow" |
| | | @change="handleTableChange"> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)" :disabled="record.orderStatus == '2'">ç¼è¾</a> |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></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;" /> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)" :disabled="record.orderStatus === '2'">ç¼è¾</a> |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <!-- <a-menu-item v-if="record.orderStatus != '2'">--> |
| | | <!-- <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)">--> |
| | | <!-- <a>å é¤</a>--> |
| | | <!-- </a-popconfirm>--> |
| | | <!-- </a-menu-item>--> |
| | | <!-- <a-menu-item v-if="record.orderStatus != '2'">--> |
| | | <!-- <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)">--> |
| | | <!-- <a>å é¤</a>--> |
| | | <!-- </a-popconfirm>--> |
| | | <!-- </a-menu-item>--> |
| | | <a-menu-item v-if="record.orderStatus != '2'"> |
| | | <a @click="handleSubmit(record.id)" :disabled="record.orderStatus == '3'">æäº¤</a> |
| | | </a-menu-item> |
| | |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane tab="åå
·å
¥åºæç»" key="1"> |
| | | <cutting-inbound-detail-list ref="cuttingInbounDetailList"></cutting-inbound-detail-list> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <cutting-inbound-modal ref="modalForm" @ok="modalFormOk"></cutting-inbound-modal> |
| | | </a-card> |
| | | </a-table> |
| | | </div> |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane tab="åå
·å
¥åºæç»" key="1"> |
| | | <cutting-inbound-detail-list ref="cuttingInbounDetailList"></cutting-inbound-detail-list> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <cutting-inbound-modal ref="modalForm" @ok="modalFormOk"></cutting-inbound-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | |
| | | |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import CuttingInboundModal from './modules/CuttingInboundModal' |
| | | import CuttingInboundDetailList from './CuttingInboundDetailList' |
| | | import { downFile, httpAction } from '@api/manage' |
| | | import Vue from 'vue' |
| | | import { ACCESS_TOKEN } from '@/store/mutation-types' |
| | | import store from '@/store' |
| | | import { Modal } from 'ant-design-vue'; |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import CuttingInboundModal from './modules/CuttingInboundModal' |
| | | import CuttingInboundDetailList from './CuttingInboundDetailList' |
| | | import { downFile, httpAction } from '@api/manage' |
| | | import Vue from 'vue' |
| | | import { ACCESS_TOKEN } from '@/store/mutation-types' |
| | | import store from '@/store' |
| | | import { Modal } from 'ant-design-vue' |
| | | |
| | | export default { |
| | | name: 'CuttingInboundList', |
| | | mixins:[JeecgListMixin, mixinDevice], |
| | | components: { |
| | | export default { |
| | | name: 'CuttingInboundList', |
| | | mixins: [JeecgListMixin, mixinDevice], |
| | | components: { |
| | | CuttingInboundModal, |
| | | CuttingInboundDetailList |
| | | }, |
| | | data () { |
| | | }, |
| | | data() { |
| | | return { |
| | | description: 'åå
·å
¥åºå管ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | 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: 'orderStatus_dictText' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | }, |
| | | { |
| | | 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: 'orderStatus_dictText', |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/cms/cuttingInbound/list", |
| | | delete: "/cms/cuttingInbound/delete", |
| | | deleteBatch: "/cms/cuttingInbound/deleteBatch", |
| | | exportXlsUrl: "/cms/cuttingInbound/exportXls", |
| | | importExcelUrl: "cms/cuttingInbound/importExcel", |
| | | submit: "/cms/cuttingInbound/submit", |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | ], |
| | | url: { |
| | | list: '/cms/cuttingInbound/list', |
| | | delete: '/cms/cuttingInbound/delete', |
| | | deleteBatch: '/cms/cuttingInbound/deleteBatch', |
| | | exportXlsUrl: '/cms/cuttingInbound/exportXls', |
| | | importExcelUrl: 'cms/cuttingInbound/importExcel', |
| | | submit: '/cms/cuttingInbound/submit' |
| | | }, |
| | | dictOptions: {}, |
| | | superFieldList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList() |
| | | // æ·»å åå
¸æ°æ®å è½½ |
| | | this.initDictConfig(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | }, |
| | | methods: { |
| | | this.initDictConfig() |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: { |
| | | searchQuery() { |
| | | this.loadData(1); |
| | | this.loadData(1) |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.$refs.cuttingInbounDetailList.dataSource = [] |
| | | this.loadData(1); |
| | | this.queryParam = {} |
| | | this.$refs.cuttingInbounDetailList.dataSource = [] |
| | | 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 |
| | | 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) { |
| | | return { |
| | | on: { |
| | | click: (e) => { |
| | | //å°å½åéä¸çè®°å½ä¼ å°åé¡µé¢ |
| | | this.$bus.$emit('getToolingStorageData', record) |
| | | //ç¹å»å½åè¡åè² |
| | | let oldList = document.querySelectorAll('.checked-td-of-add-table') |
| | | if (oldList) { |
| | | for (let j = 0; j < oldList.length; j++) { |
| | | oldList[j].classList.remove('checked-td-of-add-table') |
| | | } |
| | | } |
| | | let children = e.target.parentNode.children |
| | | for (let i = 0; i < children.length; i++) { |
| | | children[i].classList.add('checked-td-of-add-table') |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | return { |
| | | on: { |
| | | click: (e) => { |
| | | //å°å½åéä¸çè®°å½ä¼ å°åé¡µé¢ |
| | | this.$bus.$emit('getToolingStorageData', record) |
| | | //ç¹å»å½åè¡åè² |
| | | let oldList = document.querySelectorAll('.checked-td-of-add-table') |
| | | if (oldList) { |
| | | for (let j = 0; j < oldList.length; j++) { |
| | | oldList[j].classList.remove('checked-td-of-add-table') |
| | | } |
| | | } |
| | | let children = e.target.parentNode.children |
| | | for (let i = 0; i < children.length; i++) { |
| | | children[i].classList.add('checked-td-of-add-table') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | handleExportXls(fileName){ |
| | | if(!fileName || typeof fileName != "string"){ |
| | | fileName = "å¯¼åºæä»¶" |
| | | } |
| | | let param = this.getQueryParams(); |
| | | if(this.selectedRowKeys && this.selectedRowKeys.length>0){ |
| | | param['selections'] = this.selectedRowKeys.join(",") |
| | | } |
| | | console.log("导åºåæ°",param) |
| | | downFile(this.url.exportXlsUrl,param).then((data)=>{ |
| | | if (!data) { |
| | | // this.$message.warning("æä»¶ä¸è½½å¤±è´¥") |
| | | this.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:"æä»¶ä¸è½½å¤±è´¥" |
| | | }); |
| | | return |
| | | } |
| | | if (typeof window.navigator.msSaveBlob !== 'undefined') { |
| | | window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls') |
| | | }else{ |
| | | let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'})) |
| | | let link = document.createElement('a') |
| | | link.style.display = 'none' |
| | | link.href = url |
| | | link.setAttribute('download', fileName+'.xls') |
| | | document.body.appendChild(link) |
| | | link.click() |
| | | document.body.removeChild(link); //ä¸è½½å®æç§»é¤å
ç´ |
| | | window.URL.revokeObjectURL(url); //éæ¾æblob对象 |
| | | } |
| | | }) |
| | | handleExportXls(fileName) { |
| | | if (!fileName || typeof fileName != 'string') { |
| | | fileName = 'å¯¼åºæä»¶' |
| | | } |
| | | let param = this.getQueryParams() |
| | | if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { |
| | | param['selections'] = this.selectedRowKeys.join(',') |
| | | } |
| | | console.log('导åºåæ°', param) |
| | | downFile(this.url.exportXlsUrl, param).then((data) => { |
| | | if (!data) { |
| | | // this.$message.warning("æä»¶ä¸è½½å¤±è´¥") |
| | | this.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'æä»¶ä¸è½½å¤±è´¥' |
| | | }) |
| | | return |
| | | } |
| | | if (typeof window.navigator.msSaveBlob !== 'undefined') { |
| | | window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls') |
| | | } else { |
| | | let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' })) |
| | | let link = document.createElement('a') |
| | | link.style.display = 'none' |
| | | link.href = url |
| | | link.setAttribute('download', fileName + '.xls') |
| | | document.body.appendChild(link) |
| | | link.click() |
| | | document.body.removeChild(link) //ä¸è½½å®æç§»é¤å
ç´ |
| | | window.URL.revokeObjectURL(url) //éæ¾æblob对象 |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /* 导å
¥ */ |
| | | handleImportExcel(info){ |
| | | this.loading = true; |
| | | if (info.file.status !== 'uploading') { |
| | | console.log(info.file, info.fileList); |
| | | } |
| | | if (info.file.status === 'done') { |
| | | this.loading = false; |
| | | if (info.file.response.success) { |
| | | // this.$message.success(`${info.file.name} æä»¶ä¸ä¼ æå`); |
| | | if (info.file.response.code === 201) { |
| | | let { message, result: { msg, fileUrl, fileName } } = info.file.response |
| | | let href = window._CONFIG['domianURL'] + fileUrl |
| | | this.$warning({ |
| | | title: message, |
| | | content: (<div> |
| | | <span>{msg}</span><br/> |
| | | <span>å
·ä½è¯¦æ
请 <a href={href} target="_blank" download={fileName}>ç¹å»ä¸è½½</a> </span> |
| | | </div> |
| | | ) |
| | | }) |
| | | } else { |
| | | // this.$message.success(info.file.response.message || `${info.file.name} æä»¶ä¸ä¼ æå`) |
| | | this.$notification.success({ |
| | | message:'æ¶æ¯', |
| | | description:info.file.response.message || `${info.file.name} æä»¶ä¸ä¼ æå` |
| | | }); |
| | | } |
| | | this.loadData() |
| | | } else { |
| | | // this.$message.error(`${info.file.name} ${info.file.response.message}.`); |
| | | this.$notification.error({ |
| | | message:'æ¶æ¯', |
| | | description:`${info.file.name} ${info.file.response.message}.` |
| | | }); |
| | | } |
| | | } else if (info.file.status === 'error') { |
| | | this.loading = false; |
| | | if (info.file.response.status === 500) { |
| | | let data = info.file.response |
| | | const token = Vue.ls.get(ACCESS_TOKEN) |
| | | if (token && data.message.includes("Token失æ")) { |
| | | this.$error({ |
| | | title: 'ç»å½å·²è¿æ', |
| | | content: '徿±æï¼ç»å½å·²è¿æï¼è¯·éæ°ç»å½', |
| | | okText: 'éæ°ç»å½', |
| | | mask: false, |
| | | onOk: () => { |
| | | store.dispatch('Logout').then(() => { |
| | | Vue.ls.remove(ACCESS_TOKEN) |
| | | window.location.reload(); |
| | | handleImportExcel(info) { |
| | | this.loading = true |
| | | if (info.file.status !== 'uploading') { |
| | | console.log(info.file, info.fileList) |
| | | } |
| | | if (info.file.status === 'done') { |
| | | this.loading = false |
| | | if (info.file.response.success) { |
| | | // this.$message.success(`${info.file.name} æä»¶ä¸ä¼ æå`); |
| | | if (info.file.response.code === 201) { |
| | | let { message, result: { msg, fileUrl, fileName } } = info.file.response |
| | | let href = window._CONFIG['domianURL'] + fileUrl |
| | | this.$warning({ |
| | | title: message, |
| | | content: (<div> |
| | | <span>{msg}</span><br /> |
| | | <span>å
·ä½è¯¦æ
请 <a href={href} target="_blank" download={fileName}>ç¹å»ä¸è½½</a> </span> |
| | | </div> |
| | | ) |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | // this.$message.success(info.file.response.message || `${info.file.name} æä»¶ä¸ä¼ æå`) |
| | | this.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: info.file.response.message || `${info.file.name} æä»¶ä¸ä¼ æå` |
| | | }) |
| | | } |
| | | this.loadData() |
| | | } else { |
| | | // this.$message.error(`${info.file.name} ${info.file.response.message}.`); |
| | | this.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: `${info.file.name} ${info.file.response.message}.` |
| | | }) |
| | | } |
| | | } else { |
| | | // this.$message.error(`æä»¶ä¸ä¼ 失败: ${info.file.msg} `); |
| | | this.$notification.error({ |
| | | message:'æ¶æ¯', |
| | | description:`æä»¶ä¸ä¼ 失败: ${info.file.msg} ` |
| | | }); |
| | | } |
| | | } |
| | | } else if (info.file.status === 'error') { |
| | | this.loading = false |
| | | if (info.file.response.status === 500) { |
| | | let data = info.file.response |
| | | const token = Vue.ls.get(ACCESS_TOKEN) |
| | | if (token && data.message.includes('Token失æ')) { |
| | | this.$error({ |
| | | title: 'ç»å½å·²è¿æ', |
| | | content: '徿±æï¼ç»å½å·²è¿æï¼è¯·éæ°ç»å½', |
| | | okText: 'éæ°ç»å½', |
| | | mask: false, |
| | | onOk: () => { |
| | | store.dispatch('Logout').then(() => { |
| | | Vue.ls.remove(ACCESS_TOKEN) |
| | | window.location.reload() |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | // this.$message.error(`æä»¶ä¸ä¼ 失败: ${info.file.msg} `); |
| | | this.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: `æä»¶ä¸ä¼ 失败: ${info.file.msg} ` |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * åæ®æäº¤ |
| | | */ |
| | | // åæ®æäº¤ |
| | | |
| | | handleSubmit: function(id) { |
| | | if (!this.url.submit) { |
| | | this.$message.error('请设置url.submit屿§!') |
| | | return |
| | | } |
| | | |
| | | let targetId = id; // ä»åæ°è·åID |
| | | // å¦ææ²¡æéè¿åæ°ä¼ éIDï¼åæ£æ¥éä¸çè®°å½ |
| | | if (!targetId) { |
| | | if (this.selectedRowKeys.length != 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡è®°å½ï¼') |
| | | if (!this.url.submit) { |
| | | this.$message.error('请设置url.submit屿§!') |
| | | return |
| | | } else { |
| | | targetId = this.selectedRowKeys[0] |
| | | } |
| | | } |
| | | } |
| | | |
| | | // å°åæ°ä½ä¸ºæ¥è¯¢åæ°éå å°URLä¸ |
| | | let httpurl = this.url.submit + '?orderId=' + encodeURIComponent(targetId) |
| | | let method = 'get' |
| | | var params = {} // æ¸
空paramsï¼å ä¸ºåæ°å·²ç»å¨URLä¸ä¼ é |
| | | let targetId = id // ä»åæ°è·åID |
| | | // å¦ææ²¡æéè¿åæ°ä¼ éIDï¼åæ£æ¥éä¸çè®°å½ |
| | | if (!targetId) { |
| | | if (this.selectedRowKeys.length != 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡è®°å½ï¼') |
| | | return |
| | | } else { |
| | | targetId = this.selectedRowKeys[0] |
| | | } |
| | | } |
| | | |
| | | const that = this |
| | | // å°åæ°ä½ä¸ºæ¥è¯¢åæ°éå å°URLä¸ |
| | | let httpurl = this.url.submit + '?orderId=' + encodeURIComponent(targetId) |
| | | let method = 'get' |
| | | var params = {} // æ¸
空paramsï¼å ä¸ºåæ°å·²ç»å¨URLä¸ä¼ é |
| | | |
| | | this.$confirm({ |
| | | title: '确认æäº¤ï¼', |
| | | // content: 'æ£å¨æäº¤æ°æ®ï¼è¯·èå¿çå¾
...', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk() { |
| | | // æ¾ç¤ºå è½½æç¤º |
| | | const hide = that.$message.loading('æ£å¨æäº¤æ°æ®ï¼è¯·èå¿çå¾
...', 0); |
| | | const that = this |
| | | |
| | | // åéè¯·æ± |
| | | return httpAction(httpurl, params, method).then((res) => { |
| | | hide(); // éèå è½½æç¤º |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).catch(error => { |
| | | hide(); // éèå è½½æç¤º |
| | | that.$message.error('æäº¤å¤±è´¥: ' + error.message) |
| | | }).finally(() => { |
| | | that.loading = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | this.$confirm({ |
| | | title: '确认æäº¤ï¼', |
| | | // content: 'æ£å¨æäº¤æ°æ®ï¼è¯·èå¿çå¾
...', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk() { |
| | | // æ¾ç¤ºå è½½æç¤º |
| | | const hide = that.$message.loading('æ£å¨æäº¤æ°æ®ï¼è¯·èå¿çå¾
...', 0) |
| | | |
| | | // åéè¯·æ± |
| | | return httpAction(httpurl, params, method).then((res) => { |
| | | hide() // éèå è½½æç¤º |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).catch(error => { |
| | | hide() // éèå è½½æç¤º |
| | | that.$message.error('æäº¤å¤±è´¥: ' + error.message) |
| | | }).finally(() => { |
| | | that.loading = false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // /** |
| | | // * åæ®æäº¤ï¼æ¯æå®æ¶è¿åº¦æ´æ°ï¼ |
| | |
| | | // }) |
| | | // }, |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- 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>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | <a-card :bordered="false"> |
| | | <!-- 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>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></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;"/> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></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;" /> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical" /> |
| | |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | </a-table> |
| | | </div> |
| | | |
| | | <cutting-receive-detail-modal ref="modalForm" @ok="modalFormOk"></cutting-receive-detail-modal> |
| | | </a-card> |
| | | <cutting-receive-detail-modal ref="modalForm" @ok="modalFormOk"></cutting-receive-detail-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'CuttingReceiveDetailList', |
| | | mixins:[JeecgListMixin, mixinDevice], |
| | | components: { |
| | | }, |
| | | data () { |
| | | export default { |
| | | name: 'CuttingReceiveDetailList', |
| | | mixins: [JeecgListMixin, mixinDevice], |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | description: 'é¢ç¨åæç»ç®¡ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | description: 'é¢ç¨åæç»ç®¡ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'åå
·ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'cuttingCode' |
| | | }, |
| | | { |
| | | title: 'åå
·åç§°', |
| | | align: 'center', |
| | | dataIndex: 'cuttingName' |
| | | }, |
| | | { |
| | | title: 'åå
·æ¡ç ', |
| | | align: 'center', |
| | | dataIndex: 'cuttingBarcode' |
| | | }, |
| | | { |
| | | title: '工件æè´¨', |
| | | align: 'center', |
| | | dataIndex: 'workpieceMaterial' |
| | | }, |
| | | { |
| | | title: '使ç¨å¯¿å½', |
| | | align: 'center', |
| | | dataIndex: 'usedLife' |
| | | } |
| | | }, |
| | | { |
| | | title:'åå
·ç¼ç ', |
| | | align:"center", |
| | | dataIndex: 'cuttingCode' |
| | | }, |
| | | { |
| | | title:'åå
·åç§°', |
| | | align:"center", |
| | | dataIndex: 'cuttingName' |
| | | }, |
| | | { |
| | | title:'工件æè´¨', |
| | | align:"center", |
| | | dataIndex: 'workpieceMaterial' |
| | | }, |
| | | { |
| | | title:'使ç¨å¯¿å½', |
| | | align:"center", |
| | | dataIndex: 'usedLife' |
| | | }, |
| | | ], |
| | | url: { |
| | | list: "/cms/cuttingReceive/detailList", |
| | | delete: "/cms/cuttingReceiveDetail/delete", |
| | | deleteBatch: "/cms/cuttingReceiveDetail/deleteBatch", |
| | | exportXlsUrl: "/cms/cuttingReceiveDetail/exportXls", |
| | | importExcelUrl: "cms/cuttingReceiveDetail/importExcel", |
| | | ], |
| | | url: { |
| | | list: '/cms/cuttingReceive/detailList', |
| | | delete: '/cms/cuttingReceiveDetail/delete', |
| | | deleteBatch: '/cms/cuttingReceiveDetail/deleteBatch', |
| | | exportXlsUrl: '/cms/cuttingReceiveDetail/exportXls', |
| | | importExcelUrl: 'cms/cuttingReceiveDetail/importExcel' |
| | | |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | disableMixinCreated:true |
| | | }, |
| | | dictOptions: {}, |
| | | superFieldList: [], |
| | | disableMixinCreated: true |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | }, |
| | | methods: { |
| | | initDictConfig(){ |
| | | }, |
| | | getSuperFieldList(){ |
| | | 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:'使ç¨å¯¿å½'}) |
| | | this.superFieldList = fieldList |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList() |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('getToolingStorageData', (data) => { |
| | | this.queryParam.orderId = data.id; |
| | | this.searchQuery(); |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | initDictConfig() { |
| | | }, |
| | | getSuperFieldList() { |
| | | 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: 'cuttingBarcode', text: 'åå
·æ¡ç ' }) // æ·»å è¿ä¸è¡ |
| | | fieldList.push({ type: 'string', value: 'inventoryId', text: 'åºåID' }) |
| | | fieldList.push({ type: 'string', value: 'workpieceMaterial', text: '工件æè´¨' }) |
| | | fieldList.push({ type: 'int', value: 'usedLife', text: '使ç¨å¯¿å½' }) |
| | | this.superFieldList = fieldList |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('getToolingStorageData', (data) => { |
| | | this.queryParam.orderId = data.id |
| | | this.searchQuery() |
| | | }) |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
| | |
| | | <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="é¢ç¨åç¶æ"> |
| | | <j-search-select-tag |
| | | 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 |
| | | :md="6" |
| | | :sm="8" |
| | | > |
| | | <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="é¢ç¨åç¶æ"> |
| | | <j-search-select-tag |
| | | 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 |
| | | :md="6" |
| | | :sm="8" |
| | | > |
| | | <span |
| | | style="float: left;overflow: hidden;" |
| | | class="table-page-search-submitButtons" |
| | | style="float: left;overflow: hidden;" |
| | | class="table-page-search-submitButtons" |
| | | > |
| | | <a-button |
| | | type="primary" |
| | | @click="searchQuery" |
| | | icon="search" |
| | | type="primary" |
| | | @click="searchQuery" |
| | | icon="search" |
| | | >æ¥è¯¢</a-button> |
| | | <a-button |
| | | type="primary" |
| | | @click="searchReset" |
| | | icon="reload" |
| | | style="margin-left: 8px" |
| | | type="primary" |
| | | @click="searchReset" |
| | | icon="reload" |
| | | style="margin-left: 8px" |
| | | >éç½®</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <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-upload> --> |
| | | </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>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator"> |
| | | <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-upload> --> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | :customRow="customRow" |
| | | @change="handleTableChange"> |
| | | <!-- 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>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></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;" /> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | :scroll="{x:true}" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | :customRow="customRow" |
| | | @change="handleTableChange"> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></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;" /> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="downloadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <!-- <span slot="action" slot-scope="text, record">--> |
| | | <!-- <a @click="handleEdit(record)">ç¼è¾</a>--> |
| | | |
| | | <!-- <a-divider type="vertical" />--> |
| | | <!-- <a-dropdown>--> |
| | | <!-- <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a>--> |
| | | <!-- <a-menu slot="overlay">--> |
| | | <!-- <a-menu-item>--> |
| | | <!-- <a @click="handleDetail(record)">详æ
</a>--> |
| | | <!-- </a-menu-item>--> |
| | | <!-- <a-menu-item>--> |
| | | <!-- <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)">--> |
| | | <!-- <a>å é¤</a>--> |
| | | <!-- </a-popconfirm>--> |
| | | <!-- </a-menu-item>--> |
| | | <!-- </a-menu>--> |
| | | <!-- </a-dropdown>--> |
| | | <!-- </span>--> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)" :disabled="record.orderStatus === '2' || record.orderStatus === '3'">ç¼è¾</a> |
| | | <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-menu-item v-if="record.orderStatus === '1'"> |
| | | <a @click="handleSubmit(record.id)" :disabled="record.orderStatus === '3'">æäº¤</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.orderStatus === '1'"> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.orderStatus === '2'"> |
| | | <a @click="handleBack(record.id)">å½è¿</a> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </span> |
| | | |
| | | </a-table> |
| | | </div> |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane tab="åå
·é¢ç¨æç»" key="1"> |
| | | <cutting-receive-detail-list ref="cuttingReceiveDetailList"></cutting-receive-detail-list> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <cutting-receive-modal ref="modalForm" @ok="modalFormOk"></cutting-receive-modal> |
| | | </a-card> |
| | | </a-table> |
| | | </div> |
| | | <a-tabs defaultActiveKey="1"> |
| | | <a-tab-pane tab="åå
·é¢ç¨æç»" key="1"> |
| | | <cutting-receive-detail-list ref="cuttingReceiveDetailList"></cutting-receive-detail-list> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | <cutting-receive-modal ref="modalForm" @ok="modalFormOk"></cutting-receive-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import CuttingReceiveModal from './modules/CuttingReceiveModal' |
| | | import CuttingReceiveDetailList from './CuttingReceiveDetailList' |
| | | import { httpAction } from '@api/manage' |
| | | |
| | | 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' } |
| | | } |
| | | ], |
| | | 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}` |
| | | } |
| | | }, |
| | | methods: { |
| | | searchReset() { |
| | | this.queryParam = {} |
| | | this.$refs.cuttingReceiveDetailList.dataSource = [] |
| | | this.loadData(1) |
| | | }, |
| | | 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 |
| | | }, |
| | | customRow(record) { |
| | | name: 'CuttingReceiveList', |
| | | mixins: [JeecgListMixin, mixinDevice], |
| | | components: { |
| | | CuttingReceiveModal, |
| | | CuttingReceiveDetailList |
| | | }, |
| | | data() { |
| | | return { |
| | | on: { |
| | | click: (e) => { |
| | | //å°å½åéä¸çè®°å½ä¼ å°åé¡µé¢ |
| | | this.$bus.$emit('getToolingStorageData', record) |
| | | //ç¹å»å½åè¡åè² |
| | | let oldList = document.querySelectorAll('.checked-td-of-add-table') |
| | | if (oldList) { |
| | | for (let j = 0; j < oldList.length; j++) { |
| | | oldList[j].classList.remove('checked-td-of-add-table') |
| | | } |
| | | 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_dictText' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width: 147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | let children = e.target.parentNode.children |
| | | for (let i = 0; i < children.length; i++) { |
| | | children[i].classList.add('checked-td-of-add-table') |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/cms/cuttingReceive/list', |
| | | delete: '/cms/cuttingReceive/delete', |
| | | deleteBatch: '/cms/cuttingReceive/deleteBatch', |
| | | exportXlsUrl: '/cms/cuttingReceive/exportXls', |
| | | importExcelUrl: 'cms/cuttingReceive/importExcel', |
| | | submit: '/cms/cuttingReceive/submit', |
| | | returnBack: '/cms/cuttingReceive/handleBack' |
| | | }, |
| | | 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) |
| | | }, |
| | | 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 |
| | | }, |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | | click: (e) => { |
| | | //å°å½åéä¸çè®°å½ä¼ å°åé¡µé¢ |
| | | this.$bus.$emit('getToolingStorageData', record) |
| | | //ç¹å»å½åè¡åè² |
| | | let oldList = document.querySelectorAll('.checked-td-of-add-table') |
| | | if (oldList) { |
| | | for (let j = 0; j < oldList.length; j++) { |
| | | oldList[j].classList.remove('checked-td-of-add-table') |
| | | } |
| | | } |
| | | let children = e.target.parentNode.children |
| | | for (let i = 0; i < children.length; i++) { |
| | | children[i].classList.add('checked-td-of-add-table') |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * åæ®æäº¤ |
| | | */ |
| | | handleSubmit: function(id) { |
| | | if (!this.url.submit) { |
| | | this.$message.error('请设置url.submit屿§!') |
| | | return |
| | | } |
| | | |
| | | let targetId = id // ä»åæ°è·åID |
| | | // å¦ææ²¡æéè¿åæ°ä¼ éIDï¼åæ£æ¥éä¸çè®°å½ |
| | | if (!targetId) { |
| | | if (this.selectedRowKeys.length != 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡è®°å½ï¼') |
| | | return |
| | | } else { |
| | | targetId = this.selectedRowKeys[0] |
| | | } |
| | | } |
| | | |
| | | // å°åæ°ä½ä¸ºæ¥è¯¢åæ°éå å°URLä¸ |
| | | let httpurl = this.url.submit + '?orderId=' + encodeURIComponent(targetId) |
| | | let method = 'get' |
| | | var params = {} // æ¸
空paramsï¼å ä¸ºåæ°å·²ç»å¨URLä¸ä¼ é |
| | | |
| | | const that = this |
| | | |
| | | this.$confirm({ |
| | | title: '确认æäº¤ï¼', |
| | | // content: 'æ£å¨æäº¤æ°æ®ï¼è¯·èå¿çå¾
...', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk() { |
| | | // æ¾ç¤ºå è½½æç¤º |
| | | const hide = that.$message.loading('æ£å¨æäº¤æ°æ®ï¼è¯·èå¿çå¾
...', 0) |
| | | |
| | | // åéè¯·æ± |
| | | return httpAction(httpurl, params, method).then((res) => { |
| | | hide() // éèå è½½æç¤º |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).catch(error => { |
| | | hide() // éèå è½½æç¤º |
| | | that.$message.error('æäº¤å¤±è´¥: ' + error.message) |
| | | }).finally(() => { |
| | | that.loading = false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * åæ®é¢ç¨ |
| | | */ |
| | | |
| | | handleBack: function(id) { |
| | | if (!this.url.returnBack) { |
| | | this.$message.error('请设置url.return屿§!') |
| | | return |
| | | } |
| | | |
| | | let targetId = id // ä»åæ°è·åID |
| | | // å¦ææ²¡æéè¿åæ°ä¼ éIDï¼åæ£æ¥éä¸çè®°å½ |
| | | if (!targetId) { |
| | | if (this.selectedRowKeys.length != 1) { |
| | | this.$message.warning('è¯·éæ©ä¸æ¡è®°å½ï¼') |
| | | return |
| | | } else { |
| | | targetId = this.selectedRowKeys[0] |
| | | } |
| | | } |
| | | |
| | | // å°åæ°ä½ä¸ºæ¥è¯¢åæ°éå å°URLä¸ |
| | | let httpurl = this.url.returnBack + '?orderId=' + encodeURIComponent(targetId) |
| | | let method = 'get' |
| | | var params = {} // æ¸
空paramsï¼å ä¸ºåæ°å·²ç»å¨URLä¸ä¼ é |
| | | |
| | | const that = this |
| | | |
| | | this.$confirm({ |
| | | title: '确认æäº¤ï¼', |
| | | // content: 'æ£å¨æäº¤æ°æ®ï¼è¯·èå¿çå¾
...', |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk() { |
| | | // æ¾ç¤ºå è½½æç¤º |
| | | const hide = that.$message.loading('æ£å¨æäº¤æ°æ®ï¼è¯·èå¿çå¾
...', 0) |
| | | |
| | | // åéè¯·æ± |
| | | return httpAction(httpurl, params, method).then((res) => { |
| | | hide() // éèå è½½æç¤º |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.loadData() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).catch(error => { |
| | | hide() // éèå è½½æç¤º |
| | | that.$message.error('æäº¤å¤±è´¥: ' + error.message) |
| | | }).finally(() => { |
| | | that.loading = false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | |
| | | <template> |
| | | <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item label="é¢ç¨äºº" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-search-select-tag |
| | | :disabled="disableSubmit" |
| | | placeholder="è¯·éæ©é¢ç¨äºº" |
| | | v-decorator="['receiver', { rules: [{ required: true, message: 'è¯·éæ©é¢ç¨äºº' }] }]" |
| | | dict="sys_user,realname,id,del_flag=0" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="é¢ç¨æ¥æ"> |
| | | <a-date-picker |
| | | :disabled="disableSubmit" |
| | | style="width: 100%" |
| | | v-decorator="['receiveTime', validatorRules.receiveTime]" |
| | | /> |
| | | </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="['receiveComment', validatorRules.receiveComment]" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-search-select-tag |
| | | :disabled="disableSubmit" |
| | | placeholder="è¯·éæ©ç¡®è®¤äºº" |
| | | v-decorator="['confirmer', { rules: [{ required: false, message: 'è¯·éæ©ç¡®è®¤äºº' }] }]" |
| | | dict="sys_user,realname,id,del_flag=0" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="ç¡®è®¤æ¥æ"> |
| | | <a-date-picker |
| | | :disabled="disableSubmit" |
| | | style="width: 100%" |
| | | v-decorator="['confirmTime', validatorRules.confirmTime]" |
| | | /> |
| | | </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-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <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-form-item> |
| | | </a-col> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="å½è¿æ¥æ"> |
| | | <a-date-picker |
| | | :disabled="disableSubmit" |
| | | style="width: 100%" |
| | | v-decorator="['returnTime', validatorRules.returnTime]" |
| | | /> |
| | | </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="['returnComment', validatorRules.returnComment]" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item label="å½è¿ç¡®è®¤äºº" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-search-select-tag |
| | | :disabled="disableSubmit" |
| | | placeholder="è¯·éæ©å½è¿ç¡®è®¤äºº" |
| | | v-decorator="['returnConfirmer', { rules: [{ required: false, message: 'è¯·éæ©å½è¿ç¡®è®¤äºº' }] }]" |
| | | dict="sys_user,realname,id,del_flag=0" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="å½è¿ç¡®è®¤æ¥æ"> |
| | | <a-date-picker |
| | | :disabled="disableSubmit" |
| | | style="width: 100%" |
| | | v-decorator="['returnConfirmTime', validatorRules.returnConfirmTime]" |
| | | /> |
| | | </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="['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-table |
| | | ref="table" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | > |
| | | <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'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | | /> |
| | | </div> |
| | | </template> |
| | | <span slot="action" slot-scope="text, record, index"> |
| | | <a-modal :title="title" :visible="visible" :fullScreen="true" :width="1200" @ok="handleOk" @cancel="handleCancel"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item label="é¢ç¨äºº" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-search-select-tag |
| | | :disabled="disableSubmit" |
| | | placeholder="è¯·éæ©é¢ç¨äºº" |
| | | v-decorator="['receiver', { rules: [{ required: true, message: 'è¯·éæ©é¢ç¨äºº' }] }]" |
| | | dict="sys_user,realname,id,del_flag=0" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="é¢ç¨æ¥æ"> |
| | | <a-date-picker |
| | | :disabled="disableSubmit" |
| | | style="width: 100%" |
| | | v-decorator="['receiveTime', validatorRules.receiveTime]" |
| | | /> |
| | | </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="['receiveComment', validatorRules.receiveComment]" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item label="确认人" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-search-select-tag |
| | | :disabled="disableSubmit" |
| | | placeholder="è¯·éæ©ç¡®è®¤äºº" |
| | | v-decorator="['confirmer', { rules: [{ required: false, message: 'è¯·éæ©ç¡®è®¤äºº' }] }]" |
| | | dict="sys_user,realname,id,del_flag=0" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="ç¡®è®¤æ¥æ"> |
| | | <a-date-picker |
| | | :disabled="disableSubmit" |
| | | style="width: 100%" |
| | | v-decorator="['confirmTime', validatorRules.confirmTime]" |
| | | /> |
| | | </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-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <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-form-item> |
| | | </a-col> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="å½è¿æ¥æ"> |
| | | <a-date-picker |
| | | :disabled="disableSubmit" |
| | | style="width: 100%" |
| | | v-decorator="['returnTime', validatorRules.returnTime]" |
| | | /> |
| | | </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="['returnComment', validatorRules.returnComment]" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row style="width: 100%"> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item label="å½è¿ç¡®è®¤äºº" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <j-search-select-tag |
| | | :disabled="disableSubmit" |
| | | placeholder="è¯·éæ©å½è¿ç¡®è®¤äºº" |
| | | v-decorator="['returnConfirmer', { rules: [{ required: false, message: 'è¯·éæ©å½è¿ç¡®è®¤äºº' }] }]" |
| | | dict="sys_user,realname,id,del_flag=0" |
| | | /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24 / 2"> |
| | | <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="å½è¿ç¡®è®¤æ¥æ"> |
| | | <a-date-picker |
| | | :disabled="disableSubmit" |
| | | style="width: 100%" |
| | | v-decorator="['returnConfirmTime', validatorRules.returnConfirmTime]" |
| | | /> |
| | | </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="['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-table |
| | | ref="table" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | > |
| | | <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'" |
| | | :value="text" |
| | | @change="(e) => handleChange(e, record.key, col, index)" |
| | | :min="1" |
| | | /> |
| | | </div> |
| | | </template> |
| | | <span slot="action" slot-scope="text, record, index"> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record, index)"> |
| | | <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" type="primary">æäº¤</a-button> |
| | | </template> |
| | | </a-table> |
| | | <template slot="footer" v-if="disableSubmit == false"> |
| | | <a-button :style="{ marginRight: '8px' }" @click="handleCancel">å
³é</a-button> |
| | | <a-button @click="handleOk" type="primary">æäº¤</a-button> |
| | | </template> |
| | | |
| | | <template slot="footer" v-if="disableSubmit == true"> |
| | | <a-button :style="{ marginRight: '8px' }" @click="handleCancel">å
³é</a-button> |
| | | </template> |
| | | <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 slot="footer" v-if="disableSubmit == true"> |
| | | <a-button :style="{ marginRight: '8px' }" @click="handleCancel">å
³é</a-button> |
| | | </template> |
| | | <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 JSelectInventoryModal from '@views/cms/modules/JSelectInventoryModal.vue' |
| | | |
| | | export default { |
| | | name: 'CuttingInboundModal', |
| | | components: { |
| | | JSelectToolingModal, |
| | | JSelectInventoryModal, |
| | | JMultiSelectTag, |
| | | JDictSelectTag, |
| | | store, |
| | | moment |
| | | }, |
| | | 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 |
| | | }, |
| | | title: 'æ°å¢', |
| | | visible: false, |
| | | selectedRowKeys: {}, |
| | | 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: [], |
| | | param: {}, |
| | | validatorRules: {}, |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'åå
·ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'cuttingCode', |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: 'åå
·åç§°', |
| | | align: 'center', |
| | | dataIndex: 'cuttingName' |
| | | }, |
| | | { |
| | | title: '工件æè´¨', |
| | | align: 'center', |
| | | dataIndex: 'workpieceMaterial', |
| | | scopedSlots: { customRender: 'workpieceMaterial' } |
| | | }, |
| | | { |
| | | title: '使ç¨å¯¿å½', |
| | | align: 'center', |
| | | dataIndex: 'usedLife', |
| | | scopedSlots: { customRender: 'usedLife' } |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | add: '/cms/cuttingReceive/add', |
| | | detailList: '/cms/cuttingReceive/detailList' |
| | | }, |
| | | orderId: '', |
| | | disableSubmit: false |
| | | } |
| | | }, |
| | | methods: { |
| | | modalFormOk() { |
| | | |
| | | }, |
| | | getQueryParams() { |
| | | this.param.pageNo = this.ipagination.current |
| | | this.param.pageSize = this.ipagination.pageSize |
| | | return filterObj(this.param) |
| | | }, |
| | | 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 }) |
| | | }, |
| | | edit(record) { |
| | | record.receiver = store.getters.userInfo.id |
| | | record.receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') |
| | | this.form.resetFields() |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.disableSubmit = false |
| | | if (record.id) { |
| | | this.orderId = record.id |
| | | this.detailList(this.orderId) |
| | | name: 'CuttingInboundModal', |
| | | components: { |
| | | JSelectToolingModal, |
| | | JSelectInventoryModal, |
| | | JMultiSelectTag, |
| | | JDictSelectTag, |
| | | store, |
| | | moment |
| | | }, |
| | | 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 |
| | | }, |
| | | title: 'æ°å¢', |
| | | visible: false, |
| | | selectedRowKeys: {}, |
| | | 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: [], |
| | | param: {}, |
| | | validatorRules: {}, |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'åå
·ç¼ç ', |
| | | align: 'center', |
| | | dataIndex: 'cuttingCode', |
| | | width: 150 |
| | | }, |
| | | { |
| | | title: 'åå
·åç§°', |
| | | align: 'center', |
| | | dataIndex: 'cuttingName' |
| | | }, |
| | | { |
| | | title: '工件æè´¨', |
| | | align: 'center', |
| | | dataIndex: 'workpieceMaterial', |
| | | scopedSlots: { customRender: 'workpieceMaterial' } |
| | | }, |
| | | { |
| | | title: '使ç¨å¯¿å½', |
| | | align: 'center', |
| | | dataIndex: 'usedLife', |
| | | scopedSlots: { customRender: 'usedLife' } |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | align: 'center', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | add: '/cms/cuttingReceive/add', |
| | | detailList: '/cms/cuttingReceive/detailList' |
| | | }, |
| | | orderId: '', |
| | | disableSubmit: false |
| | | } |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue( |
| | | pick(this.model, 'receiver', 'receiveTime', 'receiveComment', 'confirmer', 'confirmTime', 'confirmComment' |
| | | , 'returnFlag', 'returnTime', 'returnComment', 'returnConfirmer', 'returnConfirmTime', 'returnConfirmComment') |
| | | ) |
| | | }, |
| | | methods: { |
| | | modalFormOk() { |
| | | |
| | | }, |
| | | getQueryParams() { |
| | | this.param.pageNo = this.ipagination.current |
| | | this.param.pageSize = this.ipagination.pageSize |
| | | return filterObj(this.param) |
| | | }, |
| | | 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 }) |
| | | }, |
| | | edit(record) { |
| | | record.receiver = store.getters.userInfo.id |
| | | record.receiveTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss') |
| | | this.form.resetFields() |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.disableSubmit = false |
| | | if (record.id) { |
| | | this.orderId = record.id |
| | | this.detailList(this.orderId) |
| | | } |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue( |
| | | pick(this.model, 'receiver', 'receiveTime', 'receiveComment', 'confirmer', 'confirmTime', 'confirmComment' |
| | | , 'returnFlag', 'returnTime', 'returnComment', 'returnConfirmer', 'returnConfirmTime', 'returnConfirmComment') |
| | | ) |
| | | }) |
| | | }, |
| | | handleDelete(record, index) { |
| | | this.dataSource.splice(index, 1) |
| | | }, |
| | | handleChange(value, key, column, index) { |
| | | //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index |
| | | const temp = [...this.dataSource] |
| | | const target = temp.filter((item) => key === item.key)[index] |
| | | if (target) { |
| | | target[column.dataIndex] = value |
| | | this.dataSource = temp |
| | | } |
| | | }, |
| | | selectTooling: function() { |
| | | let ids = [] |
| | | for (let i = 0; i < this.dataSource.length; i++) { |
| | | 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.inventoryModalForm.showModal(ids) |
| | | this.$refs.inventoryModalForm.title = 'éæ©åºååå
·' |
| | | this.$refs.inventoryModalForm.disableSubmit = false |
| | | |
| | | }, |
| | | detailList(orderId) { |
| | | this.param.orderId = orderId |
| | | getAction(this.url.detailList, this.getQueryParams()).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result |
| | | } |
| | | }) |
| | | }, |
| | | filterOption(input, option) { |
| | | return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 |
| | | }, |
| | | handleOk() { |
| | | if (this.dataSource.length == 0) { |
| | | this.$message.error('请å
éæ©å
¥åºåå
·') |
| | | 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 |
| | | |
| | | // ç¡®ä¿ detailData å
å« inventoryId |
| | | formData.detailData = this.dataSource.map(item => ({ |
| | | ...item, |
| | | // ç¡®ä¿ inventoryId 被æ£ç¡®ä¼ é |
| | | inventoryId: item.inventoryId |
| | | })) |
| | | |
| | | 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() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.dataSource = [] |
| | | this.visible = false |
| | | this.disableSubmit = false |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | console.log('æ¥æ¶å°çéæ©æ°æ®:', data) |
| | | //getCurrSelected äºä»¶ æ¥æ¶ç»ä»¶ä¼ éçåæ° |
| | | for (let i = 0; i < data.length; i++) { |
| | | this.dataSource.push({ |
| | | inventoryId: data[i].id, |
| | | cuttingCode: data[i].cuttingCode, |
| | | cuttingName: data[i].cuttingName, |
| | | cuttingId: data[i].cuttingId |
| | | }) |
| | | } |
| | | console.log('æ´æ°åçæ°æ®æº:', this.dataSource) |
| | | }) |
| | | }, |
| | | handleDelete(record, index) { |
| | | this.dataSource.splice(index, 1) |
| | | }, |
| | | handleChange(value, key, column, index) { |
| | | //let t = (this.ipaginationm.current - 1) * this.ipaginationm.pageSize + index |
| | | const temp = [...this.dataSource] |
| | | const target = temp.filter((item) => key === item.key)[index] |
| | | if (target) { |
| | | target[column.dataIndex] = value |
| | | this.dataSource = temp |
| | | } |
| | | }, |
| | | selectTooling: function() { |
| | | let ids = [] |
| | | for (let i = 0; i < this.dataSource.length; i++) { |
| | | 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.inventoryModalForm.showModal(ids) |
| | | this.$refs.inventoryModalForm.title = 'éæ©åå
·' |
| | | this.$refs.inventoryModalForm.disableSubmit = false |
| | | |
| | | }, |
| | | detailList(orderId) { |
| | | this.param.orderId = orderId |
| | | getAction(this.url.detailList, this.getQueryParams()).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result |
| | | } |
| | | }) |
| | | }, |
| | | filterOption(input, option) { |
| | | return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0 |
| | | }, |
| | | handleOk() { |
| | | if (this.dataSource.length == 0) { |
| | | this.$message.error('请å
éæ©å
¥åºåå
·') |
| | | 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 |
| | | |
| | | // æ·»å æ´æ°åºåç¶æçé»è¾ |
| | | 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() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.dataSource = [] |
| | | this.visible = false |
| | | this.disableSubmit = false |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('selectionRows', (data) => { |
| | | console.log('æ¥æ¶å°çéæ©æ°æ®:', data) |
| | | //getCurrSelected äºä»¶ æ¥æ¶ç»ä»¶ä¼ éçåæ° |
| | | for (let i = 0; i < data.length; i++) { |
| | | this.dataSource.push({ |
| | | inventoryId: data[i].id, |
| | | cuttingCode: data[i].cuttingCode, |
| | | cuttingName: data[i].cuttingName, |
| | | cuttingId: data[i].cuttingId |
| | | }) |
| | | } |
| | | console.log('æ´æ°åçæ°æ®æº:', this.dataSource) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <a-divider type="vertical" /> |
| | | <a @click="handleRePublish(record)">éåå¸</a> |
| | | </span> |
| | | <span v-if="record.workOrderStatus === 'PUBLISHED' && record.completenessCheckFlag === '0'"> |
| | | <a-divider type="vertical" /> |
| | | <a @click="handleCompletenessCheck(record)">é½å¥æ§æ£æ¥</a> |
| | | </span> |
| | | <span v-if="record.workOrderStatus === 'PUBLISHED' && record.completenessCheckFlag === '1' && record.equipmentInspectionFlag === '0'"> |
| | | <a-divider type="vertical" /> |
| | | <a @click="handleEquipmentInspection(record)">设å¤ç¹æ£</a> |
| | | </span> |
| | | <span v-if="record.workOrderStatus === 'PUBLISHED' && record.completenessCheckFlag === '1' && record.equipmentInspectionFlag === '1' && record.processInspectionFlag === '0'"> |
| | | <a-divider type="vertical" /> |
| | | <a @click="handleProcessCheck(record)">å·¥èºç¹æ£</a> |
| | | </span> |
| | | <span v-if="record.workOrderStatus === 'PUBLISHED' && record.completenessCheckFlag === '1' && record.equipmentInspectionFlag === '1' && record.processInspectionFlag === '1'"> |
| | | <span v-if="record.workOrderStatus === 'PUBLISHED'"> |
| | | <a-divider type="vertical" /> |
| | | <a-popconfirm title="ç¡®å®å¼å§æ§è¡å?" @confirm="() => handleExecute(record.id)"> |
| | | <a>æ§è¡</a> |
| | |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.workOrderStatus === 'PUBLISHED' && record.completenessCheckFlag === '0'"> |
| | | <a @click="handleCompletenessCheck(record)">é½å¥æ§æ£æ¥</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.workOrderStatus === 'PUBLISHED' && record.equipmentInspectionFlag === '0'"> |
| | | <a @click="handleEquipmentInspection(record)">设å¤ç¹æ£</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.workOrderStatus === 'PUBLISHED' && record.processInspectionFlag === '0'"> |
| | | <a @click="handleProcessCheck(record)">å·¥èºç¹æ£</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.workOrderStatus === 'NEW'"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | |
| | | <MesProductionWorkOrderCompletenessCheckModal ref="MesProductionWorkOrderCompletenessCheckModal" @ok="modalFormOk"></MesProductionWorkOrderCompletenessCheckModal> |
| | | <MesProductionWorkOrderEquipmentInspectionModal ref="MesProductionWorkOrderEquipmentInspectionModal" @ok="modalFormOk"></MesProductionWorkOrderEquipmentInspectionModal> |
| | | <MesProductionWorkOrderProcessCheckModal ref="MesProductionWorkOrderProcessCheckModal" @ok="modalFormOk"></MesProductionWorkOrderProcessCheckModal> |
| | | <MesProductionWorkOrderCheckBeforeExecuteModal ref="MesProductionWorkOrderCheckBeforeExecuteModal" @ok="modalFormOk"></MesProductionWorkOrderCheckBeforeExecuteModal> |
| | | </a-card> |
| | | </template> |
| | | |
| | |
| | | import MesProductionWorkOrderCompletenessCheckModal from '@views/mes/modules/MesProductionWorkOrderCompletenessCheckModal.vue' |
| | | import MesProductionWorkOrderEquipmentInspectionModal from '@views/mes/modules/MesProductionWorkOrderEquipmentInspectionModal.vue' |
| | | import MesProductionWorkOrderProcessCheckModal from '@views/mes/modules/MesProductionWorkOrderProcessCheckModal.vue' |
| | | import MesProductionWorkOrderCheckBeforeExecuteModal from '@views/mes/modules/MesProductionWorkOrderCheckBeforeExecuteModal.vue' |
| | | import JSelectFactory from '@comp/jeecgbiz/JSelectFactory.vue' |
| | | import moment from 'moment/moment' |
| | | |
| | |
| | | MesProductionWorkOrderReportModal, |
| | | MesProductionWorkOrderCompletenessCheckModal, |
| | | MesProductionWorkOrderEquipmentInspectionModal, |
| | | MesProductionWorkOrderProcessCheckModal |
| | | MesProductionWorkOrderProcessCheckModal, |
| | | MesProductionWorkOrderCheckBeforeExecuteModal |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | queryUnloadingByLoadingId:'/mes/mesMaterialUnloading/queryUnloadingByLoadingId', |
| | | publish: '/mes/mesProductionWorkOrder/publish', |
| | | execute: '/mes/mesProductionWorkOrder/execute', |
| | | checkBeforeExecute: '/mes/mesProductionWorkOrder/checkBeforeExecute' |
| | | }, |
| | | dictOptions: {}, |
| | | superFieldList: [], |
| | |
| | | }) |
| | | }, |
| | | handleExecute(id) { |
| | | getAction(this.url.execute, { id: id }).then((res) => { |
| | | getAction(this.url.checkBeforeExecute, { id: id }).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success(res.message) |
| | | this.loadData() |
| | | const completenessCheckFlag = res.result.completenessCheckFlag |
| | | const equipmentInspectFlag = res.result.equipmentInspectFlag |
| | | const processCheckFlag = res.result.processCheckFlag |
| | | if (completenessCheckFlag && equipmentInspectFlag && processCheckFlag) { |
| | | getAction(this.url.execute, { id: id }).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success(res.message) |
| | | this.loadData() |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | } else { |
| | | const unCompletenessCheckList = res.result.unCompletenessCheckList |
| | | const unInspectEquipmentList = res.result.unInspectEquipmentList |
| | | const unCheckEquipmentList = res.result.unCheckEquipmentList |
| | | if (!completenessCheckFlag && !unCompletenessCheckList) { |
| | | this.$message.warning('请å
è¿è¡é½å¥æ§æ£æ¥ï¼') |
| | | return |
| | | } |
| | | if (!equipmentInspectFlag && !unInspectEquipmentList) { |
| | | this.$message.warning('请å
è¿è¡è®¾å¤ç¹æ£ï¼') |
| | | return |
| | | } |
| | | if (!processCheckFlag && !unCheckEquipmentList) { |
| | | this.$message.warning('请å
è¿è¡å·¥èºç¹æ£ï¼') |
| | | return |
| | | } |
| | | this.$refs.MesProductionWorkOrderCheckBeforeExecuteModal.open(id, res.result) |
| | | } |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="æå¨ç©æ" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber"> |
| | | <a-select v-model="model.materialNumber" placeholder="è¯·éæ©æå¨ç©æ" @change="handleMaterialNumberChange"> |
| | | <a-select-option v-for="item in materialList" :value="item.materialNumber" :title="item.materialName" :key="item.materialNumber"> |
| | | {{ item.materialName }} |
| | | </a-select-option> |
| | | </a-select> |
| | | <j-search-select-tag v-model="model.materialNumber" placeholder="è¯·éæ©æå¨ç©æ" |
| | | :dict-options="materialList" @change="handleMaterialNumberChange"> |
| | | </j-search-select-tag> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | |
| | | workOrderQuery: '/mes/mesProductionWorkOrder/queryById' |
| | | }, |
| | | materialList: [], //ç©æå表 |
| | | workOrderObj: {}, //å·¥å对象 |
| | | workOrderObj: {} //å·¥å对象 |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | this.model.workOrderCode = this.model.workOrderId_dictText |
| | | this.visible = true |
| | | if (this.model.workOrderId) { |
| | | this.editable = true; |
| | | this.editable = true |
| | | let workOrderRes = await this.loadProductionWorkOrder(this.model.workOrderId) |
| | | if(!workOrderRes.success || !workOrderRes.result) { |
| | | return; |
| | | if (!workOrderRes.success || !workOrderRes.result) { |
| | | return |
| | | } |
| | | //æäº§å·¥åèµå¼ |
| | | this.workOrderObj = Object.assign({}, workOrderRes.result); |
| | | this.workOrderObj = Object.assign({}, workOrderRes.result) |
| | | //ç©æå表 |
| | | let materialListRes = await this.loadMaterialList(workOrderRes.result.materialNumber) |
| | | if (materialListRes.success && materialListRes.result && materialListRes.result.length > 0) { |
| | | this.materialList = [...materialListRes.result] |
| | | this.materialList = materialListRes.result.map(item => ({ |
| | | ...item, |
| | | value: item.materialNumber, |
| | | text: item.materialName |
| | | })) |
| | | } else { |
| | | this.materialList = [] |
| | | } |
| | |
| | | this.model.targetWarehouseId = undefined |
| | | this.model.warehouseName = '' |
| | | } |
| | | }else { |
| | | this.editable = false; |
| | | } else { |
| | | this.editable = false |
| | | } |
| | | }, |
| | | async selectConfirm(rows) { |
| | | if (rows && rows.length > 0) { |
| | | //æ¸
空å
³èæ°æ® |
| | | this.model.materialNumber = undefined; |
| | | this.model.materialName = ''; |
| | | this.model.specifiedQuantity = 0; |
| | | this.model.materialNumber = undefined |
| | | this.model.materialName = '' |
| | | this.model.specifiedQuantity = 0 |
| | | //èµå¼æ°çæ°æ® |
| | | this.model.workOrderId = rows[0].id |
| | | this.model.workOrderCode = rows[0].workOrderCode |
| | | //æäº§å·¥åèµå¼ |
| | | this.workOrderObj = Object.assign({}, rows[0]); |
| | | this.workOrderObj = Object.assign({}, rows[0]) |
| | | let materialListRes = await this.loadMaterialList(rows[0].materialNumber) |
| | | if (materialListRes.success && materialListRes.result && materialListRes.result.length > 0) { |
| | | this.materialList = [...materialListRes.result] |
| | | this.materialList = materialListRes.result.map(item => ({ |
| | | ...item, |
| | | value: item.materialNumber, |
| | | text: item.materialName |
| | | })) |
| | | } else { |
| | | this.materialList = [] |
| | | } |
| | |
| | | } |
| | | } else { |
| | | //æ¸
空å
³èæ°æ® |
| | | this.model.materialNumber = undefined; |
| | | this.model.materialName = ''; |
| | | this.model.specifiedQuantity = 0; |
| | | this.model.materialNumber = undefined |
| | | this.model.materialName = '' |
| | | this.model.specifiedQuantity = 0 |
| | | this.materialList = [] |
| | | this.model.targetWarehouseId = undefined |
| | | this.model.warehouseName = '' |
| | | this.workOrderObj = {}; |
| | | this.workOrderObj = {} |
| | | } |
| | | }, |
| | | submitForm() { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | |
| | | <a-divider class="divider-title">é½å¥æ§æ£æ¥</a-divider> |
| | | <a-list> |
| | | <a-list-item v-for="(item, index) in unCompletenessCheckList" :key="index"> |
| | | <span>ç©æ <strong>{{ item }}</strong> é½å¥æ§æ£æ¥ä¸éè¿</span> |
| | | </a-list-item> |
| | | </a-list> |
| | | <a-divider class="divider-title">设å¤ç¹æ£</a-divider> |
| | | <a-list> |
| | | <a-list-item v-for="(item, index) in unInspectEquipmentList" :key="index"> |
| | | <span>è®¾å¤ <strong>{{ item }}</strong> æªè¿è¡è®¾å¤ç¹æ£</span> |
| | | </a-list-item> |
| | | </a-list> |
| | | <a-divider class="divider-title">å·¥èºç¹æ£</a-divider> |
| | | <a-list> |
| | | <a-list-item v-for="(item, index) in unCheckEquipmentList" :key="index"> |
| | | <span>è®¾å¤ <strong>{{ item }}</strong> æªè¿è¡å·¥èºç¹æ£</span> |
| | | </a-list-item> |
| | | </a-list> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { postAction, getAction } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'MesProductionWorkOrderCheckBeforeExecuteModal', |
| | | data () { |
| | | return { |
| | | title: '工忧è¡åæ£æ¥', |
| | | width: 800, |
| | | visible: false, |
| | | loading: false, |
| | | disableSubmit: false, |
| | | model: {}, |
| | | validatorRules: { |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 18 }, |
| | | }, |
| | | url: { |
| | | execute: '/mes/mesProductionWorkOrder/execute' |
| | | }, |
| | | orderId: null, |
| | | unCompletenessCheckList: [], |
| | | unInspectEquipmentList: [], |
| | | unCheckEquipmentList: [] |
| | | } |
| | | }, |
| | | computed: { |
| | | formDisabled(){ |
| | | return this.disabled |
| | | }, |
| | | }, |
| | | methods: { |
| | | open (id, record) { |
| | | this.orderId = id |
| | | this.unCompletenessCheckList = record.unCompletenessCheckList |
| | | this.unInspectEquipmentList = record.unInspectEquipmentList |
| | | this.unCheckEquipmentList = record.unCheckEquipmentList |
| | | this.visible = true |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk () { |
| | | this.$confirm({ |
| | | title: '确认æä½', |
| | | content: '以䏿£æ¥ãç¹æ£é¡¹æªå®æï¼ç¡®è®¤ç»§ç»æ§è¡å·¥åï¼', |
| | | onOk: () => { |
| | | getAction(this.url.execute, {id: this.orderId}).then(res => { |
| | | if (res.success) { |
| | | this.$message.success(res.message) |
| | | this.submitCallback() |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | } |
| | | }) |
| | | }, |
| | | submitCallback(){ |
| | | this.$emit('ok'); |
| | | this.unCompletenessCheckList = [] |
| | | this.unInspectEquipmentList = [] |
| | | this.unCheckEquipmentList = [] |
| | | this.visible = false; |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | .divider-title { |
| | | font-style: italic; |
| | | color: blue; |
| | | } |
| | | |
| | | </style> |
| | |
| | | workOrderStatus: this.orderStatus, |
| | | }, |
| | | url: { |
| | | list: "/mes/mesProductionWorkOrder/list" |
| | | list: "/mes/mesProductionWorkOrder/queryWorkOrderByTransfer" |
| | | }, |
| | | columns: [ |
| | | { |