| | |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="产线"> |
| | | <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="类型"> |
| | | <j-search-select-tag placeholder="请选择类型" v-model="queryParam.category" :dict-options="categoryDictOptions"></j-search-select-tag> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="物料编码"> |
| | | <j-input placeholder="请输入物料编码" v-model="queryParam.materialNumber"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <template v-if="toggleSearchStatus"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="物料名称"> |
| | | <j-input placeholder="请输入物料名称" v-model="queryParam.materialName"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="批次号"> |
| | | <j-input placeholder="请输入批次号" v-model="queryParam.batchNumber"></j-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | </template> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
| | | <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
| | | <a @click="handleToggleSearch" style="margin-left: 8px"> |
| | | {{ toggleSearchStatus ? '收起' : '展开' }} |
| | | <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> |
| | | </a> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | |
| | | |
| | | <!-- 操作按钮区域 --> |
| | | <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> |
| | | <!-- 高级查询区域 --> |
| | | <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> |
| | | </a-dropdown> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">上料</a-button> |
| | | </div> |
| | | |
| | | <!-- table区域-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a |
| | | style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">清空</a> |
| | | </div> |
| | | |
| | |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | 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> |
| | | |
| | | <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 slot="categorySlot" slot-scope="text, record"> |
| | | <a-tag color="orange" v-if="record.category === 'LOADING'">上料</a-tag> |
| | | <a-tag color="blue" v-else-if="record.category === 'UNLOADING'">下料</a-tag> |
| | | </span> |
| | | |
| | | <span slot="unloadingFlagSlot" slot-scope="text, record"> |
| | | <a-tag color="green" v-if="record.unloadingFlag === '0'">正常</a-tag> |
| | | <a-tag color="red" v-else-if="record.unloadingFlag === '1'">已下料</a-tag> |
| | | </span> |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">下料</a> |
| | | <a-divider type="vertical" /> |
| | | <a @click="handleDetail(record)">详情</a> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | |
| | |
| | | data () { |
| | | return { |
| | | description: '上料管理页面', |
| | | categoryDictOptions: [ |
| | | { |
| | | value: 'LOADING', |
| | | text: '上料' |
| | | }, |
| | | { |
| | | value: 'UNLOADING', |
| | | text: '下料' |
| | | }, |
| | | ], |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | align: 'center', |
| | | customRender:function (t,r,index) { |
| | | return parseInt(index)+1; |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title:'删除标记', |
| | | align:"center", |
| | | dataIndex: 'delFlag' |
| | | title: '产线', |
| | | align: 'center', |
| | | dataIndex: 'factoryId_dictText' |
| | | }, |
| | | { |
| | | title:'工单ID', |
| | | align:"center", |
| | | dataIndex: 'workOrderId' |
| | | }, |
| | | { |
| | | title:'设备ID', |
| | | align:"center", |
| | | dataIndex: 'equipmentId' |
| | | }, |
| | | { |
| | | title:'工序编码', |
| | | align:"center", |
| | | dataIndex: 'processCode' |
| | | }, |
| | | { |
| | | title:'工序名称', |
| | | align:"center", |
| | | dataIndex: 'processName' |
| | | title: '线边库', |
| | | align: 'center', |
| | | dataIndex: 'warehouseId_dictText' |
| | | }, |
| | | { |
| | | title:'物料编码', |
| | | align:"center", |
| | | align: 'center', |
| | | dataIndex: 'materialNumber' |
| | | }, |
| | | { |
| | | title:'物料名称', |
| | | align:"center", |
| | | align: 'center', |
| | | dataIndex: 'materialName' |
| | | }, |
| | | { |
| | | title:'批次号', |
| | | align:"center", |
| | | align: 'center', |
| | | dataIndex: 'batchNumber' |
| | | }, |
| | | { |
| | | title:'数量', |
| | | align:"center", |
| | | align: 'center', |
| | | dataIndex: 'quantity' |
| | | }, |
| | | { |
| | | title:'剩余数量', |
| | | align:"center", |
| | | align: 'center', |
| | | dataIndex: 'remainingQuantity' |
| | | }, |
| | | { |
| | | title: '钢球尺寸', |
| | | align: 'center', |
| | | dataIndex: 'steelBallSize_dictText' |
| | | }, |
| | | { |
| | | title: '类型', |
| | | align: 'center', |
| | | dataIndex: 'category', |
| | | scopedSlots: { |
| | | customRender: 'categorySlot' |
| | | }, |
| | | }, |
| | | { |
| | | title: '下料标记', |
| | | align: 'center', |
| | | dataIndex: 'unloadingFlag', |
| | | scopedSlots: { |
| | | customRender: 'unloadingFlagSlot' |
| | | }, |
| | | }, |
| | | { |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | fixed:"right", |
| | | align: 'center', |
| | | fixed: 'right', |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/mes/mesMaterialLoading/list", |
| | | delete: "/mes/mesMaterialLoading/delete", |
| | | deleteBatch: "/mes/mesMaterialLoading/deleteBatch", |
| | | exportXlsUrl: "/mes/mesMaterialLoading/exportXls", |
| | | importExcelUrl: "mes/mesMaterialLoading/importExcel", |
| | | |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | list: '/mes/mesMaterialLoading/list' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSuperFieldList(); |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | }, |
| | | methods: { |
| | | initDictConfig(){ |
| | | }, |
| | | getSuperFieldList(){ |
| | | let fieldList=[]; |
| | | fieldList.push({type:'int',value:'delFlag',text:'删除标记',dictCode:''}) |
| | | fieldList.push({type:'string',value:'workOrderId',text:'工单ID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'equipmentId',text:'设备ID',dictCode:''}) |
| | | fieldList.push({type:'string',value:'processCode',text:'工序编码',dictCode:''}) |
| | | fieldList.push({type:'string',value:'processName',text:'工序名称',dictCode:''}) |
| | | fieldList.push({type:'string',value:'materialNumber',text:'物料编码',dictCode:''}) |
| | | fieldList.push({type:'string',value:'materialName',text:'物料名称',dictCode:''}) |
| | | fieldList.push({type:'string',value:'batchNumber',text:'批次号',dictCode:''}) |
| | | fieldList.push({type:'double',value:'quantity',text:'数量',dictCode:''}) |
| | | fieldList.push({type:'double',value:'remainingQuantity',text:'剩余数量',dictCode:''}) |
| | | this.superFieldList = fieldList |
| | | } |
| | | } |
| | | computed: {}, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | <style scoped> |
| | |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="删除标记" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag"> |
| | | <a-input-number v-model="model.delFlag" placeholder="请输入删除标记" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="工单ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrderId"> |
| | | <a-input v-model="model.workOrderId" placeholder="请输入工单ID" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="设备ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId"> |
| | | <a-input v-model="model.equipmentId" placeholder="请输入设备ID" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="工序编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processCode"> |
| | | <a-input v-model="model.processCode" placeholder="请输入工序编码" ></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="工序名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="processName"> |
| | | <a-input v-model="model.processName" placeholder="请输入工序名称" ></a-input> |
| | | <a-form-model-item label="产线" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryId"> |
| | | <j-search-select-tag placeholder="请选择产线" v-model="model.factoryId" |
| | | dict="base_factory,factory_name,id,del_flag=0 and factory_category='3'" |
| | | @change="factorySelectChange"></j-search-select-tag> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="物料编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialNumber"> |
| | | <a-input v-model="model.materialNumber" placeholder="请输入物料编码" ></a-input> |
| | | <j-search-select-tag v-model="model.materialNumber" placeholder="请选择物料编码" |
| | | :dict-options="materialNumberDictOptions" |
| | | @change="materialNumberSelectChange"></j-search-select-tag> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="物料名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialName"> |
| | | <a-input v-model="model.materialName" placeholder="请输入物料名称" ></a-input> |
| | | <a-input v-model="model.materialName" placeholder="请输入物料名称" readOnly></a-input> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="批次号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="batchNumber"> |
| | | <a-input v-model="model.batchNumber" placeholder="请输入批次号" ></a-input> |
| | | <j-search-select-tag v-model="model.batchNumber" placeholder="请选择批次号" |
| | | :dict-options="batchNumberDictOptions" |
| | | @change="batchNumberSelectChange"></j-search-select-tag> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | |
| | | <a-input-number v-model="model.quantity" placeholder="请输入数量" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="剩余数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remainingQuantity"> |
| | | <a-input-number v-model="model.remainingQuantity" placeholder="请输入剩余数量" style="width: 100%" /> |
| | | <a-col :span="12" v-if="materialCategory === 'STEEL_BALL'"> |
| | | <a-form-model-item label="钢球尺寸" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="steelBallSize"> |
| | | <j-search-select-tag v-model="model.steelBallSize" placeholder="请选择钢球尺寸" dict="steel_ball_size" |
| | | style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | |
| | | export default { |
| | | name: 'MesMaterialLoadingForm', |
| | | components: { |
| | | }, |
| | | components: {}, |
| | | props: { |
| | | //表单禁用 |
| | | disabled: { |
| | |
| | | }, |
| | | data () { |
| | | return { |
| | | model:{ |
| | | }, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | factoryId: [ |
| | | { required: true, message: '产线是必选项', trigger: 'change' } |
| | | ], |
| | | materialNumber: [ |
| | | { required: true, message: '物料编码是必填项', trigger: 'change' } |
| | | ], |
| | | materialName: [ |
| | | { required: true, message: '物料名称是必填项', trigger: 'change' } |
| | | ], |
| | | batchNumber: [ |
| | | { required: true, message: '批次号是必选项', trigger: 'change' } |
| | | ], |
| | | quantity: [ |
| | | { required: true, message: '数量是必填项', trigger: 'change' } |
| | | ], |
| | | steelBallSize: [ |
| | | { required: false, message: '钢球尺寸是必填项', trigger: 'change' } |
| | | ] |
| | | }, |
| | | materialCategory: undefined, |
| | | batchNumberDictOptions: [], |
| | | inventoryList: [], |
| | | url: { |
| | | add: "/mes/mesMaterialLoading/add", |
| | | edit: "/mes/mesMaterialLoading/edit", |
| | | queryById: "/mes/mesMaterialLoading/queryById" |
| | | add: '/mes/mesMaterialLoading/add', |
| | | edit: '/mes/mesMaterialLoading/edit', |
| | | queryById: '/mes/mesMaterialLoading/queryById', |
| | | queryMaterialInventory: '/lsw/materialInventory/queryMaterialInventory' |
| | | } |
| | | } |
| | | }, |
| | |
| | | formDisabled(){ |
| | | return this.disabled |
| | | }, |
| | | materialNumberDictOptions() { |
| | | let materialNumberArr = new Set() |
| | | let materialNumberOptions = [] |
| | | for (let item of this.inventoryList) { |
| | | if (!materialNumberArr.has(item.materialNumber)) { |
| | | materialNumberOptions.push({ |
| | | value: item.materialNumber, |
| | | text: item.materialNumber + '(' + item.materialName + ')', |
| | | materialCategory: item.materialCategory, |
| | | materialName: item.materialName |
| | | }) |
| | | materialNumberArr.add(item.materialNumber) |
| | | } |
| | | } |
| | | return materialNumberOptions |
| | | } |
| | | }, |
| | | created () { |
| | | //备份model原始值 |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit(this.modelDefault); |
| | | this.edit(this.modelDefault) |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | }, |
| | | submitForm () { |
| | | const that = this; |
| | | const that = this |
| | | // 触发表单验证 |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | that.confirmLoading = true |
| | | let httpurl = '' |
| | | let method = '' |
| | | if(!this.model.id){ |
| | | httpurl+=this.url.add; |
| | | method = 'post'; |
| | | httpurl += this.url.add |
| | | method = 'post' |
| | | }else{ |
| | | httpurl+=this.url.edit; |
| | | method = 'put'; |
| | | httpurl += this.url.edit |
| | | method = 'put' |
| | | } |
| | | httpAction(httpurl,this.model,method).then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | that.$message.success(res.message) |
| | | that.$emit('ok') |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.confirmLoading = false |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | factorySelectChange(val) { |
| | | getAction(this.url.queryMaterialInventory, { factoryId: val }).then((res) => { |
| | | if (res.success) { |
| | | this.inventoryList = res.result.map(item => ({ ...item })) |
| | | } |
| | | }) |
| | | }, |
| | | materialNumberSelectChange(val) { |
| | | let option = this.materialNumberDictOptions.find(item => item.value === val) |
| | | if (option) { |
| | | this.model.materialName = option.materialName |
| | | this.materialCategory = option.materialCategory |
| | | let map = this.inventoryList.filter(item => item.materialNumber === val).map(item => ({ |
| | | value: item.batchNumber, |
| | | text: item.batchNumber, |
| | | quantity: item.quantity |
| | | })) |
| | | this.batchNumberDictOptions = [...map] |
| | | this.validatorRules.steelBallSize[0].required = true |
| | | } else { |
| | | this.model.materialName = '' |
| | | this.materialCategory = undefined |
| | | this.batchNumberDictOptions = [] |
| | | this.validatorRules.steelBallSize[0].required = false |
| | | } |
| | | }, |
| | | batchNumberSelectChange(val) { |
| | | let option = this.batchNumberDictOptions.find(item => item.value === val) |
| | | if (option) { |
| | | this.model.quantity = option.quantity |
| | | } else { |
| | | this.model.quantity = null |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |