zhc4dev
wangjiadong 2 years ago
parent 8454c8f405
commit 091160fe88
  1. 13
      ant-design-vue-jeecg/src/views/delivery/DeliveryList.vue
  2. 141
      ant-design-vue-jeecg/src/views/delivery/modules/DeliveryForm1.vue
  3. 60
      ant-design-vue-jeecg/src/views/delivery/modules/DeliveryModal1.vue
  4. 11
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/mapper/DeliveryMapper.java
  5. 38
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/delivery/service/impl/DeliveryServiceImpl.java

@ -95,6 +95,8 @@
</template> </template>
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="qdck(record)">确定出库</a>
<a-divider type="vertical" />
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
@ -115,7 +117,7 @@
</a-table> </a-table>
</div> </div>
<delivery-modal1 ref="modalFormqdck" @ok="modalFormOk"></delivery-modal1>
<delivery-modal ref="modalForm" @ok="modalFormOk"></delivery-modal> <delivery-modal ref="modalForm" @ok="modalFormOk"></delivery-modal>
</a-card> </a-card>
</template> </template>
@ -126,13 +128,15 @@
import { mixinDevice } from '@/utils/mixin' import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin' import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import DeliveryModal from './modules/DeliveryModal' import DeliveryModal from './modules/DeliveryModal'
import DeliveryModal1 from './modules/DeliveryModal1'
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
export default { export default {
name: 'DeliveryList', name: 'DeliveryList',
mixins:[JeecgListMixin, mixinDevice], mixins:[JeecgListMixin, mixinDevice],
components: { components: {
DeliveryModal DeliveryModal,
DeliveryModal1
}, },
data () { data () {
return { return {
@ -227,6 +231,11 @@
}, },
}, },
methods: { methods: {
qdck: function (record) {
this.$refs.modalFormqdck.edit(record);
this.$refs.modalFormqdck.title = "确定出库";
this.$refs.modalFormqdck.disableSubmit = false;
},
initDictConfig(){ initDictConfig(){
}, },
getSuperFieldList(){ getSuperFieldList(){

@ -0,0 +1,141 @@
<template>
<a-spin :spinning="confirmLoading">
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="仓库" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="storehouseId">
<j-search-select-tag v-model="model.storehouseId" dict="starehouse,name,id" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="取货人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="carrierId">
<j-select-user-by-dep v-model="model.carrierId" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="管理员" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="adminName">
<j-popup
v-model="model.adminName"
field="adminName"
org-fields="id,realname"
dest-fields="adminId,adminName"
code="findck"
:multi="true"
@input="popupCallback"
/>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</j-form-container>
一旦确定将无法编辑修改
</a-spin>
</template>
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
export default {
name: 'DeliveryForm1',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
}
},
data () {
return {
model:{
itemType :"1",
deliveryReason : "0"
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
storehouseId: [
{ required: true, message: '请输入仓库!'},
],
carrierId: [
{ required: true, message: '请输入取货人!'},
],
adminName: [
{ required: true, message: '请输入管理员!'},
],
},
url: {
add: "/delivery/delivery/add",
edit: "/delivery/delivery/edit1",
queryById: "/delivery/delivery/queryById"
}
}
},
computed: {
formDisabled(){
return this.disabled
},
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add () {
this.edit(this.modelDefault);
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
},
submitForm () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
httpAction(httpurl,this.model,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
})
}
})
},
popupCallback(value,row){
this.model = Object.assign(this.model, row);
},
}
}
</script>

@ -0,0 +1,60 @@
<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
switchFullscreen
@ok="handleOk"
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
cancelText="关闭">
<delivery-form1 ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></delivery-form1>
</j-modal>
</template>
<script>
import DeliveryForm1 from './DeliveryForm1'
export default {
name: 'DeliveryModal1',
components: {
DeliveryForm1
},
data () {
return {
title:'',
width:800,
visible: false,
disableSubmit: false
}
},
methods: {
add () {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.add();
})
},
edit (record) {
this.visible=true
this.$nextTick(()=>{
this.$refs.realForm.edit(record);
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
this.$refs.realForm.submitForm();
},
submitCallback(){
this.$emit('ok');
this.visible = false;
},
handleCancel () {
this.close()
}
}
}
</script>

