Browse Source

完善问题

master
djz236@163.com 2 years ago
parent
commit
225031f462
  1. 5
      warehousing-system/project/wh-common/src/main/java/com/wh/pojo/Location.java
  2. 4
      warehousing-system/project/wh-common/src/main/java/com/wh/pojo/Product.java
  3. 4
      warehousing-system/project/wh-common/src/main/java/com/wh/pojo/Supplier.java
  4. 2
      warehousing-system/project/wh-common/src/main/java/com/wh/pojo/purchasenew/PurchasenewVo.java
  5. 1
      warehousing-system/project/wh-manage/src/main/java/com/wh/service/purchasenew/PurchasenewService.java
  6. 4
      warehousing-system/project_web/src/components/initial_value/supplier.vue
  7. 415
      warehousing-system/project_web_ui/src/views/component/initial_value/add/productAdd.vue
  8. 10
      warehousing-system/project_web_ui/src/views/component/initial_value/supplier.vue
  9. 16
      warehousing-system/project_web_ui/src/views/component/instorehouse/purchase.vue

5
warehousing-system/project/wh-common/src/main/java/com/wh/pojo/Location.java

@ -1,5 +1,6 @@
package com.wh.pojo; package com.wh.pojo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@ -9,8 +10,10 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("location") @TableName("location")
public class Location { public class Location {
private String name; //货位名称 private String name; //货位名称
@TableId("location_id") @TableId(type = IdType.AUTO)
private int id;
private String locationId; //货位编号 private String locationId; //货位编号
private String type; //货位类型 private String type; //货位类型
private String status; //货位状态 private String status; //货位状态

4
warehousing-system/project/wh-common/src/main/java/com/wh/pojo/Product.java

@ -1,5 +1,6 @@
package com.wh.pojo; package com.wh.pojo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@ -11,7 +12,8 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@ToString @ToString
public class Product { public class Product {
@TableId("bar_code") @TableId(type = IdType.AUTO)
private int id;
private String barCode; //条码 private String barCode; //条码
private String name; //商品名 private String name; //商品名
private String anotherName; //别名 private String anotherName; //别名

4
warehousing-system/project/wh-common/src/main/java/com/wh/pojo/Supplier.java

@ -1,5 +1,6 @@
package com.wh.pojo; package com.wh.pojo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@ -9,7 +10,8 @@ import lombok.experimental.Accessors;
@Accessors(chain = true) @Accessors(chain = true)
@TableName("supplier") @TableName("supplier")
public class Supplier { public class Supplier {
@TableId("name") @TableId(type = IdType.AUTO)
private int id;
private String name; //供应商名称 private String name; //供应商名称
private String contacts; //联系人 private String contacts; //联系人
private String number; //电话 private String number; //电话

2
warehousing-system/project/wh-common/src/main/java/com/wh/pojo/purchasenew/PurchasenewVo.java

@ -71,6 +71,6 @@ public class PurchasenewVo implements Vo {
@ApiModelProperty("仓库id") @ApiModelProperty("仓库id")
private String storehouseId; // 仓库id private String storehouseId; // 仓库id
@ApiModelProperty("状态") @ApiModelProperty("状态")
private String status; // 状态 private String state; // 状态
} }

1
warehousing-system/project/wh-manage/src/main/java/com/wh/service/purchasenew/PurchasenewService.java

@ -180,6 +180,7 @@ public class PurchasenewService extends MybatisBaseService<PurchasenewMapper, Pu
public void updateStateToInputBySid(String purchaseSid) { public void updateStateToInputBySid(String purchaseSid) {
Purchasenew purchasenew = fetchBySid(purchaseSid); Purchasenew purchasenew = fetchBySid(purchaseSid);
purchasenew.setState(2); purchasenew.setState(2);
purchasenew.setModifyTime(new Date());
baseMapper.updateById(purchasenew); baseMapper.updateById(purchasenew);
} }
} }

4
warehousing-system/project_web/src/components/initial_value/supplier.vue

@ -26,11 +26,11 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="contacts" prop="contacts"
label="供应商简称"> label="联系人">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="number" prop="number"
label="供应商地址"> label="电话">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="remarks" prop="remarks"

415
warehousing-system/project_web_ui/src/views/component/initial_value/add/productAdd.vue

@ -1,208 +1,207 @@
<template> <template>
<div> <div>
<div class="tab-header webtop"> <div class="tab-header webtop">
<!-- 标题 --> <!-- 标题 -->
<div>{{ viewTitle }}</div> <div>{{ viewTitle }}</div>
<!-- start 添加修改按钮 --> <!-- start 添加修改按钮 -->
<div> <div>
<el-button type="primary" size="small" @click="saveOrUpdate">保存</el-button> <el-button type="primary" size="small" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> <el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div> </div>
<!-- end 添加修改按钮 --> <!-- end 添加修改按钮 -->
<!-- end 详情按钮 --> <!-- end 详情按钮 -->
</div> </div>
<div class="listconadd"> <div class="listconadd">
<el-card class="box-card"> <el-card class="box-card">
<div class="item"> <div class="item">
<span class="item_text">条码</span> <span class="item_text">条码</span>
<el-input v-model="locationForm.barCode" :disabled="disabledCode" placeholder="" class="item_inputs" clearable /> <el-input v-model="locationForm.barCode" :disabled="disabledCode" placeholder="" class="item_inputs" clearable />
<el-button type="primary" size="small" @click="createBarCode" :disabled="disabledCode">自动</el-button> <el-button type="primary" size="small" @click="createBarCode" :disabled="disabledCode">自动</el-button>
</div> </div>
<div class="item"> <div class="item">
<span class="item_text">商品名</span> <span class="item_text">商品名</span>
<el-input v-model="locationForm.name" :disabled="disabledCode" placeholder="" class="item_input" clearable /> <el-input v-model="locationForm.name" :disabled="disabledCode" placeholder="" class="item_input" clearable />
</div> </div>
<div class="item"> <div class="item">
<span class="item_text">别名</span> <span class="item_text">别名</span>
<el-input v-model="locationForm.anotherName" class="item_input" clearable></el-input> <el-input v-model="locationForm.anotherName" class="item_input" clearable></el-input>
</div> </div>
<div class="item"> <div class="item">
<span class="item_text">价值</span> <span class="item_text">价值</span>
<el-input v-model="locationForm.value" class="item_input" clearable></el-input> <el-input v-model="locationForm.value" class="item_input" clearable></el-input>
</div> </div>
<div class="item"> <div class="item">
<span class="item_text">净重</span> <span class="item_text">净重</span>
<el-input v-model="locationForm.netWeight" class="item_input" clearable></el-input> <el-input v-model="locationForm.netWeight" class="item_input" clearable></el-input>
</div> </div>
<div class="item"> <div class="item">
<span class="item_text">毛重</span> <span class="item_text">毛重</span>
<el-input v-model="locationForm.roughWeight" class="item_input" clearable></el-input> <el-input v-model="locationForm.roughWeight" class="item_input" clearable></el-input>
</div> </div>
<div class="item"> <div class="item">
<span class="item_text">有效天数</span> <span class="item_text">有效天数</span>
<el-input v-model="locationForm.effectiveDays" class="item_input" clearable></el-input> <el-input v-model="locationForm.effectiveDays" class="item_input" clearable></el-input>
</div> </div>
<div class="item"> <div class="item">
<span class="item_text">备注</span> <span class="item_text">备注</span>
<el-input v-model="locationForm.remarks" class="item_input" clearable></el-input> <el-input v-model="locationForm.remarks" class="item_input" clearable></el-input>
</div> </div>
</el-card> </el-card>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
submitdisabled: false, submitdisabled: false,
disabledCode: false, disabledCode: false,
locationForm: { locationForm: {
barCode: "", barCode: "",
name: "", name: "",
anotherName: "", anotherName: "",
value: "", value: "",
netWeight: "", netWeight: "",
roughWeight: "", roughWeight: "",
effectiveDays: "", effectiveDays: "",
remarks: "", remarks: "",
}, },
viewTitle: "【新增】产品信息", viewTitle: "【新增】产品信息",
} }
}, },
created() { created() {
}, },
methods: { methods: {
saveOrUpdate() { saveOrUpdate() {
if (this.viewTitle === "【新增】产品信息") return this.addProduct() if (this.viewTitle === "【新增】产品信息") return this.addProduct()
if (this.viewTitle === "【修改】产品信息") { if (this.viewTitle === "【修改】产品信息") {
this.updataProduct() this.updataProduct()
} }
}, },
handleReturn(isreload) { handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist') if (isreload === 'true') this.$emit('reloadlist')
this.clearList() this.clearList()
this.$emit('doback') this.$emit('doback')
}, },
showAdd() { showAdd() {
this.viewTitle = "【新增】产品信息"; this.viewTitle = "【新增】产品信息";
this.disabledCode=false this.disabledCode=false
this.clearList() this.clearList()
}, },
clearList(){ clearList(){
this.locationForm = { this.locationForm = {
barCode: "", barCode: "",
name: "", name: "",
anotherName: "", anotherName: "",
value: "", value: "",
netWeight: "", netWeight: "",
roughWeight: "", roughWeight: "",
effectiveDays: "", effectiveDays: "",
remarks: "", remarks: "",
} }
}, },
showEdit(row) { showEdit(row) {
this.viewTitle = "【修改】产品信息"; this.viewTitle = "【修改】产品信息";
this.disabledCode=true this.disabledCode=true
this.locationForm=row this.locationForm=row
}, },
async updataProduct () { async updataProduct () {
this.locationForm = { this.locationForm = {
name: "", name: "",
anotherName: "", anotherName: "",
} }
const { data: result } = await this.$http.put('/product/updataProduct', this.locationForm) const { data: result } = await this.$http.put('/product/updataProduct', this.locationForm)
if (result.status !== 200) return this.$message.error('更新数据失败') if (result.status !== 200) return this.$message.error('更新数据失败')
this.$message.success('更新成功') this.$message.success('更新成功')
this.handleReturn('true') this.handleReturn('true')
}, },
async addProduct () { async addProduct () {
const { data: result } = await this.$http.post('/product/addProduct', this.addProductForm) const { data: result } = await this.$http.post('/product/addProduct', this.locationForm)
if (result.status !== 200) return this.$message.error('添加产品失败') if (result.status !== 200) return this.$message.error('添加产品失败')
this.$message.success('添加产品成功') this.$message.success('添加产品成功')
this.handleReturn('true') this.handleReturn('true')
}, },
createBarCode () { createBarCode () {
var now = new Date() var now = new Date()
var nowstr = now.getTime() var nowstr = now.getTime()
this.locationForm.barCode = 'P' + now.getTime() this.locationForm.barCode = 'P' + now.getTime()
}, },
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.box-card { .box-card {
margin-left: 60px; margin-left: 60px;
margin-right: 60px; margin-right: 60px;
min-width: 70%; min-width: 70%;
margin-top: 20px; margin-top: 20px;
.item { .item {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
margin-top: 15px; margin-top: 15px;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
.item_text { .item_text {
flex: 0.8; flex: 0.8;
font-size: 18px; font-size: 18px;
text-align: right; text-align: right;
} }
.item_input { .item_input {
flex: 4; flex: 4;
font-size: 16px; font-size: 16px;
margin-left: 10px; margin-left: 10px;
margin-right: 80px; margin-right: 80px;
} }
.item_inputs { .item_inputs {
flex: 4; flex: 4;
font-size: 16px; font-size: 16px;
margin-left: 10px; margin-left: 10px;
margin-right: 28px; margin-right: 28px;
} }
.item_left_input { .item_left_input {
width: 20%; width: 20%;
} }
.item_left_text { .item_left_text {
height: 30px; height: 30px;
margin-left: 20px; margin-left: 20px;
line-height: 30px; line-height: 30px;
color: #018AD2; color: #018AD2;
padding: 0px 15px; padding: 0px 15px;
border: 1.5px solid #018AD2; border: 1.5px solid #018AD2;
border-radius: 5px; border-radius: 5px;
} }
.item_right { .item_right {
flex: 1; flex: 1;
justify-items: center; justify-items: center;
.item_right_list_text { .item_right_list_text {
font-size: 16px; font-size: 16px;
} }
.item_right_list_delect { .item_right_list_delect {
color: #5E94FF; color: #5E94FF;
margin-left: 20px; margin-left: 20px;
font-size: 16px; font-size: 16px;
text-decoration: underline; text-decoration: underline;
} }
} }
} }
} }
</style> </style>

10
warehousing-system/project_web_ui/src/views/component/initial_value/supplier.vue

@ -32,11 +32,11 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="contacts" prop="contacts"
label="供应商简称"> label="联系人">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="number" prop="number"
label="供应商地址"> label="电话">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="remarks" prop="remarks"
@ -196,10 +196,10 @@ export default {
type: 'warning' type: 'warning'
}).catch(error => error) }).catch(error => error)
if (result !== 'confirm') return this.$message.info('用户取消操作') if (result !== 'confirm') return this.$message.info('用户取消操作')
const { data: resultDB } = await this.$http.delete(`/supplier/delete/${supplier.name}`) const { data: resultDB } = await this.$http.delete(`/supplier/delete/${supplier.id}`)
if (resultDB.status !== 200) return this.$message.error('删除商失败') if (resultDB.status !== 200) return this.$message.error('删除供应商失败')
this.getSupplierList() this.getSupplierList()
this.$message.success('商删除成功') this.$message.success('供应商删除成功')
}, },
toAdd() { toAdd() {
this.viewState = 2 this.viewState = 2

16
warehousing-system/project_web_ui/src/views/component/instorehouse/purchase.vue

@ -59,7 +59,7 @@
width="180"> width="180">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="status" prop="state"
label="状态" label="状态"
align="center" align="center"
width="180"> width="180">
@ -118,7 +118,7 @@ export default {
size: 10, size: 10,
params: { params: {
purchaseNo:'' purchaseNo:''
} }
}, },
btnList: [ btnList: [
{ {
@ -150,7 +150,7 @@ export default {
supplierName:'', supplierName:'',
count: '', count: '',
storehouse: '', storehouse: '',
status: '', state: '',
products:[] products:[]
}, },
pirce:'', pirce:'',
@ -182,7 +182,7 @@ export default {
size: 10, size: 10,
params: { params: {
purchaseNo:'' purchaseNo:''
} }
}, },
this.getPurchaseList() this.getPurchaseList()
}, },
@ -194,10 +194,14 @@ export default {
}, },
async getPurchaseList () { async getPurchaseList () {
const { data: result } = await this.$http.post('/purchasenew/listPage', this.queryInfo) const { data: result } = await this.$http.post('/purchasenew/listPage', this.queryInfo)
console.log(result);
if (result.code == 200){ if (result.code == 200){
console.log(result);
this.queryInfo.total=result.data.total this.queryInfo.total=result.data.total
this.purchaseList = result.data.records this.purchaseList = result.data.records
} }
console.log(this.purchaseList);
}, },
clearList(){ clearList(){
this.purchaseForm={ this.purchaseForm={
@ -211,9 +215,9 @@ export default {
supplierName:'', supplierName:'',
count: '', count: '',
storehouse: '', storehouse: '',
status: '', state: '',
products:[] products:[]
} }
}, },
async deletePurchase (purchase) { async deletePurchase (purchase) {

Loading…
Cancel
Save