| | |
| | | const route = useRoute() |
| | | const xGrid = ref() |
| | | let cellArea = ref() |
| | | const shapeList = ref(['普形','异形']) |
| | | const shapeList = ref([ |
| | | {name:'普形',value:1}, {name:'异形',value: 2} |
| | | ]) |
| | | |
| | | // 定义表头上传数据 |
| | | const titleUploadData = ref({ |
| | |
| | | let otherMoney = ref(null) |
| | | |
| | | const gridOptions = reactive({ |
| | | loading:false, |
| | | showHeaderOverflow: false, |
| | | showFooterOverflow: false, |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | //virtualScroll: true, // 开启虚拟滚动功能 |
| | | id: 'OrderList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true },//开启虚拟滚动 |
| | | scrollY:{ enabled: true,gt:13 },//开启虚拟滚动 |
| | | //scrollX:{ enabled: true,gt:15 },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | menuConfig: { |
| | | body: { |
| | |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | ], |
| | | }, |
| | | toolbarConfig: { |
| | | buttons: [ |
| | |
| | | |
| | | //初始化判断是否有id传入 |
| | | onMounted(()=>{ |
| | | |
| | | //启用表格拖动选中 |
| | | addListener(xGrid.value,gridOptions) |
| | | const str = route.query.orderId || history.state.orderId |
| | |
| | | orderDetails.forEach(item => { |
| | | item.otherColumns = JSON.parse(item.otherColumns) |
| | | }) |
| | | |
| | | //加载副表数据 |
| | | otherMoney.value =res.data.orderOtherMoneyList |
| | | //加载副表数据 |
| | | xGrid.value.reloadData(orderDetails) |
| | | }else{ |
| | | ElMessage.error(res.msg) |
| | |
| | | }) |
| | | }) |
| | | |
| | | //作废订单 |
| | | const cancelOrder = () => { |
| | | request.post(`/order/cancelOrder/${titleUploadData.value.orderId}`).then((res) =>{ |
| | | if (res.code== 200){ |
| | |
| | | otherMoney.value = titleSelectJson.value.orderOtherMoney[0] |
| | | //let columns = [] |
| | | otherMoney.value.forEach(item => { |
| | | let column = {field: `otherColumns.${item.column}`,width:50, title: item.alias,editRender: { name: 'input'}} |
| | | let column = { |
| | | field: `otherColumns.${item.column}`, |
| | | width:50, title: item.alias, |
| | | editRender: { |
| | | name: 'input', |
| | | } |
| | | } |
| | | gridOptions.editRules[`otherColumns.${item.column}`] = [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0|[1-9][0-9]{0,4}([.][0-9]{1,2})?)$/ |
| | | if (cellValue && !regex.test(cellValue)) { |
| | | return new Error(t('basicData.msg.range99999Dec2')) |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | |
| | | //columns.push(column) |
| | | gridOptions.columns.push(column) |
| | | |
| | | }) |
| | | |
| | | //进入页面下拉框设置默认值 |
| | |
| | | list.forEach((item)=>{ |
| | | countMoney += parseFloat(item.grossAmount) |
| | | }) |
| | | otherMoney.value.forEach(item => { |
| | | countMoney+=item.quantity*item.price |
| | | }) |
| | | // otherMoney.value.forEach(item => { |
| | | // countMoney+=item.quantity*item.price |
| | | // }) |
| | | return parseFloat((countMoney).toFixed(2)) |
| | | } |
| | | //导入功能 |
| | |
| | | }else if(column.property === 'computeArea'){ |
| | | row.computeGrossArea=parseFloat((row.computeArea*row.quantity).toFixed(2)) |
| | | row.grossAmount=parseFloat((row.price * row.computeGrossArea).toFixed(2)) |
| | | }else if(column.property.indexOf('otherColumns.M')>-1){ |
| | | let quantity = 0 |
| | | xGrid.value.getTableData().fullData.forEach(item => { |
| | | quantity += item.quantity*(getNestedProperty(item,column.property)*1) |
| | | }) |
| | | if(!isNaN(quantity)){ |
| | | otherMoney.value.forEach(item => { |
| | | if(item.column===column.property.split('.')[1]){ |
| | | item.quantity = quantity |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | // else if(column.property.indexOf('otherColumns.M')>-1){ |
| | | // let quantity = 0 |
| | | // xGrid.value.getTableData().fullData.forEach(item => { |
| | | // let orderQuantity = isNaN(item.quantity) ? 0 : item.quantity |
| | | // let value = isNaN((getNestedProperty(item,column.property)*1)) ? 0 : (getNestedProperty(item,column.property)*1) |
| | | // quantity += orderQuantity*value |
| | | // }) |
| | | // if(!isNaN(quantity)){ |
| | | // otherMoney.value.forEach(item => { |
| | | // if(item.column===column.property.split('.')[1]){ |
| | | // item.quantity = quantity |
| | | // } |
| | | // }) |
| | | // } |
| | | // } |
| | | titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | |
| | | |
| | |
| | | </template> |
| | | <template #shape_edit="{ row }"> |
| | | <vxe-select v-model="row.shape" transfer> |
| | | <vxe-option v-for="item in shapeList" :key="item" :value="item" :label="item" /> |
| | | <vxe-option v-for="item in shapeList" :key="item" :value="item.value" :label="item.name" /> |
| | | </vxe-select> |
| | | </template> |
| | | |
| | |
| | | :autosize="{ minRows: 2, maxRows: 20 }" |
| | | /> |
| | | </el-dialog> |
| | | <el-dialog v-model="productVisible" style="width: 80%;height:75% "> |
| | | <el-dialog id="product" v-model="productVisible" style="width: 80%;height:75% "> |
| | | <select-product :rowIndex="rowIndex" @getProductRow="getProductRow" style="width: 100%;height: 100%" /> |
| | | </el-dialog> |
| | | <!--误差结算--> |
| | |
| | | -ms-user-select: none; |
| | | user-select: none; |
| | | } |
| | | :deep(#product .el-dialog__body){ |
| | | height: 90%; |
| | | width: 100%; |
| | | } |
| | | |
| | | </style> |