feat: 添加供应商
This commit is contained in:
@@ -2,17 +2,21 @@ package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.service.IMdCsSupplierbaseService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||
@@ -46,6 +50,8 @@ public class GroupController {
|
||||
private final IMdPbGroupplateService iMdPbGroupplateService;
|
||||
@Autowired
|
||||
private final IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
||||
@Autowired
|
||||
private IMdCsSupplierbaseService supplierbaseService;
|
||||
|
||||
@GetMapping
|
||||
@Log("分页查询")
|
||||
@@ -69,6 +75,12 @@ public class GroupController {
|
||||
throw new BadRequestException("当前载具组盘信息已存在");
|
||||
}
|
||||
}
|
||||
MdCsSupplierbase supp = supplierbaseService.getByCode(group.getString("supp_code"));
|
||||
if (ObjectUtil.isEmpty(supp)) {
|
||||
throw new BadRequestException("供应商信息不存在!");
|
||||
}
|
||||
groupPlate.setSupp_code(supp.getSupp_code());
|
||||
groupPlate.setSupp_name(supp.getSupp_name());
|
||||
groupPlate.setGroup_id(IdUtil.getStringId());
|
||||
groupPlate.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
groupPlate.setCreate_name(SecurityUtils.getCurrentUsername());
|
||||
|
||||
@@ -49,6 +49,11 @@ public class SupplierController {
|
||||
iMdCsSupplierbaseService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
@PostMapping("/drop-list")
|
||||
@Log("获取供应商下拉框")
|
||||
public ResponseEntity<Object> dropList(@RequestBody MdCsSupplierbase dto) {
|
||||
return new ResponseEntity<>(iMdCsSupplierbaseService.list(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改供应商")
|
||||
|
||||
@@ -150,6 +150,8 @@ public class PmFormData extends Model<PmFormData> {
|
||||
* 是否完结
|
||||
*/
|
||||
private Integer is_finish;
|
||||
private String supp_code;
|
||||
private String supp_name;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -119,6 +119,8 @@ public class PmFormDataParam extends BaseQuery<PmFormData> {
|
||||
* 说明
|
||||
*/
|
||||
private String remark;
|
||||
private String supper_code;
|
||||
private String supper_name;
|
||||
/**
|
||||
* 是否完结
|
||||
*/
|
||||
|
||||
@@ -17,8 +17,10 @@ import org.nl.common.utils.CopyUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.service.IBsrealStorattrService;
|
||||
import org.nl.wms.basedata_manage.service.IMdCsSupplierbaseService;
|
||||
import org.nl.wms.basedata_manage.service.IMdPbMeasureunitService;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
||||
import org.nl.wms.pm_manage.service.dao.PmFormData;
|
||||
import org.nl.wms.pm_manage.service.dao.mapper.PmFormDataMapper;
|
||||
@@ -69,6 +71,8 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
||||
private IMdPbMeasureunitService iMdPbMeasureunitService;
|
||||
@Resource
|
||||
private IBsrealStorattrService iBsrealStorattrService;
|
||||
@Resource
|
||||
private IMdCsSupplierbaseService supplierbaseService;
|
||||
|
||||
@Override
|
||||
public Integer syncFormData(String form_type, String dataString) {
|
||||
@@ -95,6 +99,11 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
||||
if (ObjectUtil.isEmpty(bsrealStorattr)) {
|
||||
throw new BadRequestException("没有该仓库信息");
|
||||
}
|
||||
MdCsSupplierbase supp = supplierbaseService.getByCode(params.getSupper_code());
|
||||
if (ObjectUtil.isEmpty(supp)) {
|
||||
throw new BadRequestException("供应商信息不存在!");
|
||||
}
|
||||
params.setSupper_name(supp.getSupp_name());
|
||||
params.setStor_name(bsrealStorattr.getStor_name());
|
||||
params.setUnit_name(mdPbMeasureunit.getUnit_name());
|
||||
pmFormDataMapper.insert(getBasicInfo(params, true));
|
||||
@@ -116,6 +125,11 @@ public class PmFormDataServiceImpl extends ServiceImpl<PmFormDataMapper, PmFormD
|
||||
if (ObjectUtil.isEmpty(bsrealStorattr)) {
|
||||
throw new BadRequestException("没有该仓库信息");
|
||||
}
|
||||
MdCsSupplierbase supp = supplierbaseService.getByCode(params.getSupper_code());
|
||||
if (ObjectUtil.isEmpty(supp)) {
|
||||
throw new BadRequestException("供应商信息不存在!");
|
||||
}
|
||||
params.setSupper_name(supp.getSupp_name());
|
||||
params.setStor_name(bsrealStorattr.getStor_name());
|
||||
params.setUnit_name(mdPbMeasureunit.getUnit_name());
|
||||
pmFormDataMapper.updateById(getBasicInfo(params, false));
|
||||
|
||||
@@ -110,6 +110,8 @@ public class GroupPlate implements Serializable {
|
||||
* 来源单据号
|
||||
*/
|
||||
private String ext_code;
|
||||
private String supp_code;
|
||||
private String supp_name;
|
||||
|
||||
/**
|
||||
* 来源单据类型
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
<el-form-item label="单位" prop="qty_unit_name">
|
||||
<el-select
|
||||
v-model="form.qty_unit_name"
|
||||
style="width: 100px"
|
||||
style="width: 200px"
|
||||
placeholder=""
|
||||
@change="unitChange"
|
||||
>
|
||||
@@ -134,6 +134,25 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商">
|
||||
<el-select
|
||||
v-model="form.supp_code"
|
||||
placeholder="请选择"
|
||||
style="width: 200px;">
|
||||
<el-option
|
||||
v-for="item in supplist"
|
||||
:key="item.supp_code"
|
||||
:label="item.supp_name"
|
||||
:value="item.supp_code">
|
||||
<span style="float: left">{{ item.supp_name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.supp_code }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
@@ -190,6 +209,7 @@
|
||||
|
||||
<script>
|
||||
import crudGroup from '@/views/wms/basedata/group/group'
|
||||
import crudSupp from '../../basedata/supp/supplierbase'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
@@ -207,6 +227,8 @@ const defaultForm = {
|
||||
qty_unit_id: null,
|
||||
qty_unit_name: null,
|
||||
qty: null,
|
||||
supp_code: null,
|
||||
supp_name: null,
|
||||
remark: null,
|
||||
status: null,
|
||||
create_id: null,
|
||||
@@ -240,11 +262,20 @@ export default {
|
||||
permission: {},
|
||||
materialDialog: false,
|
||||
classes: [],
|
||||
supplist: [],
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getSuppList()
|
||||
},
|
||||
methods: {
|
||||
getSuppList() {
|
||||
crudSupp.dropList({}).then(res => {
|
||||
this.supplist = res
|
||||
})
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
|
||||
@@ -13,7 +13,18 @@
|
||||
/>
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-upload2"
|
||||
size="mini"
|
||||
@click="uploadShow = true"
|
||||
>
|
||||
导入
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
@@ -158,6 +169,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<UploadDialog :dialog-show.sync="uploadShow"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -168,6 +180,7 @@ import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import UploadDialog from './UploadDialog.vue'
|
||||
|
||||
const defaultForm = {
|
||||
supp_id: null,
|
||||
@@ -199,7 +212,7 @@ const defaultForm = {
|
||||
}
|
||||
export default {
|
||||
name: 'Supplierbase',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
components: { UploadDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
dicts: ['is_used'],
|
||||
@@ -220,6 +233,7 @@ export default {
|
||||
return {
|
||||
permission: {},
|
||||
classes: [],
|
||||
uploadShow: false,
|
||||
rules: {
|
||||
supp_code: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
|
||||
@@ -24,6 +24,14 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function dropList(data) {
|
||||
return request({
|
||||
url: 'api/supplierbase/drop-list',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function excelImport(data) {
|
||||
return request({
|
||||
url: 'api/supplierbase/importExcel',
|
||||
@@ -40,4 +48,4 @@ export function downloadImportSuppTemplate(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, downloadImportSuppTemplate, excelImport }
|
||||
export default { add, edit, del, downloadImportSuppTemplate, excelImport, dropList }
|
||||
|
||||
@@ -199,6 +199,21 @@
|
||||
<el-form-item label="批次" prop="pcsn">
|
||||
<el-input v-model="form.pcsn" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商">
|
||||
<el-select
|
||||
v-model="form.supp_code"
|
||||
placeholder="请选择"
|
||||
style="width: 240px;">
|
||||
<el-option
|
||||
v-for="item in supplist"
|
||||
:key="item.supp_code"
|
||||
:label="item.supp_name"
|
||||
:value="item.supp_code">
|
||||
<span style="float: left">{{ item.supp_name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.supp_code }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model.trim="form.remark" style="width: 480px;" rows="2" type="textarea" :disabled="crud.status.view > 0" />
|
||||
@@ -272,6 +287,7 @@
|
||||
|
||||
<script>
|
||||
import crudFormData from './formData'
|
||||
import crudSupp from '../../basedata/supp/supplierbase'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation.vue'
|
||||
import udOperation from '@crud/UD.operation.vue'
|
||||
@@ -290,6 +306,8 @@ const defaultForm = {
|
||||
source_form_date: new Date(),
|
||||
material_name: null,
|
||||
material_spec: null,
|
||||
supp_code: null,
|
||||
supp_name: null,
|
||||
unit_id: null,
|
||||
form_type: null,
|
||||
status: null,
|
||||
@@ -332,6 +350,7 @@ export default {
|
||||
uploadShow: false,
|
||||
// fromTypes: [],
|
||||
storlist: [],
|
||||
supplist: [],
|
||||
permission: {},
|
||||
materShow: false,
|
||||
materOptCode: '',
|
||||
@@ -365,6 +384,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getSuppList()
|
||||
// 获取分类
|
||||
crudBsrealstorattr.getStor().then(res => {
|
||||
this.storlist = res
|
||||
@@ -373,6 +393,11 @@ export default {
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
getSuppList() {
|
||||
crudSupp.dropList({}).then(res => {
|
||||
this.supplist = res
|
||||
})
|
||||
},
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
if (this.query.datepick) {
|
||||
this.query.start_time = this.query.datepick[0]
|
||||
|
||||
Reference in New Issue
Block a user