Merge remote-tracking branch 'origin/dev-cq-bug' into dev

This commit is contained in:
15856 2024-04-30 17:51:44 +08:00
commit 834faeee43
8 changed files with 36 additions and 6 deletions

View File

@ -42,4 +42,11 @@ public interface MaMachineMapper {
SltAgreementApply getLeaseProject(MaMachine ma);
SltAgreementApply getBackProject(MaMachine ma);
/**
* 根据typeId修改库存
* @param typeId
* @return
*/
int updateNum(long typeId);
}

View File

@ -90,7 +90,17 @@ public class MaMachineServiceImpl implements MaMachineService {
@Override
public int remove(Long[] maIds) {
return maMachineMapper.remove(maIds);
int res = 0;
if (maIds != null || maIds.length > 0) {
for (Long maId : maIds) {
MaMachine maMachine = maMachineMapper.selectMaMachineByMaId(maId);
if (maMachine.getTypeId() != 0 && ("15").equals(maMachine.getMaStatus())) {
res = maMachineMapper.updateNum(maMachine.getTypeId());
}
}
}
res += maMachineMapper.remove(maIds);
return res;
}
@Override

View File

@ -262,6 +262,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</set>
where ma_id = #{maId}
</update>
<update id="updateNum">
update ma_type set num = num - 1 where type_id = #{typeId}
</update>
<delete id="remove" parameterType="Long">
delete from ma_machine where ma_id in

View File

@ -154,6 +154,14 @@ export function unitTypeList(query) {
params: query
})
}
// 单位类型-列表-下拉
export function unitTypeListAll(query) {
return request({
url: '/base/dic/lists',
method: 'get',
params: query
})
}
// 标签编号-列表
export function getMaMachineLabelApi(query) {
return request({

View File

@ -216,7 +216,7 @@
<script>
import { addUnit, delUnit, unitInfoAll, updateUnit } from "@/api/base/base";
import { unitTypeList } from "@/api/base/base";
import { unitTypeListAll } from "@/api/base/base";
import { deptTreeSelect } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -287,7 +287,7 @@ export default {
methods: {
//
getType() {
unitTypeList({ id: "1" }).then(response => {
unitTypeListAll({ id: "1" }).then(response => {
this.typeList = response.rows;
})
},

View File

@ -325,8 +325,8 @@ export default {
proList: [], //
statusList: [
{ id: '33', name: '待出库' },
{ id: '34', name: '出库中' },
{ id: '35', name: '已出库' },
{ id: '34', name: '出库进行中' },
{ id: '35', name: '完成' },
], //
//
typeList: [],

View File

@ -430,7 +430,8 @@ export default {
this.handleQuery()
},
resetDialogQuery() {
this.resetForm('dialogQuery')
// this.resetForm('dialogQuery')
this.dialogQuery.startTime = ''
this.handleDialogQuery()
},
//

View File

@ -482,6 +482,7 @@ export default {
],
parentId: [{ required: true, message: '所属上级不能为空', trigger: 'blur' }],
manageType: [{ required: true, message: '请选择管理模式', trigger: 'change' }],
leasePrice:[{required: true, message: '内部租赁价格不能为空', trigger: 'blur' }]
// password: [
// {required: true, message: "", trigger: "blur"},
// {min: 5, max: 20, message: ' 5 20 ', trigger: 'blur'}