| | |
| | | range9999Dec:'يرجى إدخال عدد صحيح مكون من أربعة أرقام', |
| | | quantityError: "数量错误,请刷新再保存", |
| | | dataDoesNotExist: "数据不存在", |
| | | greater0Sec1:"请输入大于0的整数或者保留一位小数" |
| | | } |
| | | }, |
| | | product:{ |
| | |
| | | msg2:'发货单库存数不存在', |
| | | msg3:'入库数量不能超过订单总数', |
| | | boxingPrinting:'装箱打印', |
| | | packing:'装箱调架', |
| | | msgPacking:'装箱调架成功', |
| | | boxNumberOrRemarks:'箱号或备注', |
| | | }, |
| | | customer:{ |
| | | page:{ |
| | |
| | | surplusMaterialManagement :'余料管理', |
| | | additionOfSurplusMaterials :'余料新增', |
| | | excessMaterialOutflow :'余料出库', |
| | | pleaseSelectTheTypeOfReturnToStock:'请选择返库类型' |
| | | pleaseSelectTheTypeOfReturnToStock:'请选择返库类型', |
| | | pleaseSelectOneData:'请选中一行数据' |
| | | }, |
| | | warehouseBasicData:{ |
| | | page:{ |
| | |
| | | range9999Dec: "Please enter a four digit integer", |
| | | quantityError: "Quantity Error", |
| | | dataDoesNotExist: "Data Does Not Exist", |
| | | greater0Sec1:"请输入大于0的整数或者保留一位小数" |
| | | } |
| | | }, |
| | | product:{ |
| | |
| | | msg2:'Invoice inventory number does not exist', |
| | | msg3:'The quantity of incoming orders shall not exceed the total number of orders', |
| | | boxingPrinting:'装箱打印', |
| | | packing:'装箱调架', |
| | | msgPacking:'装箱调架成功', |
| | | boxNumberOrRemarks:'箱号或备注', |
| | | }, |
| | | customer:{ |
| | | page:{ |
| | |
| | | surplusMaterialManagement :'Waste material management', |
| | | additionOfSurplusMaterials :'Surplus addition', |
| | | excessMaterialOutflow :'Residual materials out of storage', |
| | | pleaseSelectTheTypeOfReturnToStock:'Please select a return type' |
| | | pleaseSelectTheTypeOfReturnToStock:'Please select a return type', |
| | | pleaseSelectOneData:'请选中一行数据' |
| | | }, |
| | | warehouseBasicData:{ |
| | | page:{ |
| | |
| | | range9999Dec: "4자리 정수 입력하세요", |
| | | quantityError: '수량 오류, 새로고침 후 저장하세요', |
| | | dataDoesNotExist: "데이터 없음", |
| | | greater0Sec1:"请输入大于0的整数或者保留一位小数" |
| | | } |
| | | }, |
| | | product:{ |
| | |
| | | msg2:'JPG 또는 PNG 형식의 이미지 파일을 선택해주세요', |
| | | msg3:'JPG 또는 PNG 형식의 이미지 파일을 선택해주세요 . 최대 5MB', |
| | | boxingPrinting:'装箱打印', |
| | | packing:'装箱调架', |
| | | msgPacking:'装箱调架成功', |
| | | boxNumberOrRemarks:'箱号或备注', |
| | | }, |
| | | customer:{ |
| | | page:{ |
| | |
| | | surplusMaterialManagement :'余料管理', |
| | | additionOfSurplusMaterials :'余料新增', |
| | | excessMaterialOutflow :'余料出库', |
| | | pleaseSelectTheTypeOfReturnToStock:'请选择返库类型' |
| | | pleaseSelectTheTypeOfReturnToStock:'请选择返库类型', |
| | | pleaseSelectOneData:'请选中一行数据' |
| | | }, |
| | | warehouseBasicData:{ |
| | | page:{ |
| | |
| | | range9999Dec: "Введите четыре целых числа.", |
| | | quantityError: "数量错误,请刷新再保存", |
| | | dataDoesNotExist: "数据不存在", |
| | | greater0Sec1:"请输入大于0的整数或者保留一位小数" |
| | | } |
| | | }, |
| | | product:{ |
| | |
| | | msg2:'发货单库存数不存在', |
| | | msg3:'入库数量不能超过订单总数', |
| | | boxingPrinting:'装箱打印', |
| | | packing:'装箱调架', |
| | | msgPacking:'装箱调架成功', |
| | | boxNumberOrRemarks:'箱号或备注', |
| | | }, |
| | | customer:{ |
| | | page:{ |
| | |
| | | surplusMaterialManagement :'余料管理', |
| | | additionOfSurplusMaterials :'余料新增', |
| | | excessMaterialOutflow :'余料出库', |
| | | pleaseSelectTheTypeOfReturnToStock:'请选择返库类型' |
| | | pleaseSelectTheTypeOfReturnToStock:'请选择返库类型', |
| | | pleaseSelectOneData:'请选中一行数据' |
| | | }, |
| | | warehouseBasicData:{ |
| | | page:{ |
| | |
| | | range9999Dec: "请输入四位整数", |
| | | quantityError: "数量错误,请刷新再保存", |
| | | dataDoesNotExist: "数据不存在", |
| | | greater0Sec1:"请输入大于0的整数或者保留一位小数" |
| | | } |
| | | }, |
| | | product:{ |
| | |
| | | msg2:'发货单库存数不存在', |
| | | msg3:'入库数量不能超过流程卡总数', |
| | | boxingPrinting:'装箱打印', |
| | | packing:'装箱调架', |
| | | msgPacking:'装箱调架成功', |
| | | boxNumberOrRemarks:'箱号或备注', |
| | | }, |
| | | customer:{ |
| | | page:{ |
| | |
| | | surplusMaterialManagement :'余料管理', |
| | | additionOfSurplusMaterials :'余料新增', |
| | | excessMaterialOutflow :'余料出库', |
| | | pleaseSelectTheTypeOfReturnToStock:'请选择返库类型' |
| | | pleaseSelectTheTypeOfReturnToStock:'请选择返库类型', |
| | | pleaseSelectOneData:'请选中一行数据' |
| | | }, |
| | | warehouseBasicData:{ |
| | | page:{ |
| | |
| | | name: 'createFinishedGlassShelf', |
| | | component: () => import('../views/mm/finishedGlassShelf/CreateFinishedGlassShelf.vue'), |
| | | }, |
| | | { |
| | | // 料架出库查询 |
| | | path: 'finishedGlassShelfEmit', |
| | | name: 'finishedGlassShelfEmit', |
| | | component: () => import('../views/mm/finishedGlassShelf/FinishedGlassShelfEmit.vue'), |
| | | }, |
| | | { |
| | | // 料架出库明细查询 |
| | | path: 'createFinishedGlassShelfEmit', |
| | | name: 'createFinishedGlassShelfEmit', |
| | | component: () => import('../views/mm/finishedGlassShelf/CreateFinishedGlassShelfEmit.vue'), |
| | | }, |
| | | |
| | | |
| | | { |
| New file |
| | |
| | | <script setup> |
| | | |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import {useRoute, useRouter} from "vue-router" |
| | | import request from "@/utils/request" |
| | | import deepClone from "@/utils/deepClone" |
| | | import VXETable from "vxe-table"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | import { useI18n } from 'vue-i18n' |
| | | import OrderOtherMoney from "@/components/sd/order/OrderOtherMoney.vue"; |
| | | import footSum from "@/hook/footSum"; |
| | | import {changeFilterEvent,filterChanged} from "@/hook" |
| | | import companyInfo from "@/stores/sd/companyInfo"; |
| | | import {multiply} from "@/utils/decimal"; |
| | | |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const userid = userStore.user.userId |
| | | const company = companyInfo() |
| | | let produceList = ref([]) |
| | | let cellArea = ref() |
| | | let otherMoneyVisible = ref(false) |
| | | let otherMoney = ref(null) |
| | | let projects = ref([]) |
| | | |
| | | const hasDecimal=(value)=>{ |
| | | const regex=/\./ // 定义正则表达式,查找小数点 |
| | | return regex.test(value) //返回true/false |
| | | } |
| | | |
| | | const hasDecimalhtml=(item,row)=>{ |
| | | let aa=item.split('.').length |
| | | if (aa===2){ |
| | | |
| | | return row[item.split('.')[0]][item.split('.')[1]] |
| | | }else if(aa===3){ |
| | | return row[item.split('.')[0]][item.split('.')[1]][item.split('.')[2]] |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | //定义接收加载表头下拉数据 |
| | | const titleSelectJson = ref({ |
| | | customerName:[] |
| | | }) |
| | | |
| | | // 定义表头上传数据 |
| | | let titleUploadData = ref({ |
| | | emitId:'', |
| | | withdrawTime:'', |
| | | customerName:'', |
| | | project:'', |
| | | operator:'', |
| | | state:'', |
| | | remarks:'', |
| | | creatorId:userStore.user.userid, |
| | | creator:userStore.user.userName |
| | | }) |
| | | |
| | | |
| | | |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | emitId:'', |
| | | emitNumber:'', |
| | | glassShelfNumber:'', |
| | | glassShelfName:'', |
| | | quantity:'', |
| | | unit:'', |
| | | price:'', |
| | | money:'', |
| | | remarks:'' |
| | | }) |
| | | const initOrder = async ()=> { |
| | | //页面第一次加载 |
| | | await request.get(`/basicData/orderBasicData`).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | titleSelectJson.value = deepClone(res.data) |
| | | titleUploadData.value.operator=userStore.user.userName |
| | | const today = new Date |
| | | today.setTime(today.getTime() + (15 * 24 * 60 * 60 * 1000)) |
| | | titleUploadData.value.withdrawTime = today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | const xGrid = ref(); |
| | | |
| | | onMounted( async()=>{ |
| | | await initOrder() |
| | | //启用表格拖动选中 |
| | | addListener(xGrid.value,gridOptions,cellArea.value) |
| | | //发货新增 |
| | | const informationId = route.query.informationId |
| | | if (typeof informationId !== 'undefined' && informationId !== null && informationId !== '' && informationId !== '\n' && informationId !== '\r'){ |
| | | |
| | | //第一次调用 |
| | | /*request.post("/delivery/getSelectShippingOrderDetails/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | |
| | | |
| | | titleUploadData.value=deepClone(res.data.title) |
| | | titleUploadData.value.paymentTerms = titleSelectJson.value.paymentTerms[0].basicName |
| | | titleUploadData.value.payMethod = titleSelectJson.value.payMethod[0].basicName |
| | | titleUploadData.value.deliveryId="" |
| | | const today = new Date |
| | | today.setTime(today.getTime() ) |
| | | titleUploadData.value.deliveryDate=today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | titleUploadData.value.createTime=today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | titleUploadData.value.payDate=today.getFullYear() + |
| | | '-' + ("0" + (today.getMonth() + 1)).slice(-2) |
| | | + '-' + ("0" + today.getDate()).slice(-2) |
| | | |
| | | titleUploadData.value.creator=userStore.user.userName |
| | | titleUploadData.value.creatorId=userStore.user.userId |
| | | |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | |
| | | |
| | | const orderDetails = res.data.data |
| | | orderDetails.forEach(item => { |
| | | item.otherColumns = JSON.parse(item.otherColumns) |
| | | }) |
| | | xGrid.value.reloadData(orderDetails) |
| | | xGrid.value.loadData(produceList) |
| | | //禁用按钮 |
| | | gridOptions.toolbarConfig.buttons[1].disabled = true |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | //显示复选框 |
| | | xGrid.value.showColumn("select") |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | })*/ |
| | | } |
| | | //发货编辑 |
| | | const str = route.query.emitId |
| | | |
| | | if (typeof str != 'undefined' && str != null && str !== '' && str !== '\n' && str !== '\r'){ |
| | | filterData.value.emitId=str |
| | | //第一次调用 |
| | | /*request.post("/delivery/getSelectShippingOrderDetail/1/100",filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | pageTotal.value=res.data.total |
| | | titleUploadData.value=deepClone(res.data.delivery) |
| | | titleUploadData.value.deliveryId=str |
| | | |
| | | //判断是否发货出库 |
| | | if(!company.deliveryOutbound){ |
| | | if(titleUploadData.value.stockState!==0){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | } |
| | | } |
| | | //根据审核状态显示审核按钮或者是反审按钮 |
| | | if(titleUploadData.value.deliveryState!==0){ |
| | | gridOptions.toolbarConfig.buttons[1].disabled = true |
| | | gridOptions.toolbarConfig.buttons[0].disabled = true |
| | | } |
| | | if(titleUploadData.value.deliveryState===0){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | } |
| | | |
| | | pageNum=1 |
| | | produceList = deepClone(res.data.data) |
| | | const orderDetails = res.data.data |
| | | orderDetails.forEach(item => { |
| | | item.otherColumns = JSON.parse(item.otherColumns) |
| | | }) |
| | | otherMoney.value =res.data.orderOtherMoneyList |
| | | |
| | | titleUploadData.value.creator=userStore.user.userName |
| | | titleUploadData.value.creatorId=userStore.user.userId |
| | | |
| | | xGrid.value.reloadData(orderDetails) |
| | | xGrid.value.loadData(produceList) |
| | | //隐藏复选框 |
| | | /!*xGrid.value.hideColumn("select") |
| | | gridOptions.loading=false*!/ |
| | | xGrid.value.showColumn("select") |
| | | gridOptions.loading=false |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | })*/ |
| | | } |
| | | |
| | | |
| | | }) |
| | | |
| | | //定义页面总页数 |
| | | let pageTotal=ref('') |
| | | //定义当前页数 |
| | | let pageNum=$ref(1) |
| | | |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'CreateFinishedGlassShelfEmit', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | menuConfig: { |
| | | body: { |
| | | options: [ |
| | | [ |
| | | { code: 'copyChecked', name: t('归还'), prefixIcon: 'vxe-icon-copy', visible: true, disabled: false }, |
| | | ] |
| | | ] |
| | | } |
| | | }, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | //remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | checkboxConfig:{checkAll:true}, |
| | | mouseConfig:{selected: true},//鼠标选中 |
| | | keyboardConfig:{isArrow: true, isDel: true, isEnter: true, isTab: true, isEdit: true, isChecked: true}, |
| | | editConfig: { |
| | | trigger: 'dblclick', |
| | | mode: 'cell', |
| | | showStatus: true, |
| | | showIcon:false |
| | | },//表头参数 |
| | | columns:[ |
| | | |
| | | {type: 'seq', title: t('basicData.Number'), width: 80 ,fixed:"left"}, |
| | | {field: 'orderId',width:120, title: t('料架编号'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'orderNumber',width:120, title: t('料架名称'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'finishedGoodsInventory.boxNo',width:120, title: t('现有数量'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'productName',width:120, title: t('总数量'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'width',width:120, title: t('单价'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'height',width:120, title: t('金额'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'deliveryDetail.quantity',width:120, title: t('单位'),editRender: { name: 'input' },filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'finishedGoodsInventory.quantityAvailable',width:120, title: t('备注'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | {'code': 'add', 'name': t('basicData.save'),status: 'primary',icon: 'vxe-icon-save'} |
| | | ], |
| | | /*import: false, |
| | | export: true, |
| | | print: true,*/ |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['deliveryDetail.quantity','quantity','deliveryDetail.money'] |
| | | //let footList=[] |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total') |
| | | } |
| | | if (footList.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | |
| | | const gridEvents = { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'add': { |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | |
| | | if (selectRecords.length === 0) { |
| | | ElMessage.warning(t('productStock.unselectedData')) |
| | | return |
| | | } |
| | | const errMap = await $grid.validate(selectRecords) |
| | | if (errMap) { |
| | | ElMessage.warning(t('productStock.dataVerificationFailed')) |
| | | return |
| | | } |
| | | //表头数据校验 |
| | | const paymentTerms = titleUploadData.value.paymentTerms |
| | | if(paymentTerms === null || paymentTerms === undefined || paymentTerms === ''){ |
| | | ElMessage.error(t('delivery.pleaseSelectPaymentTerms')) |
| | | return |
| | | } |
| | | const payMethod = titleUploadData.value.payMethod |
| | | if(payMethod === null || payMethod === undefined || payMethod === ''){ |
| | | ElMessage.error(t('delivery.pleaseEnterThePaymentMethod')) |
| | | return |
| | | } |
| | | const freightPrice = titleUploadData.value.freightPrice |
| | | if(freightPrice=== null || freightPrice === undefined || freightPrice === ''){ |
| | | titleUploadData.value.freightPrice=0 |
| | | } |
| | | const freightQuantity = titleUploadData.value.freightQuantity |
| | | if(freightQuantity=== null || freightQuantity === undefined || freightQuantity === ''){ |
| | | titleUploadData.value.freightQuantity=0 |
| | | } |
| | | |
| | | |
| | | let flowData = ref({ |
| | | delivery: selectRecords, |
| | | title: titleUploadData.value, |
| | | deliveryId: route.query.deliveryID, |
| | | otherMoney:otherMoney.value, |
| | | deliveryIdType:company.deliveryIdType |
| | | |
| | | }) |
| | | request.post("/delivery/insertDelivery", flowData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | | ElMessage.success(t('delivery.deliveryNoteSubmittedSuccessfully')) |
| | | //router.push({path: '/main/delivery/selectDelivery', query:{random:Math.random()}}) |
| | | if(titleUploadData.value.deliveryId.trim()===""){ |
| | | router.push({path: '/main/delivery/selectDelivery', query:{random:Math.random()}}) |
| | | }else{ |
| | | router.push({path:'/main/delivery/createDelivery',query:{ |
| | | deliveryID:titleUploadData.value.deliveryId, |
| | | random:Math.random()}}) |
| | | } |
| | | }else if(res.data==="false1"){ |
| | | ElMessage.warning(t('delivery.pleaseMsg1')) |
| | | }else if(res.data==="false2"){ |
| | | ElMessage.warning(t('basicData.msg.quantityError')) |
| | | }else if(res.data==="false3"){ |
| | | ElMessage.warning(t('basicData.msg.dataDoesNotExist')) |
| | | }else{ |
| | | ElMessage.warning(t('basicData.msg.saveFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | break |
| | | } |
| | | case 'toExamine': { |
| | | let flowData = ref({ |
| | | deliveryId: route.query.deliveryID, |
| | | type: 2, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId, |
| | | deliveryOutbound:company.deliveryOutbound |
| | | |
| | | }) |
| | | request.post("/delivery/updateDeliveryToExamine", flowData.value).then((res) => { |
| | | if (res.code == 200 && res.data==="true") { |
| | | ElMessage.success(t('basicData.msg.ReviewSuccess')) |
| | | //router.push({path: '/main/delivery/selectDelivery', query:{random:Math.random()}}) |
| | | router.push({path:'/main/delivery/createDelivery',query:{ |
| | | deliveryID:titleUploadData.value.deliveryId, |
| | | random:Math.random()}}) |
| | | } else { |
| | | ElMessage.warning(t('basicData.msg.reviewFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | break |
| | | } |
| | | case 'CounterExamination': { |
| | | let flowData = ref({ |
| | | deliveryId: route.query.deliveryID, |
| | | type: 0, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId, |
| | | deliveryOutbound:company.deliveryOutbound |
| | | |
| | | }) |
| | | request.post("/delivery/updateDeliveryToExamine", flowData.value).then((res) => { |
| | | if (res.code == 200 && res.data==="true") { |
| | | ElMessage.success(t('basicData.msg.cancelReviewSuccess')) |
| | | //router.push({path: '/main/delivery/selectDelivery', query:{random:Math.random()}}) |
| | | router.push({path:'/main/delivery/createDelivery',query:{ |
| | | deliveryID:titleUploadData.value.deliveryId, |
| | | random:Math.random()}}) |
| | | } else { |
| | | ElMessage.warning(t('basicData.msg.reviewFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | }, |
| | | menuClick ({ menu, row, column }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (menu.code) { |
| | | |
| | | case 'copyChecked' :{ |
| | | let result = toolbarButtonClickEvent() |
| | | if(result){ |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | let firstVal=null; |
| | | if(result.cell.indexOf('.')>-1){ |
| | | firstVal = eval("dataList["+result.start +"]."+result.cell) |
| | | }else { |
| | | firstVal=dataList[result.start][result.cell]; |
| | | } |
| | | dataList.forEach((item,index) =>{ |
| | | if(index>=result.start && index<=result.end){ |
| | | //取消选中 |
| | | if(parseInt(firstVal)<=0){ |
| | | xGrid.value.setCheckboxRow(item, false); |
| | | } |
| | | if(result.cell.indexOf('.')>-1){ |
| | | const columnArr = result.cell.split('.') |
| | | item[columnArr[0]][columnArr[1]] = firstVal |
| | | }else{ |
| | | item[result.cell] = firstVal |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | break |
| | | } |
| | | case 'copyAll' :{ |
| | | let result = toolbarButtonClickEvent() |
| | | if(result){ |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | let firstVal=null; |
| | | if(result.cell.indexOf('.')>-1){ |
| | | firstVal = eval("dataList["+result.start +"]."+result.cell) |
| | | }else { |
| | | firstVal=dataList[result.start][result.cell]; |
| | | } |
| | | dataList.forEach((item,index) =>{ |
| | | if(index>=result.start){ |
| | | //取消选中 |
| | | if(parseInt(firstVal)<=0){ |
| | | xGrid.value.setCheckboxRow(item, false); |
| | | } |
| | | if(result.cell.indexOf('.')>-1){ |
| | | const columnArr = result.cell.split('.') |
| | | item[columnArr[0]][columnArr[1]] = firstVal |
| | | }else{ |
| | | item[result.cell] = firstVal |
| | | } |
| | | |
| | | } |
| | | }) |
| | | } |
| | | break |
| | | } |
| | | case 'otherMoney' :{ |
| | | otherMoneyVisible.value=true |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //计算金钱 |
| | | const countMoney = (list) => { |
| | | let countMoney = 0 |
| | | list.forEach((item)=>{ |
| | | countMoney += parseFloat(item.grossAmount) |
| | | }) |
| | | // otherMoney.value.forEach(item => { |
| | | // countMoney+=item.quantity*item.price |
| | | // }) |
| | | return parseFloat((countMoney).toFixed(2)) |
| | | } |
| | | |
| | | //关闭其他金额界面 |
| | | const refOtherMoney = ref() |
| | | const closeOtherMoneyDialog = async (done) => { |
| | | const flag = await refOtherMoney.value.validate() |
| | | if(flag){ |
| | | done() |
| | | //titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | } |
| | | } |
| | | |
| | | function getNestedProperty(obj, path) { |
| | | return path.split('.').reduce(function(o, p) { |
| | | if(o && o.hasOwnProperty(p)) { |
| | | return o[p]; |
| | | } |
| | | }, obj); |
| | | } |
| | | |
| | | function setNestedValue(obj, path, value) { |
| | | const keys = path.split('.'); |
| | | const lastKey = keys.pop(); |
| | | const lastObj = keys.reduce((obj, key) => obj[key], obj); |
| | | lastObj[lastKey] = value; |
| | | } |
| | | |
| | | |
| | | /*数据校验*/ |
| | | const validRules = ref({ |
| | | "deliveryDetail.quantity": [{ |
| | | validator (e) { |
| | | if (e.row.deliveryDetail.quantity > e.row.finishedGoodsInventory.quantityAvailable) { |
| | | return new Error(t('delivery.theShipmentQuantityCannotBeGreaterThanTheInventoryQuantity')) |
| | | }else if (e.row.deliveryDetail.quantity ==="") { |
| | | return new Error(t('delivery.theShipmentQuantityCannotBeEmptyOr0')) |
| | | } |
| | | const regex = /^[1-9]\d*$/g |
| | | if ( !regex.test(e.row.deliveryDetail.quantity) ) { |
| | | return new Error(t('productStock.pleaseEnterAPositiveInteger')) |
| | | } |
| | | |
| | | } |
| | | |
| | | }], |
| | | price: [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/ |
| | | if ( !regex.test(cellValue) ) { |
| | | return new Error(t('basicData.msg.range99999Dec2') ) |
| | | } |
| | | } |
| | | } |
| | | ], |
| | | |
| | | }) |
| | | |
| | | |
| | | |
| | | const changeProject = (item) => { |
| | | if(typeof item === 'string'){ |
| | | titleUploadData.value.project = item |
| | | return |
| | | } |
| | | titleUploadData.value.project = item.project |
| | | } |
| | | |
| | | const changeCustomer = () => { |
| | | const changedCustomerId = titleUploadData.value.customerId |
| | | const customer = titleSelectJson.value.customer.filter(item => item.id === changedCustomerId) |
| | | titleUploadData.value.customerName = customer[0].customerName |
| | | titleUploadData.value.project = customer[0].project |
| | | projects.value = customer[0].projectList |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div style="width: 100%;height: 100%"> |
| | | <div class="head" style="background-color: white"> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>*{{$t('order.customers')}}:</el-text></el-col> |
| | | <el-col :span="3"> |
| | | <el-select v-model="titleUploadData.customerId" |
| | | @change="changeCustomer" |
| | | filterable |
| | | clearable |
| | | placeholder=" " > |
| | | <el-option v-for="item in titleSelectJson['customer']" |
| | | :key="item.id" |
| | | :label="item.id+' '+item.customerName" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>*{{$t('order.project')}}:</el-text></el-col> |
| | | <el-col :span="3"> |
| | | <el-select v-model.trim="titleUploadData.project" |
| | | @change="changeProject" |
| | | clearable placeholder=" " filterable > |
| | | <el-option v-for="item in projects" |
| | | :label="item.project" |
| | | :value="item"/> |
| | | </el-select> |
| | | |
| | | |
| | | </el-col> |
| | | <el-col :span="2"><el-text>{{$t('经办人')}}:</el-text></el-col> |
| | | <el-col :span="3"><el-input disabled v-model="titleUploadData.operator"/></el-col> |
| | | <el-col :span="2"><el-text>{{$t('归还日期')}}:</el-text></el-col> |
| | | <el-col :span="3"> |
| | | <el-date-picker |
| | | v-model="titleUploadData.withdrawTime" |
| | | type="date" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | :placeholder="$t('delivery.selectDate')"/> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <div class="main-table"> |
| | | <vxe-grid |
| | | height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | :edit-rules="validRules" |
| | | |
| | | > |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input |
| | | type="type" |
| | | v-model="option.data" |
| | | @keyup.enter.native="$panel.confirmFilter()" |
| | | @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | |
| | | <template #content="{ row }"> |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{item.title+': '}}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | <div class="vxe-table--cell-area" ref="cellArea" > |
| | | <span class="vxe-table--cell-main-area" ></span> |
| | | |
| | | <span class="vxe-table--cell-active-area" ></span> |
| | | </div> |
| | | |
| | | <el-dialog v-model="otherMoneyVisible" |
| | | :title="$t('basicData.otherAmounts')" |
| | | :close-on-click-modal="false" |
| | | :close-on-press-escape="false" |
| | | :before-close="closeOtherMoneyDialog" |
| | | style="width: 614px;height:445px "> |
| | | <order-other-money |
| | | ref="refOtherMoney" |
| | | :otherMoney="otherMoney" |
| | | style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | .el-col{ |
| | | border: #181818 1px solid; |
| | | } |
| | | :deep(.el-input__wrapper) { |
| | | box-shadow: 0 0 0 0 var(--el-input-border-color, var(--el-border-color)) inset; |
| | | cursor: default; |
| | | border: none !important; |
| | | background-color: transparent; |
| | | } |
| | | .order-primary{ |
| | | width: 100%; |
| | | } |
| | | .order-detail{ |
| | | width: 100%; |
| | | height: 70%; |
| | | } |
| | | .vxe-grid { |
| | | /* 禁用浏览器默认选中 */ |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | } |
| | | |
| | | :deep(#product .el-dialog__body){ |
| | | height: 90%; |
| | | width: 100%; |
| | | } |
| | | |
| | | .head{ |
| | | width: 100%; |
| | | height: 50px; |
| | | } |
| | | |
| | | .main-table{ |
| | | width: 100%; |
| | | height: calc(100% - 50px); |
| | | } |
| | | </style> |
| | |
| | | <div id="div-title"> |
| | | <el-breadcrumb :separator-icon="ArrowRight"> |
| | | <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/finishedGlassShelfInformation' }">{{$t('料架库存')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/materialOutbound' }">{{$t('料架出库')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/finishedGlassShelfEmit' }">{{$t('料架出库')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(3)" :class="indexFlag===3?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/returnToStorage' }">{{$t('料架入库')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(4)" :class="indexFlag===4?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/createFinishedGlassShelf' }">{{$t('料架新增')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(6)" :class="indexFlag===6?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/selectSurplusMaterials' }">{{$t('料架报表')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item @click="changeRouter(6)" :class="indexFlag===6?'indexTag':''" :to="{ path: '/main/finishedGlassShelf/CreateFinishedGlassShelfEmit' }">{{$t('料架报表')}}</el-breadcrumb-item> |
| | | <el-breadcrumb-item v-show="false" :to="{ path: '/main/order/orderReport' }">{{$t('ingredientsStock.returnToStorage')}}</el-breadcrumb-item> |
| | | </el-breadcrumb> |
| | | |
| New file |
| | |
| | | <script setup> |
| | | |
| | | import {onMounted, reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import { useI18n } from 'vue-i18n' |
| | | import {addListener, toolbarButtonClickEvent} from "@/hook/mouseMove"; |
| | | import {changeFilterEvent,filterChanged,filterChangeds} from "@/hook" |
| | | import {divideAuto, multiply} from "@/utils/decimal"; |
| | | import companyInfo from "@/stores/sd/companyInfo"; |
| | | import footSum from "@/hook/footSum"; |
| | | import {copyTableCellValue} from "@/hook/copyTableCellValue"; |
| | | |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | const userStore = useUserInfoStore() |
| | | const company = companyInfo() |
| | | const router = useRouter() |
| | | let produceList = ref([]) |
| | | let sheetIndex = ref(-1) |
| | | let rowIndexData = ref(null) |
| | | |
| | | let dialogTableVisible = ref(false) |
| | | let refMaterialAddition=ref() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | router.push({path: '/main/finishedGlassShelf/createFinishedGlassShelfEmit', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | let flowData = ref({ |
| | | id: row.id, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | }) |
| | | request.post("/materialStore/deleteMaterialStore",flowData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | | ElMessage.success(t('basicData.msg.deleteSuccess')) |
| | | router.push({path:'/main/ingredients/SelectIngredients',query:{random:Math.random()}}) |
| | | }else if(res.data==="false1"){ |
| | | ElMessage.warning(t('ingredients.msg1')) |
| | | }else{ |
| | | ElMessage.warning(t('basicData.msg.deleteFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | } |
| | | |
| | | const hasDecimal=(value)=>{ |
| | | const regex=/\./ // 定义正则表达式,查找小数点 |
| | | return regex.test(value) //返回true/false |
| | | } |
| | | |
| | | const hasDecimalhtml=(item,row)=>{ |
| | | let aa=item.split('.').length |
| | | if (aa===2){ |
| | | return row[item.split('.')[0]][item.split('.')[1]] |
| | | }else if(aa===3){ |
| | | return row[item.split('.')[0]][item.split('.')[1]][item.split('.')[2]] |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | let pageNum=ref(1) |
| | | let total = reactive({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 100 |
| | | }) |
| | | |
| | | let filterData = ref({ |
| | | |
| | | }) |
| | | |
| | | const values = ref('') |
| | | |
| | | |
| | | let selectDate = ref(["",""]) |
| | | let BasicData = ref([]) |
| | | let materialStore= ref([]) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | onMounted(() => { |
| | | addListener(xGrid.value,gridOptions) |
| | | |
| | | //第一次调用 |
| | | // request.get(`/BasicWarehouse/BasicWarehouseType/`+t('ingredients.originalFilm')+'|'+t('ingredients.accessories')).then((res) => { |
| | | // if(res.code==200){ |
| | | // gridOptions.columns.splice(0,gridOptions.columns.length) |
| | | // BasicData.value = res.data |
| | | // //添加列 |
| | | // gridOptions.columns=arr.slice() |
| | | // |
| | | // for (let i=0;i<BasicData.value.length;i++){ |
| | | // let aa=null |
| | | // if(BasicData.value[i].OperateType==="name"){ |
| | | // aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChangeds} |
| | | // }else{ |
| | | // aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged} |
| | | // } |
| | | // gridOptions.columns.push(aa) |
| | | // |
| | | // } |
| | | // values.value=t('ingredientsStock.inventory') |
| | | // getInventoryWorks() |
| | | // |
| | | // }else{ |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // }) |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | const getInventoryEngineeringWork = () => { |
| | | |
| | | request.post(`/materialInventory/getSelectMaterialInventoryEngineeringDate/${pageNum.value}/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => { |
| | | |
| | | if(res.code==200){ |
| | | materialStore.value=[] |
| | | for (let i=0;i<res.data.data.length;i++){ |
| | | materialStore.value[i]=(res.data.data[i]) |
| | | materialStore.value[i].json=(JSON.parse(res.data.data[i].json)) |
| | | |
| | | } |
| | | |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageNum.value=1 |
| | | selectDate.value = res.data.selectDate |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | produceList = deepClone(materialStore.value) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading=false |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | const selectOrderList = ()=>{ |
| | | request.get(`/BasicWarehouse/BasicWarehouseType/`+t('ingredients.originalFilm')+'|'+t('ingredients.accessories')).then((res) => { |
| | | if(res.code==200){ |
| | | gridOptions.columns.splice(0,gridOptions.columns.length) |
| | | BasicData.value = res.data |
| | | //添加列 |
| | | gridOptions.columns=arr.slice() |
| | | |
| | | for (let i=0;i<BasicData.value.length;i++){ |
| | | let aa=null |
| | | if(BasicData.value[i].OperateType==="model"){ |
| | | aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged} |
| | | }else{ |
| | | aa={field: "json."+BasicData.value[i].OperateType, width: '150',title: BasicData.value[i].OperateTypeName, sortable: true,showOverflow:'ellipsis' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged} |
| | | } |
| | | |
| | | gridOptions.columns.push(aa) |
| | | |
| | | } |
| | | if(values.value===t('ingredientsStock.inventory')){ |
| | | getInventoryWorkPaging() |
| | | }else{ |
| | | getInventoryEngineeringWork() |
| | | } |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const changeDate = ()=>{ |
| | | selectOrderList() |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({ currentPage, pageSize }) => { |
| | | selectOrderList() |
| | | total.pageTotal = pageSize |
| | | pageNum.value=currentPage |
| | | } |
| | | |
| | | |
| | | |
| | | //子组件接收参数 |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'FinishedGlassShelfEmit', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollX:{enabled: true}, |
| | | scrollY:{ enabled: true ,gt:0},//开启虚拟滚动 |
| | | showOverflow:true, |
| | | columnConfig: { |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | //remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | | {title: t('basicData.operate'), width: '110', slots: { default: 'button_slot' },fixed:'left'}, |
| | | { type: 'seq',fixed:"left", title: t('basicData.Number'), width: '80' }, |
| | | {field: 'inventoryOrganization', width:'150', title: t('出库单据编号'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged }, |
| | | {field: 'materialCode', width: '150',title: t('客户名称'), sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'producer', width: '120',title: t('项目名称'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'id',width: '100', title: t('经办人'), sortable: true,showOverflow:"ellipsis",filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | {field: 'projectNo',width: '100', title: t('归还日期'), sortable: true}, |
| | | {field: 'createTime',width: '100', title: t('创建时间'), sortable: true}, |
| | | {field: 'qualityGuaranteePeriod',width: '100', title: t('备注'), sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod:filterChanged}, |
| | | |
| | | ],//表头按钮 |
| | | toolbarConfig: { |
| | | buttons: [ |
| | | |
| | | ], |
| | | /*import: false, |
| | | export: true, |
| | | print: true,*/ |
| | | export: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total') |
| | | } |
| | | const List = ["inventoryQuantity",'availableQuantity','totalArea'] |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | }) |
| | | |
| | | |
| | | const gridEvents = { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'out': { |
| | | $grid.clearFilter() |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | |
| | | |
| | | if (selectRecords.length === 0) { |
| | | ElMessage.warning(t('productStock.unselectedData')) |
| | | return |
| | | } |
| | | let id = "" |
| | | const array = []; |
| | | if (values.value===t('ingredientsStock.inventory')){ |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | array.push(selectRecords[i].id) |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].id |
| | | } else { |
| | | id += selectRecords[i].id + "|" |
| | | } |
| | | } |
| | | }else{ |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | array.push(selectRecords[i].useId) |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].useId |
| | | } else { |
| | | id += selectRecords[i].useId + "|" |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | router.push({path: '/main/ingredientsStock/CreateOutbound', query: {id: id,type:values.value}}) |
| | | break |
| | | |
| | | |
| | | } |
| | | case 'add': { |
| | | dialogTableVisible.value=true |
| | | rowIndexData.value=null |
| | | sheetIndex.value=1 |
| | | break |
| | | } |
| | | |
| | | case 'update': { |
| | | |
| | | $grid.clearFilter() |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if (selectRecords.length === 1) { |
| | | dialogTableVisible.value=true |
| | | rowIndexData.value=selectRecords[0] |
| | | sheetIndex.value=2 |
| | | }else{ |
| | | ElMessage.warning(t('请选中一行数据')) |
| | | return |
| | | } |
| | | |
| | | |
| | | break |
| | | } |
| | | |
| | | case 'delete': { |
| | | $grid.clearFilter() |
| | | const selectRecords = $grid.getCheckboxRecords() |
| | | if (selectRecords.length === 0) { |
| | | ElMessage.warning(t('productStock.unselectedData')) |
| | | return |
| | | } |
| | | ElMessageBox.confirm("确认删除?", |
| | | { |
| | | confirmButtonText: t('basicData.confirmButtonText'), |
| | | cancelButtonText: t('basicData.cancelButtonText'), |
| | | distinguishCancelAndClose: true, |
| | | type: 'warning', |
| | | } |
| | | ).then(()=>{ |
| | | let id = "" |
| | | const array = []; |
| | | if (values.value===t('ingredientsStock.inventory')){ |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | array.push(selectRecords[i].id) |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].id |
| | | } else { |
| | | id += selectRecords[i].id + "|" |
| | | } |
| | | } |
| | | }else{ |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | array.push(selectRecords[i].useId) |
| | | if (i + 1 === selectRecords.length) { |
| | | id += selectRecords[i].useId |
| | | } else { |
| | | id += selectRecords[i].useId + "|" |
| | | } |
| | | } |
| | | } |
| | | let flowData = ref({ |
| | | materialInventory: selectRecords, |
| | | ids: id, |
| | | creator: userStore.user.userName |
| | | |
| | | }) |
| | | request.post(`/materialInventory/deleteMaterialInventory`,flowData.value).then((res) => { |
| | | if(res.code==200 && res.data===true){ |
| | | ElMessage.success(t('searchOrder.msgDeleteSuccess')) |
| | | router.push({path:'/main/ingredientsStock/selectIngredientsStock', query:{random:Math.random()}}) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | }).catch((action)=>{ |
| | | }) |
| | | break |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | cellDblclick ({row,column}) { |
| | | copyTableCellValue(row,column) |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <div class="head"> |
| | | <el-date-picker |
| | | v-model="selectDate" |
| | | type="daterange" |
| | | :start-placeholder="$t('basicData.startDate')" |
| | | :end-placeholder="$t('basicData.endDate')" |
| | | format="YYYY-MM-DD" |
| | | value-format="YYYY-MM-DD" |
| | | |
| | | /> |
| | | <el-button @click="changeDate" style="margin-top: -5px" id="searchButton" type="primary" :icon="Search">{{$t('basicData.search')}}</el-button> |
| | | </div> |
| | | |
| | | <div class="main-table"> |
| | | <vxe-grid |
| | | height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{item.title+': '}}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ hasDecimalhtml(item.field,row) }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" |
| | | v-if="userStore.user.permissions.indexOf('selectIngredients.edit') > -1" |
| | | link type="primary" size="small">{{ $t('basicData.edit') }}</el-button> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')"> |
| | | <template #reference> |
| | | <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button> |
| | | </template> |
| | | </el-popconfirm> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | | <div v-for="(option, index) in column.filters" :key="index"> |
| | | <input type="type" v-model="option.data" @keyup.enter.native="$panel.confirmFilter()" @input="changeFilterEvent($event, option, $panel)"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | .main-div-customer{ |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | .main-div-customers{ |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | .el-col{ |
| | | margin-left: 15px; |
| | | margin-bottom: 5px; |
| | | } |
| | | .order-primary{ |
| | | width: 100%; |
| | | } |
| | | .head{ |
| | | width: 100%; |
| | | height: 35px; |
| | | } |
| | | |
| | | .main-table{ |
| | | width: 100%; |
| | | height: calc(100% - 35px); |
| | | } |
| | | .vxe-grid { |
| | | /* 禁用浏览器默认选中 */ |
| | | -webkit-user-select: none; |
| | | -moz-user-select: none; |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | } |
| | | </style> |
| | |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/trader/CreateTrader', query: { id: row.id }}) |
| | | router.push({path: '/main/finishedGlassShelf/createFinishedGlassShelf', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | let flowData = ref({ |
| | | id: row.id, |
| | | userName:userStore.user.userName, |
| | | userId:userStore.user.userId |
| | | }) |
| | | request.post("/materialStore/deleteMaterialStore",flowData.value).then((res) => { |
| | | if(res.code==200 && res.data==="true"){ |
| | | ElMessage.success(t('basicData.msg.deleteSuccess')) |
| | | router.push({path:'/main/ingredients/SelectIngredients',query:{random:Math.random()}}) |
| | | }else if(res.data==="false1"){ |
| | | ElMessage.warning(t('ingredients.msg1')) |
| | | }else{ |
| | | ElMessage.warning(t('basicData.msg.deleteFail')) |
| | | } |
| | | }).catch((err)=>{ |
| | | ElMessage.error(t('basicData.msg.ServerConnectionError')) |
| | | router.push("/login") |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | } |
| | |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'SelectIngredientsStock', |
| | | id: 'FinishedGlassShelfInformation', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" |
| | | link type="primary" size="small">{{$t('basicData.edit')}}</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.delete')}}</el-button> |
| | | v-if="userStore.user.permissions.indexOf('selectIngredients.edit') > -1" |
| | | link type="primary" size="small">{{ $t('basicData.edit') }}</el-button> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')"> |
| | | <template #reference> |
| | | <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button> |
| | | </template> |
| | | </el-popconfirm> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | |
| | | </div> |
| | | </template> |
| | | |
| | | <!-- <template #pager> |
| | | <!–使用 pager 插槽–> |
| | | <vxe-pager |
| | | @page-change="handlePageChange" |
| | | :layouts="[ 'PrevPage', 'Jump','PageCount', 'NextPage', 'Total']" |
| | | v-model:current-page="pageNum" |
| | | v-model:page-size="total.pageSize" |
| | | v-model:pager-count="total.pageTotal" |
| | | :total="total.dataTotal" |
| | | > |
| | | </vxe-pager> |
| | | </template>--> |
| | | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | |
| | | <!-- <el-dialog v-model="dialogTableVisible" :title="$t('ingredients.materialAddition')" style="width: 70%;height:75% ">--> |
| | | <!-- <material-addition v-if="sheetIndex===1" ref="refMaterialAddition" style="width: 100%;height: 100%"--> |
| | | <!-- :data=rowIndexData :type=1--> |
| | | <!-- :close-on-click-modal="false"--> |
| | | <!-- :close-on-press-escape="false"--> |
| | | <!-- />--> |
| | | <!-- <material-addition v-if="sheetIndex===2" ref="refMaterialAddition" style="width: 100%;height: 100%"--> |
| | | <!-- :data=rowIndexData :type=2--> |
| | | <!-- :close-on-click-modal="false"--> |
| | | <!-- :close-on-press-escape="false"--> |
| | | <!-- />--> |
| | | <!-- </el-dialog>--> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | {'code': 'out', 'name': t('ingredientsStock.materialOutbound'),status: 'primary'}, |
| | | {'code': 'add', 'name': t('ingredients.materialAddition'),status: 'primary'}, |
| | | {'code': 'delete', 'name': t('basicData.delete'),status: 'primary'}, |
| | | {'code': 'update', 'name': t('修改'),status: 'primary'}, |
| | | {'code': 'update', 'name': t('basicData.update'),status: 'primary'}, |
| | | ], |
| | | /*import: false, |
| | | export: true, |
| | |
| | | rowIndexData.value=selectRecords[0] |
| | | sheetIndex.value=2 |
| | | }else{ |
| | | ElMessage.warning(t('请选中一行数据')) |
| | | ElMessage.warning(t('ingredientsStock.pleaseSelectOneData')) |
| | | return |
| | | } |
| | | |
| | |
| | | ElMessage.warning(t('productStock.unselectedData')) |
| | | return |
| | | } |
| | | ElMessageBox.confirm("确认删除?", |
| | | ElMessageBox.confirm(t('searchOrder.deleteConfirm'), |
| | | { |
| | | confirmButtonText: t('basicData.confirmButtonText'), |
| | | cancelButtonText: t('basicData.cancelButtonText'), |
| | |
| | | // { 'code' :'issue','name':t('productStock.orderTransfer'),status: 'primary'}, |
| | | // { 'code' :'out','name':t('productStock.finishedProductPickup'),status: 'primary'}, |
| | | //{ 'code' :'rework','name':t('productStock.finishedProductRework'),status: 'primary'}, |
| | | { 'code' :'changeRack','name':'装箱调架',status: 'primary',visible:(company.companyName==="洛阳北方玻璃技术股份有限公司")}, |
| | | { 'code' :'changeRack','name':t('productStock.packing'),status: 'primary',visible:(company.companyName==="洛阳北方玻璃技术股份有限公司")}, |
| | | { 'code' :'print','name':t('basicData.print'),status: 'primary',visible:company.companyName==="洛阳北方玻璃技术股份有限公司"}, |
| | | |
| | | ], |
| | |
| | | return |
| | | } |
| | | if(currentRecord.value.boxNo.length>255 || currentRecord.value.remark.length>255){ |
| | | ElMessage.warning('箱号或备注'+t('basicData.msg.max255')) |
| | | ElMessage.warning(t('productStock.boxNumberOrRemarks')+t('basicData.msg.max255')) |
| | | return |
| | | } |
| | | await request.post(`/finishedGoodsInventory/changeRack/${userStore.user.userName}`,currentRecord.value).then((res) => { |
| | | if(res.code==200 ){ |
| | | ElMessage.success('装箱调架成功') |
| | | ElMessage.success(t('productStock.msgPacking')) |
| | | router.push({path: '/main/productStock/productStockList', query:{random:Math.random()}}) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | |
| | | <el-dialog v-model="dialogTableVisible" style="width: 400px;height:250px;margin-top: 25vh"> |
| | | <el-row> |
| | | <el-col :span="8"> |
| | | <el-text>箱号:</el-text> |
| | | <el-text>{{$t('productStock.boxNumber')}}:</el-text> |
| | | </el-col> |
| | | <el-col :span="16"> |
| | | <el-input v-model.trim="currentRecord.boxNo"/> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="8"> |
| | | <el-text>数量:</el-text> |
| | | <el-text>{{$t('order.quantity')}}:</el-text> |
| | | </el-col> |
| | | <el-col :span="16"> |
| | | <el-input v-model="currentRecord.quantityAvailable" type="number"/> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="8"> |
| | | <el-text>备注:</el-text> |
| | | <el-text>{{$t('basicData.remarks')}}:</el-text> |
| | | </el-col> |
| | | <el-col :span="16"> |
| | | <el-input v-model="currentRecord.remark"/> |
| | |
| | | } |
| | | } |
| | | if(basic.value.basicType[1]==="icon"){ |
| | | const regex = /^(?:\d+|\d+\.\d)$/ |
| | | if (!regex.test(iconWidth.value)||!regex.test(iconHeight.value) ) { |
| | | ElMessage.warning(t('basicData.msg.greater0Sec1')) |
| | | return |
| | | } |
| | | let nickname=basic.value.nickname |
| | | let data={ |
| | | width: iconWidth.value, |
| | |
| | | } |
| | | } |
| | | if(basic.value.basicType[1]==="icon"){ |
| | | const regex = /^(?:\d+|\d+\.\d)$/ |
| | | if (!regex.test(iconWidth.value)||!regex.test(iconHeight.value) ) { |
| | | ElMessage.warning(t('basicData.msg.greater0Sec1')) |
| | | return |
| | | } |
| | | let nickname=basic.value.nickname |
| | | let data={ |
| | | width: iconWidth.value, |