This commit is contained in:
zhouzy062 2024-04-08 09:01:57 +08:00
commit a40363f3e5
15 changed files with 267 additions and 36 deletions

View File

@ -72,7 +72,11 @@
<groupId>com.bonus.sgzb</groupId> <groupId>com.bonus.sgzb</groupId>
<artifactId>sgzb-common-swagger</artifactId> <artifactId>sgzb-common-swagger</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.bonus.sgzb</groupId>
<artifactId>sgzb-common-security</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.file; package com.bonus.sgzb.file;
import com.bonus.sgzb.common.security.annotation.EnableRyFeignClients;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
@ -12,6 +13,7 @@ import com.bonus.sgzb.common.swagger.annotation.EnableCustomSwagger2;
*/ */
@EnableCustomSwagger2 @EnableCustomSwagger2
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class }) @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
@EnableRyFeignClients
public class SgzbFileApplication public class SgzbFileApplication
{ {
public static void main(String[] args) public static void main(String[] args)

View File

@ -102,7 +102,7 @@ public class MachIneDto {
/** /**
* 数量 * 数量
*/ */
@ApiModelProperty(value = "数量") @ApiModelProperty(value = "上方页面入库数量")
private Double num; private Double num;
/** /**
@ -114,6 +114,18 @@ public class MachIneDto {
/** /**
* 入库数量 * 入库数量
*/ */
@ApiModelProperty(value = "入库数量") @ApiModelProperty(value = "表单集合入库数量")
private Double putInStoreNum; private Double putInStoreNum;
/**
* 单位名称
*/
@ApiModelProperty(value = "单位名称")
private String unitId;
/**
* 工程名称
*/
@ApiModelProperty(value = "工程名称")
private String proId;
} }

View File

@ -116,6 +116,12 @@ public class PurchaseMacodeInfo extends BaseEntity
@ApiModelProperty(value = "单位名称") @ApiModelProperty(value = "单位名称")
private String unitName; private String unitName;
/**
* 类型管理方式
*/
@ApiModelProperty(value = "类型管理方式")
private String manageType;
public String getUnitName() { public String getUnitName() {
return unitName; return unitName;
} }
@ -335,6 +341,14 @@ public class PurchaseMacodeInfo extends BaseEntity
this.dictName = dictName; this.dictName = dictName;
} }
public String getManageType() {
return manageType;
}
public void setManageType(String manageType) {
this.manageType = manageType;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -90,7 +90,7 @@ public class SavePutInfoDto extends BaseEntity {
* 工程名称 * 工程名称
*/ */
@ApiModelProperty(value = "工程名称") @ApiModelProperty(value = "工程名称")
private String projectId; private String proId;
/** /**
* 创建者 * 创建者

View File

@ -23,7 +23,7 @@ public interface InventoryAndWarehousingMapper {
List<PutInStorageBean> getList(PutInStorageBean bean); List<PutInStorageBean> getList(PutInStorageBean bean);
/** /**
* ma_type_put_in_storage_details表 * 新增ma_type_put_in_storage_details表
* @param machIneDto * @param machIneDto
* @return * @return
*/ */
@ -38,19 +38,31 @@ public interface InventoryAndWarehousingMapper {
/** /**
* 更新matype表中num数量 * 更新matype表中num数量
* @param * @param typeId
* @param num
* @return
*/ */
int updateMaType(@Param("typeId") String typeId, @Param("num") Double num); int updateMaType(@Param("typeId") String typeId, @Param("num") Double num);
/** /**
* 新增ma_machine表 * 新增ma_machine表
* @param * @param machIneDto
* @return * @return
*/ */
int insertMachine(MachIneDto machIneDto); int insertMachine(MachIneDto machIneDto);
/**
* 新增ma_machine_label
* @param machIneDto
* @return
*/
int insertMachineLabel(MachIneDto machIneDto); int insertMachineLabel(MachIneDto machIneDto);
/**
* 新增ma_label_bind
* @param machIneDto
* @return
*/
int insertLabelBind(MachIneDto machIneDto); int insertLabelBind(MachIneDto machIneDto);
/** /**
@ -60,5 +72,4 @@ public interface InventoryAndWarehousingMapper {
*/ */
int selectByCode(String code); int selectByCode(String code);
int selectById(Integer id);
} }

View File

@ -121,6 +121,8 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
machIneDto.setPutInType(dto.getPutInType()); machIneDto.setPutInType(dto.getPutInType());
machIneDto.setNum(dto.getNum()); machIneDto.setNum(dto.getNum());
machIneDto.setCheckMan(dto.getCheckMan()); machIneDto.setCheckMan(dto.getCheckMan());
machIneDto.setUnitId(dto.getUnitId());
machIneDto.setProId(dto.getProId());
res += insertMachineInfo(machIneDto); res += insertMachineInfo(machIneDto);
} }
return res; return res;
@ -176,6 +178,8 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
machIneDto.setCreator(dto.getCreator()); machIneDto.setCreator(dto.getCreator());
machIneDto.setPutInType(dto.getPutInType()); machIneDto.setPutInType(dto.getPutInType());
machIneDto.setRemarks(dto.getRemarks()); machIneDto.setRemarks(dto.getRemarks());
machIneDto.setUnitId(dto.getUnitId());
machIneDto.setProId(dto.getProId());
res += insertTypePutInStorageInfo(machIneDto); res += insertTypePutInStorageInfo(machIneDto);
//根据类型追加ma_type表里面的num //根据类型追加ma_type表里面的num
res += updateMaTypeInfo(machIneDto.getTypeId(), machIneDto.getPutInStoreNum()); res += updateMaTypeInfo(machIneDto.getTypeId(), machIneDto.getPutInStoreNum());

