Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | gridOptions.toolbarConfig.buttons = gridOptions.toolbarConfig.buttons.filter(button => { |
| | | // 这里根据 hidePrintLabels 的值决定是否隐藏 printLabel 和 printLabel2 |
| | | if (hidePrintLabels == 'true') { |
| | | return button.code !== 'printLabel' && button.code !== 'printLabel2' && button.code !== 'customLabel'; |
| | | return button.code !== 'printLabel' && button.code !== 'printLabel2' ; |
| | | } else { |
| | | return true && button.code !== 'printLike'; // 显示该按钮 |
| | | } |
| | |
| | | let column = [1,3,8] |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | request.post(`/report/processCardProgress/${form.orderId}`,column).then((res) => { |
| | | request.post(`/report/processCardProgress/${form.orderId}`, column).then((res) => { |
| | | if (res.code == 200) { |
| | | if(res.data.data.length===0){ |
| | | if (res.data.data.length === 0) { |
| | | ElMessage.warning(t('report.noDataFoundForThisOrder')) |
| | | return |
| | | } |
| | | //gridOptions.columns = JSON.parse(JSON.stringify(columns)) |
| | | res.data.title.forEach(item =>{ |
| | | let column = {slots: { default: 'quantitySum' }, width: 90,title: item.process} |
| | | // 动态添加列 |
| | | res.data.title.forEach((item, index) => { |
| | | let column = { |
| | | slots: { default: 'quantitySum' }, |
| | | width: 90, |
| | | title: item.process, |
| | | field: `dynamicColumn${index}` // 为动态列添加唯一的 field |
| | | } |
| | | gridOptions.columns.push(column) |
| | | }) |
| | | res.data.data.forEach(item => { |
| | | item.reportWorkQuantity=JSON.parse(item.reportWorkQuantity) |
| | | item.reportWorkQuantityCount=JSON.parse(item.reportWorkQuantityCount) |
| | | item.reportWorkQuantity = JSON.parse(item.reportWorkQuantity) |
| | | item.reportWorkQuantityCount = JSON.parse(item.reportWorkQuantityCount) |
| | | }) |
| | | mergeCells.value = res.data.mergeCell |
| | | xGrid.value.loadData(res.data.data) |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const footSumDynamic = (data, columnTitle) => { |
| | | let sum = 0; |
| | | data.forEach(item => { |
| | | const value = Number(item.reportWorkQuantity[columnTitle]) || 0; // 从 reportWorkQuantity 中提取值并转换为数字 |
| | | sum += value; |
| | | }); |
| | | return sum.toFixed(2); |
| | | } |
| | | |
| | | const quantitySum = ( row,column )=>{ |
| | | const reportWorkQuantity = row.reportWorkQuantity[column.title] || 0 |
| | | const reportWorkQuantityCount = row.reportWorkQuantityCount[column.title] || 0 |
| | |
| | | data: [ |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | |
| | | return[ |
| | | footerMethod ({ columns, data }) { |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total') |
| | | } |
| | | const List = ["quantity","broken_num","inventory",] |
| | | const List = ["quantity", "broken_num", "inventory", "inventoryArea"]; // 静态列的求和 |
| | | if (List.includes(column.field)) { |
| | | console.log(data) |
| | | console.log(column.field) |
| | | return footSum(data, column.field) |
| | | } |
| | | // 动态列的求和 |
| | | if (column.field && column.field.startsWith('dynamicColumn')) { |
| | | return footSumDynamic(data, column.title) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | }, |
| | | |
| | | } |
| | | }) |
| | | |
| | | |
| | |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | |
| | | import { useI18n } from 'vue-i18n' |
| | | import footSum from "@/hook/footSum"; |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | let router=useRouter() |
| | |
| | | } |
| | | //gridOptions.columns = JSON.parse(JSON.stringify(columns)) |
| | | res.data.title.forEach((item, index) => { |
| | | let column = { slots: { default: 'quantitySum' }, width: 90, title: item.process }; |
| | | let column = { slots: { default: 'quantitySum' }, width: 90, title: item.process, |
| | | field: `dynamicColumn${index}` // 为动态列添加唯一的 field |
| | | }; |
| | | const insertIndex = 5; // 设置插入位置的索引 |
| | | gridOptions.columns = [ |
| | | ...gridOptions.columns.slice(0, insertIndex + index), // 取插入位置之前的部分 |
| | |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const footSumDynamic = (data, columnTitle) => { |
| | | let sum = 0; |
| | | data.forEach(item => { |
| | | const value = Number(item.reportWorkQuantity[columnTitle]) || 0; // 从 reportWorkQuantity 中提取值并转换为数字 |
| | | sum += value; |
| | | }); |
| | | return sum.toFixed(2); |
| | | } |
| | | const quantitySum = ( row,column )=>{ |
| | | const reportWorkQuantity = row.reportWorkQuantity[column.title] || 0 |
| | |
| | | data: [ |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | // footerMethod ({ columns, data }) {//页脚函数 |
| | | // let footList=['7','8','9','10'] |
| | | // return[ |
| | | // columns.map((column, columnIndex) => { |
| | | // if (columnIndex === 0) { |
| | | // return '合计:' |
| | | // } |
| | | // if (footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | | // } |
| | | // return '' |
| | | // }) |
| | | // ] |
| | | // } |
| | | footerMethod ({ columns, data }) { |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return t('basicData.total') |
| | | } |
| | | const List = ["quantity", "inventoryNum", "inventoryArea"]; // 静态列的求和 |
| | | if (List.includes(column.field)) { |
| | | return footSum(data, column.field) |
| | | } |
| | | // 动态列的求和 |
| | | if (column.field && column.field.startsWith('dynamicColumn')) { |
| | | return footSumDynamic(data, column.title) |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | }) |
| | | |
| | |
| | | const route = useRoute() |
| | | let produceList = ref([]) |
| | | const userStore = useUserInfoStore() |
| | | const props = defineProps({ |
| | | getOrderPage:null |
| | | }) |
| | | |
| | | let emit = defineEmits([ |
| | | 'getOrderFunction' |
| | | ]) |
| | | |
| | | |
| | | |
| | |
| | | if(res.code==200 && res.data===true){ |
| | | resetForm() |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({path:'/main/customer/selectCustomer',query:{random:Math.random()}}) |
| | | if(!props.getOrderPage){ |
| | | router.push({path:'/main/customer/selectCustomer',query:{random:Math.random()}}) |
| | | }else{ |
| | | emit('getOrderFunction') |
| | | } |
| | | |
| | | }else{ |
| | | ElMessage.warning(t('basicData.msg.saveFail')) |
| | | } |
| | |
| | | |
| | | <template> |
| | | <div class="main-div"> |
| | | |
| | | <div class="order-primary" > |
| | | <el-row> |
| | | <el-col :span="2"><el-text>{{ $t('customer.customerName') }}:</el-text></el-col> |
| | | <el-col :span="4"><el-text>{{ $t('customer.customerName') }}:</el-text></el-col> |
| | | <el-col :span="5"><el-input style="font-size: large;color: #181818" v-model="ruleForm.customerName" ></el-input></el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>{{ $t('customer.customerAbbreviation') }}:</el-text></el-col> |
| | | <el-col :span="4"><el-text>{{ $t('customer.customerAbbreviation') }}:</el-text></el-col> |
| | | <el-col :span="5"><el-input style="font-size: large;color: #181818" v-model="ruleForm.customerAbbreviation" ></el-input></el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>{{ $t('customer.customerGrade') }}:</el-text></el-col> |
| | | <el-col :span="4"><el-text>{{ $t('customer.customerGrade') }}:</el-text></el-col> |
| | | <el-col :span="5"><el-input style="font-size: large;color: #181818" v-model="ruleForm.grade" ></el-input></el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>{{ $t('customer.moneyLimit') }}:</el-text></el-col> |
| | | <el-col :span="4"><el-text>{{ $t('customer.moneyLimit') }}:</el-text></el-col> |
| | | <el-col :span="5"><el-input style="font-size: large;color: #181818" v-model="ruleForm.moneyLimit" ></el-input></el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>{{ $t('customer.address') }}:</el-text></el-col> |
| | | <el-col :span="4"><el-text>{{ $t('customer.address') }}:</el-text></el-col> |
| | | <el-col :span="5"><el-input style="font-size: large;color: #181818" v-model="ruleForm.address" ></el-input></el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>{{ $t('customer.contacts') }}:</el-text></el-col> |
| | | <el-col :span="4"><el-text>{{ $t('customer.contacts') }}:</el-text></el-col> |
| | | <el-col :span="5"><el-input style="font-size: large;color: #181818" v-model="ruleForm.contact" ></el-input></el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-text>{{ $t('customer.telephone') }}:</el-text></el-col> |
| | | <el-col :span="4"><el-text>{{ $t('customer.telephone') }}:</el-text></el-col> |
| | | <el-col :span="5"><el-input style="font-size: large;color: #181818" v-model="ruleForm.phone" ></el-input></el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="2"><el-button type="primary" @click="submitForm()">{{ $t('basicData.save') }}</el-button></el-col> |
| | | <el-col :span="2"><el-button @click="resetForm()">{{ $t('customer.resetting') }}</el-button></el-col> |
| | | <el-col :span="4"><el-button type="primary" @click="submitForm()">{{ $t('basicData.save') }}</el-button></el-col> |
| | | <el-col :span="4"><el-button @click="resetForm()">{{ $t('customer.resetting') }}</el-button></el-col> |
| | | </el-row> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | |
| | | import useUserInfoStore from '@/stores/userInfo' |
| | | import companyInfo from "@/stores/sd/companyInfo" |
| | | import SelectProduct from "@/views/sd/product/SelectProduct.vue" |
| | | import CreateProduct from "@/views/sd/product/CreateProduct.vue" |
| | | import CreateCustomer from "@/views/sd/customer/CreateCustomer.vue" |
| | | import OrderOtherMoney from "@/components/sd/order/OrderOtherMoney.vue" |
| | | import OrderSizeCheck from "@/components/sd/order/OrderSizeCheck.vue" |
| | | import {changeFilterEvent,filterChanged} from "@/hook" |
| | |
| | | //初始化判断是否有id传入 |
| | | onMounted(async ()=>{ |
| | | gridOptions.loading = true |
| | | await initOrder() |
| | | await initOrder(0) |
| | | |
| | | //启用表格拖动选中 |
| | | addListener(xGrid.value,gridOptions) |
| | |
| | | |
| | | |
| | | //页面第一次加载执行 |
| | | const initOrder = async ()=>{ |
| | | const initOrder = async (val)=>{ |
| | | |
| | | await request.get(`/basicData/orderBasicData`).then((res) => { |
| | | if(res.code==200){ |
| | | titleSelectJson.value=deepClone(res.data) |
| | | //其他金额 |
| | | otherMoney.value = titleSelectJson.value.orderOtherMoney[0] |
| | | //let columns = [] |
| | | otherMoney.value.forEach(item => { |
| | | let column = { |
| | | field: `otherColumns.${item.column}`, |
| | | width:100, |
| | | title: item.alias, |
| | | editRender: { |
| | | name: 'input', |
| | | if(val===0){ |
| | | //其他金额 |
| | | otherMoney.value = titleSelectJson.value.orderOtherMoney[0] |
| | | //let columns = [] |
| | | otherMoney.value.forEach(item => { |
| | | let column = { |
| | | field: `otherColumns.${item.column}`, |
| | | width:100, |
| | | title: item.alias, |
| | | editRender: { |
| | | name: 'input', |
| | | } |
| | | } |
| | | } |
| | | //判断 其他列是否是数字 |
| | | if(item.column.indexOf('M')>-1){ |
| | | gridOptions.editRules[`otherColumns.${item.column}`] = [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0(\.\d{1,3})?|([1-9]\d{0,4})(\.\d{1,3})?|99999(\.9{1,3})?)$/ |
| | | if (cellValue && !regex.test(cellValue)) { |
| | | return new Error(t('basicData.msg.range99999Dec3')) |
| | | //判断 其他列是否是数字 |
| | | if(item.column.indexOf('M')>-1){ |
| | | gridOptions.editRules[`otherColumns.${item.column}`] = [ |
| | | { |
| | | validator ({ cellValue }) { |
| | | const regex = /^(0(\.\d{1,3})?|([1-9]\d{0,4})(\.\d{1,3})?|99999(\.9{1,3})?)$/ |
| | | if (cellValue && !regex.test(cellValue)) { |
| | | return new Error(t('basicData.msg.range99999Dec3')) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }else{ |
| | | gridOptions.editRules[`otherColumns.${item.column}`] = [ |
| | | { required: false}, |
| | | { min: 0, max: 255, message: t('basicData.msg.max255') } |
| | | ] |
| | | } |
| | | ] |
| | | }else{ |
| | | gridOptions.editRules[`otherColumns.${item.column}`] = [ |
| | | { required: false}, |
| | | { min: 0, max: 255, message: t('basicData.msg.max255') } |
| | | ] |
| | | } |
| | | |
| | | //columns.push(column) |
| | | gridOptions.columns.push(column) |
| | | //columns.push(column) |
| | | gridOptions.columns.push(column) |
| | | |
| | | }) |
| | | |
| | | }) |
| | | } |
| | | //进入页面下拉框设置默认值 |
| | | titleUploadData.value.orderType = titleSelectJson.value.orderType[0].basicName |
| | | titleUploadData.value.orderClassify = titleSelectJson.value.orderClassify[0].basicName |
| | |
| | | xGrid.value.clearSelected() |
| | | } |
| | | |
| | | //切换产品界面 |
| | | const productFlag = ref(true) |
| | | const changeProduct = (val)=>{ |
| | | productFlag.value = val |
| | | } |
| | | const closeProductDialog = ()=>{ |
| | | productFlag.value = true |
| | | } |
| | | //改变产品页面切换 |
| | | const changePage = () => { |
| | | productFlag.value = true |
| | | } |
| | | // 创建客户显示 |
| | | let createCustomerVisible = ref(false) |
| | | |
| | | //创建客户成功返回方法 |
| | | const createCustomerSuccess = async () => { |
| | | await initOrder(1) |
| | | createCustomerVisible.value = false |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | :label="item.id+' '+item.customerName" |
| | | :value="item.id" |
| | | /> |
| | | <template #footer> |
| | | <el-button @click="createCustomerVisible=true" text bg size="small" > |
| | | {{$t('basicData.create')}} |
| | | </el-button> |
| | | </template> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="2"><el-text>*{{$t('order.orderType')}}:</el-text></el-col> |
| | |
| | | :autosize="{ minRows: 2, maxRows: 20 }" |
| | | /> |
| | | </el-dialog> |
| | | <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 id="product" |
| | | class="product1" |
| | | v-model="productVisible" |
| | | @closed="closeProductDialog" |
| | | :destroy-on-close="true" |
| | | style="width: 80%;height:75%; "> |
| | | <template #header > |
| | | <div class="my-header"> |
| | | <el-button @click="changeProduct(true)">{{$t('basicData.search')}}</el-button> |
| | | <el-button @click="changeProduct(false)">{{$t('basicData.create')}}</el-button> |
| | | </div> |
| | | </template> |
| | | <select-product v-if="productFlag" :rowIndex="rowIndex" @getProductRow="getProductRow" style="width: 100%;height: 100%" /> |
| | | <create-product v-else |
| | | :productFlag="productFlag" |
| | | @changePage="changePage" |
| | | style="text-align: left;background-color: #D5EAFF;"/> |
| | | </el-dialog> |
| | | <!--误差结算--> |
| | | <el-dialog v-model="errorAreaVisible" style="width: 300px;height:150px "> |
| | |
| | | @getParent="gaveOrderSizeCheck" |
| | | :orderId="titleUploadData.orderId" |
| | | :OrderDetail="xGrid"/> |
| | | <!-- <create-customer/>--> |
| | | </el-dialog> |
| | | <!-- 客户创建窗口--> |
| | | <el-dialog |
| | | id="createCustomer" |
| | | :title="$t('customer.page.createCustomer')" |
| | | v-model="createCustomerVisible" |
| | | style="width: 700px;height:445px;text-align: left " |
| | | > |
| | | <create-customer :getOrderPage="'order'" @getOrderFunction="createCustomerSuccess" /> |
| | | </el-dialog> |
| | | |
| | | |
| | | </div> |
| | | </template> |
| | |
| | | .el-col{ |
| | | border: #181818 1px solid; |
| | | } |
| | | :deep(.el-input__wrapper) { |
| | | :deep(.order-primary .el-input__wrapper) { |
| | | box-shadow: 0 0 0 0 var(--el-input-border-color, var(--el-border-color)) inset; |
| | | cursor: default; |
| | | border: none !important; |
| | |
| | | width: 100%; |
| | | } |
| | | |
| | | :deep(#sizeCheck .el-dialog__body){ |
| | | :deep(#sizeCheck .el-dialog__body,#createCustomer .el-dialog__body){ |
| | | height: 90%; |
| | | width: 100%; |
| | | } |
| | | |
| | | .my-header { |
| | | display: flex; |
| | | /*flex-direction : row; |
| | | justify-content: space-between;*/ |
| | | } |
| | | </style> |
| | |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | let userInfo = useUserInfo() |
| | | let props = defineProps({ |
| | | productFlag:null |
| | | }) |
| | | |
| | | let emit = defineEmits([ |
| | | 'getProductRow' |
| | | ]) |
| | | |
| | | const disposeList = $ref([ |
| | | t('product.coloredGlaze'), |
| | | t('product.frostedSand'), |
| | |
| | | } |
| | | |
| | | const saveProducts=(product)=>{ |
| | | if(props.productFlag===false){ |
| | | product.title.state = 1 |
| | | } |
| | | request.post(`/product/saveProduct`,product).then((res) =>{ |
| | | if(res.code==200){ |
| | | ElMessage.success(t('product.msg.saveSuccess')) |
| | | router.push("/main/product/selectProduct") |
| | | if(props.productFlag===false){ |
| | | emit('changePage') |
| | | }else{ |
| | | router.push("/main/product/selectProduct") |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | let emit = defineEmits([ |
| | | 'getProductRow' |
| | | 'changePage' |
| | | ]) |
| | | |
| | | const emitParent = (row,type) => { |
| | |
| | | onUnmounted(() => { |
| | | clearTimeout(initTime) |
| | | if (sortable2) { |
| | | sortable2.destroy() |
| | | try{ |
| | | sortable2.destroy() |
| | | } |
| | | catch (e){ |
| | | } |
| | | |
| | | } |
| | | }) |
| | | |
| | |
| | | import com.example.erp.service.sd.ProductService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | |
| | | @ApiOperation("产品查询接口") |
| | | @SaCheckPermission("selectProduct.search") |
| | | @PostMapping ("/{pageNum}/{pageSize}/{glassType}") |
| | | public Result defaultDateProduct(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> glassType, @RequestBody Product product){ |
| | | public Result defaultDateProduct(@PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable List<String> glassType, |
| | | @RequestBody Product product){ |
| | | return Result.seccess(productService.defaultDateProduct(pageNum,pageSize,glassType,product)); |
| | | } |
| | | @ApiOperation("其他系统获取产品查询接口") |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.Product; |
| | | import com.example.erp.entity.sd.ProductDetail; |
| | | import com.example.erp.exception.ServiceException; |
| | |
| | | fc.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) as bend_radius, |
| | | if(od.bend_radius!=null,od.bend_radius,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04'))) as bend_radius, |
| | | concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | |
| | | fc.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) as bend_radius, |
| | | if(od.bend_radius!=null,od.bend_radius,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04'))) as bend_radius, |
| | | concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | |
| | | sum(pl.patch_num) as quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | if(od.shape=2,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04')),od.bend_radius) as bend_radius, |
| | | if(od.bend_radius!=null,od.bend_radius,JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S04'))) as bend_radius, |
| | | concat(IFNULL(od.processing_note, ''), IFNULL(od.remarks, '')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |