| | |
| | | {field: 'id', width: 60, title: t('productionBasicData.id'),filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged,}, |
| | | {field: 'basic_type',width: 370, title: t('machine.type'), showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'basic_name', width: 330,title: t('orderBasicData.name'), filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | {field: 'd_basic_name',width: 330, title: t('productionBasicData.basicName')}, |
| | | {field: 'd_basic_name',width: 330, title: t('productionBasicData.basicName'), filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged}, |
| | | ], |
| | | //表头按钮 |
| | | toolbarConfig: { |
| | |
| | | customerName: '', |
| | | //项目名称 |
| | | project: '', |
| | | //批次 |
| | | batch:'', |
| | | }, |
| | | flowCard: { |
| | | //可报工数量 |
| | |
| | | done() |
| | | } |
| | | |
| | | const parseProcessData = (rawData) => { |
| | | if (!rawData) return [] // 空值返回空数组 |
| | | |
| | | // 步骤1:先转为字符串并去除首尾多余的引号(处理后端返回的 "\"[\"磨边\",\"打孔\"]\"" 情况) |
| | | let str = String(rawData).trim() |
| | | if (str.startsWith('"') && str.endsWith('"')) { |
| | | str = str.slice(1, -1) // 去掉首尾的引号 |
| | | } |
| | | |
| | | // 步骤2:解析JSON字符串为数组 |
| | | try { |
| | | const arr = JSON.parse(str) |
| | | // 确保解析后是数组,且元素去空格 |
| | | return Array.isArray(arr) ? arr.map(item => item.trim()) : [] |
| | | } catch (e) { |
| | | // 解析失败时,降级处理(按逗号分割) |
| | | console.warn('工序数据解析失败,降级处理:', e) |
| | | return str.split(',').filter(item => item.trim()) |
| | | } |
| | | } |
| | | |
| | | const currentProcessOptions = ref([]) |
| | | //第一次加载数据 |
| | | let groupChangeProcess = ref(false)//用于本班组显示问题 |
| | | const initTiltle = async () => { |
| | |
| | | if (res.code == 200) { |
| | | titleSelectJson.value.processType = res.data.process |
| | | processName = res.data.processNameList |
| | | |
| | | if(user.user.address!==null && user.user.address!==''){ |
| | | titleUploadData.value.thisProcess = user.user.address |
| | | user.user.address=parseProcessData(user.user.address) |
| | | titleUploadData.value.thisProcess = user.user.address[0] // 数组取第一个作为默认值(可选) |
| | | titleUploadData.value.teamsGroupsName = user.user.userName |
| | | groupChangeProcess.value = true |
| | | currentProcessOptions.value = user.user.address.map((name, index) => ({ |
| | | id: `user_process_${index}`, |
| | | basic_name: name, |
| | | basic_type: 'process', |
| | | basic_category: index + 1 |
| | | })); |
| | | |
| | | if (user.user.address==='技术部多曲' || user.user.address==='夹胶'){ |
| | | groupChangeProcess.value = false |
| | | currentProcessOptions.value = titleSelectJson.value.processType |
| | | } |
| | | gridOptions.toolbarConfig.buttons[1].visible=false |
| | | }else { |
| | | currentProcessOptions.value = titleSelectJson.value.processType // 无默认值显示全部 |
| | | } |
| | | |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const filterCurrentProcessOptions = () => { |
| | | // ======== 核心修改开始 ======== |
| | | const userBelongProcess = user.user.address || []; |
| | | // 始终只显示员工所属工序(有值)或全部工序(无值) |
| | | if (userBelongProcess.length > 0) { |
| | | currentProcessOptions.value = user.user.address.map((name, index) => ({ |
| | | id: `user_process_${index}`, |
| | | basic_name: name, |
| | | basic_type: 'process', |
| | | basic_category: index + 1 |
| | | })); |
| | | } else { |
| | | currentProcessOptions.value = titleSelectJson.value.processType; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | titleUploadData.value.processId = processId |
| | | titleUploadData.value.teamsGroupsName = user.user.userName |
| | | titleUploadData.value.laminating = res.data.laminating |
| | | if(titleUploadData.value.order.batch!=null&&titleUploadData.value.order.batch!=""){ |
| | | titleUploadData.value.order.project=titleUploadData.value.order.project+'('+titleUploadData.value.order.batch+')' |
| | | } |
| | | |
| | | //设备下拉框 |
| | | titleSelectJson.value.deviceType = res.data.device |
| | | //班组下拉框 |
| | |
| | | }); |
| | | detail.value = modifiedCollection |
| | | xGrid.value.reloadData(detail.value) |
| | | |
| | | filterCurrentProcessOptions() |
| | | |
| | | hideButton() |
| | | // nextTick(() => { |
| | | // hiddenCompletedOk() |
| | |
| | | style="width: 120px" |
| | | @change="getWork();getQuantity()"> |
| | | <el-option |
| | | v-for="item in titleSelectJson['processType']" |
| | | v-for="item in currentProcessOptions" |
| | | :key="item.id" |
| | | :label="item.basic_name" |
| | | :value="item.basic_name" |
| | |
| | | <el-text>{{$t('processCard.customerName')}}:</el-text> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <el-text class="customClass"></el-text> |
| | | <el-text class="customClass">{{ titleUploadData.order.customerName }}</el-text> |
| | | </el-col> |
| | | <el-col :span="2"> |
| | | <el-text >{{$t('order.project')}}:</el-text> |
| | | <el-text >{{$t('order.project')}}({{$t('order.batch')}}):</el-text> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <el-input :readonly="true" v-model="titleUploadData.order.project"/> |
| | |
| | | const dialogVisibleProcess = ref(false) |
| | | let roleList = ref([]) |
| | | //工序 |
| | | const processValue = ref() |
| | | const processValue = ref([]) |
| | | let userRole= ref({ |
| | | userId:'', |
| | | roles:[] |
| | |
| | | arr.forEach(item=>{ |
| | | let bValues = item.userRoleList.map(item => item.role); |
| | | item.role = bValues.join(',') |
| | | // 核心:处理工序列显示(转为切割,磨边格式) |
| | | item.address = formatProcessForTable(item.address) |
| | | }) |
| | | gridOptions.data = res.data.users[0] |
| | | roleList.value = res.data.role[0] |
| | | }) |
| | | |
| | | }) |
| | | |
| | | // 工具函数:统一处理工序数据为逗号分隔字符串(适配表格显示) |
| | | const formatProcessForTable = (processData) => { |
| | | if (!processData) return '' |
| | | |
| | | // 步骤1:处理JSON字符串(如 "\"[\"切割\",\"磨边\"]\"") |
| | | let str = String(processData).trim() |
| | | if (str.startsWith('"') && str.endsWith('"')) { |
| | | str = str.slice(1, -1) |
| | | } |
| | | |
| | | // 步骤2:尝试解析为数组 |
| | | try { |
| | | const arr = JSON.parse(str) |
| | | if (Array.isArray(arr)) { |
| | | return arr.join(',') // 中文逗号分隔,如需英文逗号改为 ',' |
| | | } |
| | | } catch (e) { |
| | | // 解析失败,直接使用原字符串(如已为"切割,磨边") |
| | | return str.replace(/[,,]/g, ',') // 统一为中文逗号 |
| | | } |
| | | |
| | | // 兜底:非数组格式直接返回 |
| | | return str |
| | | } |
| | | |
| | | const getTableRow = (row,type) => { |
| | | switch (type) { |
| | |
| | | case 'editProcess': { |
| | | dialogVisibleProcess.value = true |
| | | processRow.value.userId = row.id |
| | | // 清空之前选择的工序 |
| | | processValue.value = [] |
| | | |
| | | processValue.value = row.address ? row.address.split(',').filter(item => item.trim()) : [] |
| | | break |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | const handleClose = (done) => { |
| | | userRole.value.roles = [] |
| | |
| | | } |
| | | |
| | | const updateProcess = () => { |
| | | let userId=processRow.value.userId |
| | | if (processValue.value!=null){ |
| | | request.post(`userInfo/updateProcess/${userId}/${processValue.value}`).then(res=>{ |
| | | if(res.code==200 && res.data===true){ |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({path:'/main/user/userList',query:{random:Math.random()}}) |
| | | } |
| | | const userId = processRow.value.userId |
| | | // 检查是否选择了工序 |
| | | let processStr="" |
| | | if (processValue.value && processValue.value.length > 0) { |
| | | // 将选中的工序数组转为字符串(根据后端需求调整格式) |
| | | processStr = JSON.stringify(processValue.value) |
| | | |
| | | }) |
| | | dialogVisible.value = false |
| | | }else { |
| | | ElMessage.warning(t('report.pleaseSelectAProcessFirst')) |
| | | } |
| | | |
| | | try { |
| | | request.post(`userInfo/updateProcess/${userId}`,{processList: processStr}).then(res => { |
| | | if (res.code == 200 && res.data === true) { |
| | | ElMessage.success(t('basicData.msg.saveSuccess')) |
| | | router.push({ path: '/main/user/userList', query: { random: Math.random() } }) |
| | | // 关闭工序弹窗 |
| | | dialogVisibleProcess.value = false |
| | | } |
| | | }) |
| | | }catch (err) { |
| | | // 捕获网络错误、接口报错等所有异常 |
| | | console.error('初始化工序失败:', err); |
| | | ElMessage.error('初始化数据失败,请刷新重试'); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | width="30%" |
| | | :before-close="handleClose" |
| | | > |
| | | <el-select v-model="processValue" clearable :placeholder="$t('reportingWorks.selectProcess')" default-value="default_city" style="width: 120px"> |
| | | <el-option |
| | | v-for="item in processRow['process']" |
| | | :key="item.id" |
| | | :label="item.basic_name" |
| | | :value="item.basic_name" |
| | | /> |
| | | </el-select> |
| | | <div class="process-checkbox-group"> |
| | | <el-checkbox-group |
| | | v-model="processValue" |
| | | class="checkbox-group" |
| | | > |
| | | <el-checkbox |
| | | v-for="item in processRow.process" |
| | | :key="item.id" |
| | | :label="item.basic_name" |
| | | class="checkbox-item" |
| | | > |
| | | {{ item.basic_name }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </div> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="dialogVisibleProcess = false">{{ $t('basicData.cancelButtonText') }}</el-button> |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | |
| | | |
| | | @ApiOperation("修改用户工序") |
| | | @SaCheckPermission("userList.search") |
| | | @PostMapping("updateProcess/{id}/{process}") |
| | | public Result updateProcess(@PathVariable Integer id,@PathVariable String process){ |
| | | @PostMapping("updateProcess/{id}") |
| | | public Result updateProcess(@PathVariable Integer id, @RequestBody Map<String, String> process){ |
| | | return Result.success(userService.updateProcessSv(id,process)); |
| | | } |
| | | } |
| | |
| | | private Double money; |
| | | private String alias; |
| | | private Integer deliveryState; |
| | | private String orderId; |
| | | private LocalDateTime createTime; |
| | | } |
| | |
| | | |
| | | import com.example.erp.dto.sd.DeliveryDetailDTO; |
| | | import com.example.erp.dto.sd.DeliveryDetailProductDTO; |
| | | import com.example.erp.entity.sd.Delivery; |
| | | import com.example.erp.entity.sd.DeliveryDetail; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.*; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.data.repository.CrudRepository; |
| | |
| | | Boolean updateDeliveryDetailmonye(@Param("price") Double price,@Param("deliveryDetail") DeliveryDetail deliveryDetail); |
| | | Boolean updateDeliverymonye(@Param("deliveryId") String deliveryId,@Param("money") Double money); |
| | | |
| | | Boolean insertDeliveryOtherMoney(@Param("orderOtherMoney")OrderOtherMoney orderOtherMoney,@Param("deliveryId") String deliveryId); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.example.erp.dto.sd.DeliveryDetailDTO; |
| | | import com.example.erp.dto.sd.DeliveryDetailProductDTO; |
| | |
| | | SysErrorService sysErrorService; |
| | | @Autowired |
| | | FinishedGoodsInventoryService finishedGoodsInventoryService; |
| | | @Autowired |
| | | OrderOtherMoneyMapper orderOtherMoneyMapper; |
| | | |
| | | |
| | | public Map<String, Object> getSelectShippingOrder(Integer pageNum, Integer pageSize,List<String> selectDate, Map<String,Object> config) throws JsonProcessingException { |
| | |
| | | //还原库存数以及订单明细的发货数 |
| | | finishedGoodsInventoryMapper.updateInventoryquantityIntBybox(deliveryDetail.getOrderId(), deliveryDetail.getOrderNumber(), deliveryDetail.getQuantity(),deliveryDetail.getBoxNo()); |
| | | deliveryDetailMapper.updateIsNotOrderDetailDeliveryNum(deliveryDetail.getOrderId(), deliveryDetail.getOrderNumber(), deliveryDetail.getQuantity()); |
| | | |
| | | } |
| | | } |
| | | //还原发货表的面积数量金额 |
| | |
| | | |
| | | }*/ |
| | | |
| | | List<OrderOtherMoney> orderOtherMoneyList = orderOtherMoneyMapper.selectList( |
| | | new QueryWrapper<OrderOtherMoney>() |
| | | .eq("order_id",orderDetail.getOrderId()) |
| | | .eq("delivery_state",0) |
| | | .isNull("`column`") |
| | | ); |
| | | |
| | | if(orderOtherMoneyList.size()>0){ |
| | | for (OrderOtherMoney orderOtherMoney:orderOtherMoneyList){ |
| | | otherMoneys=otherMoneys+orderOtherMoney.getMoney(); |
| | | deliveryDetailMapper.insertDeliveryOtherMoney(orderOtherMoney,oddNumber); |
| | | } |
| | | orderOtherMoneyMapper.update(null, new LambdaUpdateWrapper<OrderOtherMoney>() |
| | | .set(OrderOtherMoney::getDeliveryState, 1) |
| | | .eq(OrderOtherMoney::getOrderId, orderDetail.getOrderId()) |
| | | .isNull(OrderOtherMoney::getColumn) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | if(orderDetail.getOtherColumns()!="{}"&&orderDetail.getOtherColumns()!=null){ |
| | |
| | | |
| | | if(value!=null && !value.equals("") && key.contains("M")) { |
| | | orderOtherMoneyLists.forEach(orderOtherMoney -> { |
| | | if (orderOtherMoney.getColumn().equals(key)) { |
| | | if (orderOtherMoney.getColumn()!=null&&orderOtherMoney.getColumn().equals(key)) { |
| | | orderOtherMoney.setQuantity( |
| | | orderOtherMoney.getQuantity()+(Double.parseDouble((String) value) * finalOrderDetail.getQuantity())); |
| | | } |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Boolean updateProcessSv(Integer id, String process) { |
| | | return userMapper.updateProcessMp(id,process); |
| | | public Boolean updateProcessSv(Integer id, Map<String, String> process) { |
| | | String processList=null; |
| | | if(!Objects.equals(process.get("processList"), "")){ |
| | | processList=process.get("processList"); |
| | | } |
| | | return userMapper.updateProcessMp(id, processList); |
| | | } |
| | | |
| | | public Object findByAddress(Map<String,String> userName) { |
| | |
| | | <!-- 查询当前工序的表头数据--> |
| | | <select id="AddSelectLastWorkMp" resultMap="reportingWorkMap"> |
| | | select o.order_id, |
| | | o.batch, |
| | | fc.production_id, |
| | | fc.process_id as 'processIdFirst', |
| | | o.customer_id, |
| | |
| | | </select> |
| | | |
| | | <select id="SelectWorkBasicTeamsMp"> |
| | | select id,login_name,user_name,address from erp_user_info.`user` WHERE address=#{process} |
| | | select id,login_name,user_name,address from erp_user_info.`user` |
| | | where |
| | | address is not null and address != '' |
| | | and ( |
| | | (JSON_VALID(address) and JSON_CONTAINS(address,CONCAT('"', #{process}, '"') )) |
| | | or (not JSON_VALID(address) and address = #{process}) |
| | | ) |
| | | </select> |
| | | |
| | | <!-- 查询流程卡工艺流程--> |
| | |
| | | update sd.delivery set money=#{money} |
| | | where delivery_id=#{deliveryId} |
| | | </update> |
| | | |
| | | <insert id="insertDeliveryOtherMoney" useGeneratedKeys="true"> |
| | | insert into sd.delivery_other_money (delivery_id,quantity,price,money,alias,order_id,create_time) |
| | | values ( |
| | | #{deliveryId},#{orderOtherMoney.quantity},#{orderOtherMoney.price}, |
| | | #{orderOtherMoney.money},#{orderOtherMoney.alias},#{orderOtherMoney.orderId},now() |
| | | ) |
| | | </insert> |
| | | </mapper> |