View File

@ -58,6 +58,8 @@
</otherwise> </otherwise>
</choose> </choose>
<if test="creator != null and creator != ''">CREATOR,</if> <if test="creator != null and creator != ''">CREATOR,</if>
<if test="unitId != null and unitId != ''">UNIT_ID,</if>
<if test="proId != null and proId != ''">PROJECT_ID,</if>
CREATE_DATE, CREATE_DATE,
<choose> <choose>
<when test="isCode and remarks != null and remarks != ''"> <when test="isCode and remarks != null and remarks != ''">
@ -84,6 +86,8 @@
</otherwise> </otherwise>
</choose> </choose>
<if test="creator != null and creator != ''">#{creator},</if> <if test="creator != null and creator != ''">#{creator},</if>
<if test="unitId != null and unitId != ''">#{unitId},</if>
<if test="proId != null and proId != ''">#{proId},</if>
sysdate(), sysdate(),
<choose> <choose>
<when test="isCode and remarks != null and remarks != ''"> <when test="isCode and remarks != null and remarks != ''">
@ -194,10 +198,4 @@
<if test="code != null ">and qr_code = #{code}</if> <if test="code != null ">and qr_code = #{code}</if>
</where> </where>
</select> </select>
<select id="selectById" resultType="java.lang.Integer">
select info from ma_type_put_in_storage_details
<where>
<if test="id != null">and ID = #{id}</if>
</where>
</select>
</mapper> </mapper>

View File

@ -190,6 +190,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if> <if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if>
<if test="purchaser != null "> and pci.purchaser = #{purchaser}</if> <if test="purchaser != null "> and pci.purchaser = #{purchaser}</if>
<if test="companyId != null "> and pci.company_id = #{companyId}</if> <if test="companyId != null "> and pci.company_id = #{companyId}</if>
<if test="typeId != null">AND #{typeId} IN (SELECT mt2.type_id
FROM purchase_check_details pcd
LEFT JOIN ma_type mt on mt.type_id=pcd.type_id
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
WHERE pcd.task_id = pci.task_id
)
</if>
order by pci.id desc order by pci.id desc
</select> </select>
<select id="exportList" resultType="com.bonus.sgzb.material.domain.PurchaseCheckInfo"> <select id="exportList" resultType="com.bonus.sgzb.material.domain.PurchaseCheckInfo">
@ -279,6 +286,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if> <if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if>
<if test="purchaser != null "> and pci.purchaser = #{purchaser}</if> <if test="purchaser != null "> and pci.purchaser = #{purchaser}</if>
<if test="companyId != null "> and pci.company_id = #{companyId}</if> <if test="companyId != null "> and pci.company_id = #{companyId}</if>
<if test="typeId != null">AND #{typeId} IN (SELECT mt2.type_id
FROM purchase_check_details pcd
LEFT JOIN ma_type mt on mt.type_id=pcd.type_id
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
WHERE pcd.task_id = pci.task_id
)
</if>
order by pci.id desc order by pci.id desc
</select> </select>
<select id="selectTypeNameAndManageTypeByTaskId" <select id="selectTypeNameAndManageTypeByTaskId"