@ -4,6 +4,7 @@ package org.jeecg.modules.demo.delivery.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.delivery.entity.Delivery; import org.jeecg.modules.demo.delivery.entity.Delivery;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -15,4 +16,14 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface DeliveryMapper extends BaseMapper<Delivery> { public interface DeliveryMapper extends BaseMapper<Delivery> {
@Select("select storehouse_id from storage where item_type=#{s} and item_code=#{fabricNumber} and amount > #{doubleValue}")
String findStorehouseId(String s, double doubleValue, String fabricNumber);
@Select("select user_id from storehouse where id =#{storehouseId}")
String getadminid(String storehouseId);
@Select("select storehouse_id from storage where item_type=#{s} and item_code=#{fabricNumber} and amount > #{doubleValue}")
String findStorehouseId2(String s, double doubleValue, String fabricNumber);
} }

@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@ -34,6 +35,10 @@ import java.util.Optional;
@Service @Service
public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> implements IDeliveryService { public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> implements IDeliveryService {
@Autowired
DeliveryMapper deliveryMapper;
@Autowired @Autowired
private IZyProductPlanService iZyProductPlanService; private IZyProductPlanService iZyProductPlanService;
@ -62,14 +67,28 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
delivery.setDeliveryReason("0"); delivery.setDeliveryReason("0");
delivery.setItemType("0"); delivery.setItemType("0");
delivery.setAmount(e.getAmount().doubleValue()); delivery.setAmount(e.getAmount().doubleValue());
// delivery.setDeliveryTime(new Date()); delivery.setDeliveryTime(new Date());
// delivery.setCarrierId("TODO");
// delivery.setAdminId("TODO");
// delivery.setStorehouseId("TODO");
ZyFabric zyFabric = iZyFabricService.getById(e.getFabricId()); ZyFabric zyFabric = iZyFabricService.getById(e.getFabricId());
if (!ObjectUtils.isEmpty(zyFabric)) { if (!ObjectUtils.isEmpty(zyFabric)) {
delivery.setItemCode(zyFabric.getFabricNumber()); delivery.setItemCode(zyFabric.getFabricNumber());
} }
//取货人
// delivery.setCarrierId("TODO");
//管理员
// delivery.setAdminId("TODO");
//仓库id
// delivery.setStorehouseId("TODO");
/*=====================开始=============================王家东添加*/
/* String StorehouseId = deliveryMapper.findStorehouseId("0",e.getAmount().doubleValue(),zyFabric.getFabricNumber());
if (StorehouseId!=""){
delivery.setStorehouseId(StorehouseId);
String adminid =deliveryMapper.getadminid(StorehouseId);
delivery.setStorehouseId(adminid);
}*/
/*=====================结束=============================王家东添加*/
deliveryList4Fabric.add(delivery); deliveryList4Fabric.add(delivery);
}); });
this.saveBatch(deliveryList4Fabric); this.saveBatch(deliveryList4Fabric);
@ -82,7 +101,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
delivery2.setDeliveryReason("0"); delivery2.setDeliveryReason("0");
delivery2.setItemType("1"); delivery2.setItemType("1");
delivery2.setAmount(e.getAmount().doubleValue()); delivery2.setAmount(e.getAmount().doubleValue());
// delivery2.setDeliveryTime(new Date()); delivery2.setDeliveryTime(new Date());
// delivery2.setCarrierId("TODO"); // delivery2.setCarrierId("TODO");
// delivery2.setAdminId("TODO"); // delivery2.setAdminId("TODO");
// delivery2.setStorehouseId("TODO"); // delivery2.setStorehouseId("TODO");
@ -90,6 +109,15 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
if (!ObjectUtils.isEmpty(zyAccessories)) { if (!ObjectUtils.isEmpty(zyAccessories)) {
delivery2.setItemCode(zyAccessories.getNums()); delivery2.setItemCode(zyAccessories.getNums());
} }
/* String StorehouseId = deliveryMapper.findStorehouseId2("0",e.getAmount().doubleValue(),zyFabric.getFabricNumber());
if (StorehouseId!=""){
delivery2.setStorehouseId(StorehouseId);
String adminid =deliveryMapper.getadminid(StorehouseId);
delivery2.setStorehouseId(adminid);
}*/
deliveryList4accessories.add(delivery2); deliveryList4accessories.add(delivery2);
}); });
this.saveBatch(deliveryList4accessories); this.saveBatch(deliveryList4accessories);

Loading…
Cancel
Save