View File

@ -354,6 +354,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select pcd.production_time productionTime, select pcd.production_time productionTime,
mt.type_name specificationType, mt.type_name specificationType,
mt1.type_name typeName, mt1.type_name typeName,
mt.manage_type as manageType,
pmi.ma_code maCode, pmi.ma_code maCode,
mm.assets_code assetsCode, mm.assets_code assetsCode,
pmi.fix_code fixCode, pmi.fix_code fixCode,

View File

@ -0,0 +1,22 @@
package com.bonus.sgzb.system.config;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class FeignClientConfig {
@Bean
public Encoder feignFormEncoder() {
return new SpringFormEncoder();
}
@Bean
public feign.Logger.Level multipartLoggerLevel() {
return feign.Logger.Level.FULL;
}
}

View File

@ -0,0 +1,21 @@
package com.bonus.sgzb.system.service.feign;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
@FeignClient(value = "sgzb-file")
public interface FileClient {
@ApiOperation(value = "使用腾讯云文件上传")
@PostMapping(value = "/tencent/cos/uploadFile",consumes = "multipart/form-data; boundary=----WebKitFormBoundaryPT06LeXYhc3X1Lna")
AjaxResult uploadFile(@RequestPart("file") MultipartFile file);
}

View File

@ -3,11 +3,13 @@ package com.bonus.sgzb.system.service.impl;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.bonus.sgzb.common.core.utils.DateTimeHelper; import com.bonus.sgzb.common.core.utils.DateTimeHelper;
import com.bonus.sgzb.common.core.utils.GlobalConstants; import com.bonus.sgzb.common.core.utils.GlobalConstants;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.system.api.model.LoginUser;
import com.bonus.sgzb.system.domain.FileInfo; import com.bonus.sgzb.system.domain.FileInfo;
import com.bonus.sgzb.system.mapper.FileInfoMapper; import com.bonus.sgzb.system.mapper.FileInfoMapper;
import com.bonus.sgzb.system.service.SysFileService; import com.bonus.sgzb.system.service.SysFileService;
import com.bonus.sgzb.system.service.feign.FileClient;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hwpf.extractor.WordExtractor; import org.apache.poi.hwpf.extractor.WordExtractor;
import org.apache.poi.openxml4j.util.ZipSecureFile; import org.apache.poi.openxml4j.util.ZipSecureFile;
import org.apache.poi.xwpf.extractor.XWPFWordExtractor; import org.apache.poi.xwpf.extractor.XWPFWordExtractor;
@ -20,11 +22,7 @@ import org.springframework.web.multipart.support.StandardMultipartHttpServletReq
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.File; import java.io.*;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.Security;
import java.util.*; import java.util.*;
/** /**
@ -32,6 +30,7 @@ import java.util.*;
* *
* @author zys * @author zys
*/ */
@Slf4j
@Primary @Primary
@Service("SysFileService") @Service("SysFileService")
public class SysFileServiceImpl implements SysFileService { public class SysFileServiceImpl implements SysFileService {
@ -44,6 +43,10 @@ public class SysFileServiceImpl implements SysFileService {
@Value("${file.path}") @Value("${file.path}")
private String localFilePath; private String localFilePath;
@Resource
private FileClient fileClient;
/** /**
* 本地文件上传接口 * 本地文件上传接口
* *
@ -61,6 +64,8 @@ public class SysFileServiceImpl implements SysFileService {
MultipartFile item = items.get(0); MultipartFile item = items.get(0);
try { try {
String url = saveFile(request, item, photoType); String url = saveFile(request, item, photoType);
//AjaxResult res = fileClient.uploadFile(item);
//String url = (String) res.get("msg");
if (url != null) { if (url != null) {
int words = getFileText(item); int words = getFileText(item);
String fileName = item.getOriginalFilename(); String fileName = item.getOriginalFilename();
@ -94,6 +99,8 @@ public class SysFileServiceImpl implements SysFileService {
Long userId = SecurityUtils.getLoginUser().getUserid(); Long userId = SecurityUtils.getLoginUser().getUserid();
try { try {
String url = saveFilePic(item, fileType); String url = saveFilePic(item, fileType);
/*AjaxResult res = fileClient.uploadFile(item);
String url = (String) res.get("msg");*/
if (url != null) { if (url != null) {
int words = getFileText(item); int words = getFileText(item);
String fileName = item.getOriginalFilename(); String fileName = item.getOriginalFilename();
@ -115,7 +122,6 @@ public class SysFileServiceImpl implements SysFileService {
return file; return file;
} }
public HashMap<String, Object> getFile(StandardMultipartHttpServletRequest request) { public HashMap<String, Object> getFile(StandardMultipartHttpServletRequest request) {
MultipartFile multipartFile; MultipartFile multipartFile;
HashMap<String, Object> map = new HashMap<String, Object>(16); HashMap<String, Object> map = new HashMap<String, Object>(16);

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.system.service.impl; package com.bonus.sgzb.system.service.impl;
import cn.hutool.http.HttpRequest;
import com.alibaba.druid.util.StringUtils; import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.bonus.sgzb.common.core.constant.UserConstants; import com.bonus.sgzb.common.core.constant.UserConstants;
@ -66,13 +67,14 @@ public class SysSmsServiceImpl implements ISysSmsService {
if (phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) { if (phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) {
return AjaxResult.error("手机号格式不正确"); return AjaxResult.error("手机号格式不正确");
} }
try { /* try {
String[] args = msg.split(","); String[] args = msg.split(",");
String body = sendMessageNew(phone,tencentSmsConfig.getTemplateId().get(0),args); String body = sendMessageNew(phone,tencentSmsConfig.getTemplateId().get(0),args);
return success("发送手机号码:" + phone + ",内容:" + msg + ",返回结果:" + body); return success("发送手机号码:" + phone + ",内容:" + msg + ",返回结果:" + body);
} catch (Exception e) { } catch (Exception e) {
return AjaxResult.error("发送失败:" + e.getMessage()); return AjaxResult.error("发送失败:" + e.getMessage());
} }*/
return sendMsgByPhone( phone, msg);
} }
/** /**
@ -83,7 +85,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
@Override @Override
public AjaxResult codeLogin(String phone) { public AjaxResult codeLogin(String phone) {
try { /*try {
//获取六位验证码 //获取六位验证码
String code = getSixBitCode(); String code = getSixBitCode();
//调用发送短信的方法 //调用发送短信的方法
@ -93,7 +95,8 @@ public class SysSmsServiceImpl implements ISysSmsService {
return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body); return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body);
} catch (Exception e) { } catch (Exception e) {
return AjaxResult.error("发送失败:" + e.getMessage()); return AjaxResult.error("发送失败:" + e.getMessage());
} }*/
return sendCodeByPhone(phone,null);
} }
@ -102,7 +105,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
* @param phone 手机号码 * @param phone 手机号码
* @return AjaxResult对象 * @return AjaxResult对象
*/ */
/* private AjaxResult sendMsgByPhone(String phone, String msg) { private AjaxResult sendMsgByPhone(String phone, String msg) {
// 校验手机号码 // 校验手机号码
if (phone == null || phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) { if (phone == null || phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) {
return AjaxResult.error("手机号码不正确"); return AjaxResult.error("手机号码不正确");
@ -120,7 +123,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
} catch (Exception e) { } catch (Exception e) {
return AjaxResult.error("发送失败:" + e.getMessage()); return AjaxResult.error("发送失败:" + e.getMessage());
} }
}*/ }
/** /**
@ -128,7 +131,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
* @param phone 手机号码 * @param phone 手机号码
* @return AjaxResult对象 * @return AjaxResult对象
*/ */
/* private AjaxResult sendCodeByPhone(String phone, String msg) { private AjaxResult sendCodeByPhone(String phone, String msg) {
// 校验手机号码 // 校验手机号码
if (phone == null || phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) { if (phone == null || phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) {
return AjaxResult.error("手机号格式错误请输入11位数字号码"); return AjaxResult.error("手机号格式错误请输入11位数字号码");
@ -152,7 +155,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
} catch (Exception e) { } catch (Exception e) {
return AjaxResult.error("发送失败:" + e.getMessage()); return AjaxResult.error("发送失败:" + e.getMessage());
} }
}*/ }
/** /**

View File

@ -169,8 +169,9 @@
<el-select <el-select
v-model="codeForm.putInType" v-model="codeForm.putInType"
placeholder="请选择入库来源" placeholder="请选择入库来源"
clearable filterable filterable
style="width: 220px" style="width: 220px"
@change="changePutInType"
> >
<el-option <el-option
v-for="item in codeInStoreOptions" v-for="item in codeInStoreOptions"
@ -210,6 +211,19 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7">
<el-form-item label="备注" label-width="130px" prop="remarks" v-if="isNumCheck">
<el-input
v-model="codeForm.remarks"
type="textarea"
placeholder="请输入备注"
maxlength="200"
rows="3"
show-word-limit
style="width: 13vw;"
/>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
@ -298,6 +312,44 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20">
<el-col :span="7">
<el-form-item label="领料单位" label-width="130px" prop="unitId" v-show="isPutInType"
:rules="{ required: isPutInType, message: '领料单位不能为空', trigger: 'change' }">
<el-select v-model="codeForm.unitId" placeholder="请选择领料单位" style="width: 220px;"
@change="changeUnitData" clearable filterable>
<el-option
v-for="item in unitList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="领料工程" label-width="130px" prop="proId" v-show="isPutInType"
:rules="{ required: isPutInType, message: '领料工程不能为空', trigger: 'change' }">
<el-select v-model="codeForm.proId" placeholder="请选择领料工程" style="width: 400px;"
@change="changeProList" clearable filterable>
<el-option
v-for="item in proList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label=" " label-width="130px" v-show="isPutInType">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="fillCodeForm">点击填充</el-button>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="7"> <el-col :span="7">
@ -306,8 +358,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="isNumCheck ? 7 : 10"> <el-col :span="10">
<el-form-item label="备注" label-width="130px" prop="remarks"> <el-form-item label="备注" label-width="130px" prop="remarks" v-if="!isNumCheck">
<el-input <el-input
v-model="codeForm.remarks" v-model="codeForm.remarks"
type="textarea" type="textarea"
@ -315,14 +367,14 @@
maxlength="200" maxlength="200"
rows="4" rows="4"
show-word-limit show-word-limit
:style="{ width: isNumCheck ? '220px' : '400px' }" style="width: 400px;"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item style="margin-left: 200px;"> <el-form-item label=" " label-width="130px" v-show="!isPutInType">
<el-button type="primary" icon="el-icon-edit" size="mini" @click="fillCodeForm">点击填充</el-button> <el-button type="primary" icon="el-icon-edit" size="mini" @click="fillCodeForm">点击填充</el-button>
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -512,6 +564,7 @@ import {
} from "@/api/store/putInStore"; } from "@/api/store/putInStore";
import { getInfo } from '@/api/login' import { getInfo } from '@/api/login'
import { supplierInfoList } from "@/api/store/tools"; import { supplierInfoList } from "@/api/store/tools";
import { getUnitData, getProData } from "@/api/claimAndRefund/receive";
export default { export default {
name: "DevicesWarehousing", name: "DevicesWarehousing",
@ -590,6 +643,11 @@ export default {
remark: '', // remark: '', //
preNum: 1, // preNum: 1, //
}, },
//
unitList: [],
//
proList: [],
isPutInType: false,
// / // /
numberForm: {}, numberForm: {},
codeForm: { codeForm: {
@ -605,6 +663,8 @@ export default {
codeFactory: undefined, codeFactory: undefined,
thisCheckTime: undefined, thisCheckTime: undefined,
nextCheckTime: undefined, nextCheckTime: undefined,
unitId: null,
proId: null,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
}, },
@ -808,10 +868,12 @@ export default {
/** 新增数量盘点按钮操作 */ /** 新增数量盘点按钮操作 */
handleNumberAdd() { handleNumberAdd() {
this.isNumCheck = true; this.isNumCheck = true;
this.isPutInType = false;
this.reset(); this.reset();
this.codeOpen = true; this.codeOpen = true;
this.title = "数量盘点入库"; this.title = "数量盘点入库";
this.resetCodeForm() this.resetCodeForm()
this.getUnitData();
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['codeForm'].clearValidate() this.$refs['codeForm'].clearValidate()
}) })
@ -819,10 +881,12 @@ export default {
/** 新增编号盘点按钮操作 */ /** 新增编号盘点按钮操作 */
handleCodeAdd() { handleCodeAdd() {
this.isNumCheck = false; this.isNumCheck = false;
this.isPutInType = false;
this.reset(); this.reset();
this.codeOpen = true; this.codeOpen = true;
this.title = "编码盘点入库"; this.title = "编码盘点入库";
this.resetCodeForm() this.resetCodeForm()
this.getUnitData();
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['codeForm'].clearValidate() this.$refs['codeForm'].clearValidate()
}) })
@ -858,6 +922,8 @@ export default {
putInType: this.codeForm.putInType, putInType: this.codeForm.putInType,
remarks: this.codeForm.remarks || '', remarks: this.codeForm.remarks || '',
machIneDtoList: this.numTableList, machIneDtoList: this.numTableList,
unitId: this.codeForm.unitId,
proId: this.codeForm.proId,
} }
console.log('🚀 ~ submitForm: ~ SavePutInfoDto-isNum', SavePutInfoDto) console.log('🚀 ~ submitForm: ~ SavePutInfoDto-isNum', SavePutInfoDto)
// //
@ -892,6 +958,8 @@ export default {
remarks: this.codeForm.remarks || '', remarks: this.codeForm.remarks || '',
machIneDtoList: this.codeTableList, machIneDtoList: this.codeTableList,
checkMan: this.codeForm.checkMan || '', checkMan: this.codeForm.checkMan || '',
unitId: this.codeForm.unitId,
proId: this.codeForm.proId,
} }
console.log('🚀 ~ submitForm: ~ SavePutInfoDto', SavePutInfoDto) console.log('🚀 ~ submitForm: ~ SavePutInfoDto', SavePutInfoDto)
@ -1032,7 +1100,58 @@ export default {
} }
); );
}, },
} changePutInType(val) {
if (val == '退料入库') {
this.isPutInType = true
} else {
this.isPutInType = false
this.$nextTick(() => {
this.$set(this.codeForm, 'unitId', null)
this.$set(this.codeForm, 'proId', null)
})
}
},
//
async getUnitData() {
try {
const res = await getUnitData()
this.unitList = res.data
} catch (error) {
console.log('🚀 ~ getUnitData ~ error:', error)
}
},
changeUnitData(val) {
// console.log('🚀 ~ changeUnitData ~ val:', val);
this.codeForm.unitId = val
this.proList = []
this.$set(this.codeForm, 'proId', null)
if(val) {
this.getProList()
}
},
async getProList() {
const unitId = this.codeForm.unitId
//
try {
const res = await getProData({id: unitId})
// console.log('🚀 ~ changeUnitData ~ data:', res.data);
this.proList = res.data
if (res.data.length == 0) {
this.proList = []
this.codeForm.proId = null
} else {
this.proList = res.data
}
// console.log('🚀 ~ changeUnitData ~ this.proList:', this.proList);
} catch (error) {
console.log('🚀 ~ changeUnitData ~ error:', error)
}
},
changeProList(val) {
this.codeForm.proId = val
// console.log('🚀 ~ changeProList ~ this.codeForm:', this.codeForm.proId);
}
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>