From ce7854d8548439e94f1b8ae4e8169e3564f54dd2 Mon Sep 17 00:00:00 2001
From: fengdong777 <1478994744@qq.com>
Date: Wed, 21 Jun 2023 17:53:34 +0800
Subject: [PATCH] =?UTF-8?q?6.21=20=E4=BB=93=E5=BA=93=E9=9B=86=E6=8E=A7?=
=?UTF-8?q?=E7=9A=84=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/initial_value/storehouse.vue | 245 +++++++++++++-----
.../src/components/instorehouse/purchase.vue | 149 +++++------
.../project_web/src/plugins/element.js | 4 +-
3 files changed, 237 insertions(+), 161 deletions(-)
diff --git a/warehousing-system/project_web/src/components/initial_value/storehouse.vue b/warehousing-system/project_web/src/components/initial_value/storehouse.vue
index 375ce091..df105572 100644
--- a/warehousing-system/project_web/src/components/initial_value/storehouse.vue
+++ b/warehousing-system/project_web/src/components/initial_value/storehouse.vue
@@ -11,7 +11,7 @@
新增
-
-
+
- *仓库名称:
+ *客户名称:
-
-
+
+
+
+
+
+
+
+
+ *仓库名称:
+
+
+
+
+
+
+
+
+
*仓库简称:
-
-
+
+
*仓库编码:
-
+
@@ -90,18 +114,18 @@
*所属地:
-
-
+
+
-
-
+
+
-
-
+
+
@@ -109,68 +133,86 @@
- *库房面积:
+ *详细地址:
-
+
+
+
+ *库房面积:
+
+
+
*库房高度:
-
+
*月租金:
-
+
- *库房性质编码:
+ *库房性质名称:
-
-
-
-
-
-
+
+
+
-
+
*房源:
-
-
+
+
-
-
-
+
*联系人姓名:
-
-
+
+
-
+
*联系人电话:
-
+
+
-
+
+
*附件:
-
+
+
+ 点击上传
+
+
@@ -189,15 +231,25 @@ export default {
data () {
return {
queryInfo: {
- query: '',
- pageNum: 1,
- pageSize: 10
+ total: 0,
+ size: 1,
+ current: 10,
+ params:{
+
+ }
},
total: 0,
changeCity: true,
changeCounty: true,
storehouseList: [],
+ storehouseListss: [],
+ storeList: [],
+ provinceList: [],
+ cityList: [],
+ countyList: [],
+ updateAction: 'http://8.130.39.13:9050/v1/shstorehouse/upload',
storehouseDialogVisible: false,
+ // myHeaders: { Access-Control-Allow-Origin},
title: '新增仓库',
storehouseForm: {
name: '',
@@ -217,17 +269,26 @@ export default {
]
},
tableData:[],
+ fileList: [],
totalPrice:0,
form:{
- name:"",
- region1:'',
- region2:'',
- region3:'',
- xxarrive:'',
- tel:'',
- provinceList:[],
- cityList:[],
- countyList:[]
+ name:'',
+ custerName:"",
+ provinceName:'',
+ cityName:'',
+ simpleName:'',
+ code:'',
+ countyName:'',
+ address:'',
+ acreage:'',
+ storeyHeight:'',
+ monthlyPrice:'',
+ attributeNames:'',
+ attributeCodes:'',
+ housingResource:'',
+ linkerName:'',
+ linkerPhone:'',
+ picUrl:''
},
CITY:[],
XIAN:[],
@@ -237,15 +298,15 @@ export default {
},
methods: {
handleSizeChange (val) {
- this.queryInfo.pageSize = val
+ this.queryInfo.size = val
this.getStorehouseList()
},
handleCurrentChange (val) {
- this.queryInfo.pageNum = val
+ this.queryInfo.current = val
this.getStorehouseList()
},
async getStorehouseList () {
- const { data: result } = await this.$http.get('/storehouse/list', { params: this.queryInfo })
+ const { data: result } = await this.$http.get('/v1/shstorehouse/listPage', { params: this.queryInfo },)
if (result.status !== 200) return this.$message.error('获取列表失败')
this.total = result.data.total
@@ -255,6 +316,24 @@ export default {
this.title = '新增仓库'
this.storehouseDialogVisible = true
},
+ async getStorehouseLists () {
+ const { data: result } = await this.$http.get('/purchase/getStorehouse')
+ if (result.status !== 200) return this.$message.error('获取仓库列表失败')
+ this.storehouseLists = result.data
+ this.storehouseListss = result.data
+ for (var i = 0; i < this.storehouseLists.length; i++) {
+
+ let item = {
+ name: this.storehouseLists[i].name,
+ }
+ this.storeList.push(item)
+ }
+ },
+ getSupplier(value) {
+ const choose = this.storehouseLists.filter((item) => item.name === value)
+ this.form.simpleName = choose[0].simpleName
+ this.form.code = choose[0].addr
+ },
updataStorehousedialog (storehouse) {
this.storehouseForm.name = storehouse.name
this.storehouseForm.simpleName = storehouse.simpleName
@@ -263,14 +342,12 @@ export default {
this.title = '修改仓库'
this.storehouseDialogVisible = true
},
- addStorehouse () {
- this.$refs.storehouseRuleForm.validate(async valid => {
- const { data: result } = await this.$http.post('/storehouse/addStorehouse', this.storehouseForm)
- if (result.status !== 200) return this.$message.error('添加仓库失败')
+ async addStorehouse () {
+ const { data: result } = await this.$http.post('/v1/shstorehouse/save', this.form)
+ if (result.code !== 200) return this.$message.error('添加仓库失败')
this.$message.success('成功添加仓库')
this.getStorehouseList()
this.storehouseDialogVisible = false
- })
},
async updataStorehouse () {
const { data: result } = await this.$http.put('/storehouse/updataStorehouse', this.storehouseForm)
@@ -307,10 +384,10 @@ export default {
subdistrict:3 // 要获取的行政区划的级别:省、市、县三级
}
}).then((res)=>{
- this.form.provinceList = res.data.districts[0].districts /* 省*/
+ this.provinceList = res.data.districts[0].districts /* 省*/
/* 进行遍历赋值*/
/* 市区和县区*/
- let newProvince = this.form.provinceList
+ let newProvince = this.provinceList
for(let i = 0; i < newProvince.length; i++){ /* 省级*/
for(let j = 0; j < newProvince[i].districts.length; j++){ /* 市级*/
let city = newProvince[i].districts[j].name
@@ -324,58 +401,82 @@ export default {
for(let m = 0; m < newProvince.length;m++){
newProvince[m] = {...newProvince[m],...{code:m+1}}
}
- this.form.provinceList = newProvince
+ this.provinceList = newProvince
})
},
provinceChange(that){
// 根据选中省,匹配市
- this.form.region2=''
- this.form.region3=''
- if(this.form.region2==='' || this.form.region3===''){
+ this.form.cityName=''
+ this.form.countyName=''
+ if(this.form.cityName==='' || this.form.countyName===''){
this.changeCounty=true
}
let cityCode = 0
let newCityArry = []
- this.form.provinceList.forEach((item,index)=>{
+ this.provinceList.forEach((item,index)=>{
if(item.name == that){
cityCode = item.code
}
})
// console.log(cityCode)
if(cityCode){
- this.form.cityList = []
+ this.cityList = []
this.CITY.forEach((item,index)=>{
if(item.code == cityCode){
- this.form.cityList.push(item)
+ this.cityList.push(item)
this.changeCity=false
}
}) /* 市匹配成功*/
}
},
cityChange(that){
- this.form.region3=''
+ this.form.countyName=''
let countyCode = 0
let cityname = ''
let newCountyArry = []
- this.form.cityList.forEach((item,index)=>{
+ this.cityList.forEach((item,index)=>{
if(item.name == that){
countyCode = item.id
cityname = item.name
}
})
if(countyCode){
- this.form.countyList = []
+ this.countyList = []
this.XIAN.forEach((item,index)=>{
if(item.code == countyCode && item.cityCountyName == cityname){
- this.form.countyList.push(item)
+ this.countyList.push(item)
this.changeCounty=false
}
})
}
},
+ handleSuccess(resp, file, fileList) {
+ this.fileList = []
+ if (resp.success) {
+ this.$message({
+ showClose: true,
+ type: 'success',
+ message: '导入成功'
+ })
+ } else {
+ this.$message({
+ showClose: true,
+ type: 'error',
+ message: resp.msg
+ })
+ }
+ },
+ handleProgress(event, file, fileList) {
+
+ },
+ beforeRemove(file, fileList) {
+ return this.$confirm(`确定移除 ${ file.name }?`);
+ }
},
mounted () {
this.getStorehouseList()
+ this.getStorehouseLists()
+ // this.getStoreList()
this.getMap()
},
}
diff --git a/warehousing-system/project_web/src/components/instorehouse/purchase.vue b/warehousing-system/project_web/src/components/instorehouse/purchase.vue
index e2945f5d..8b4aa0ce 100644
--- a/warehousing-system/project_web/src/components/instorehouse/purchase.vue
+++ b/warehousing-system/project_web/src/components/instorehouse/purchase.vue
@@ -3,14 +3,12 @@
-
+
新增
- 审核
- 撤销审核
-
-
+ height="500">
+
-
-
@@ -147,7 +94,8 @@
-
+
@@ -235,7 +183,7 @@
-
+
@@ -275,19 +223,19 @@
-
+
-
+
-
+
-
+
-
+
@@ -356,7 +304,7 @@ export default {
current: 1,
size: 10,
params: {
-
+ purchaseNo:''
}
},
total: 0,
@@ -402,7 +350,6 @@ export default {
}
},
created(){
- this.heji()
},
methods: {
handleSizeChange (val) {
@@ -414,7 +361,12 @@ export default {
this.queryInfo.current = val
this.getPurchaseList()
},
-
+ // 序号
+ indexMethod(index) {
+ var pagestart = (this.queryInfo.current - 1) * this.queryInfo.size
+ var pageindex = index + 1 + pagestart
+ return pageindex
+ },
async getPurchaseList () {
const { data: result } = await this.$http.post('/purchasenew/listPage', { params: this.queryInfo })
if (result.code == 200){
@@ -465,6 +417,7 @@ export default {
this.purchaseForm.purchaseNo = 'IP' + now.getTime()
console.log('IP' + now.getTime())
if (this.productList2.length == 0) this.productList2 = this.productList
+ this.add()
},
async getSupplierList () {
@@ -488,17 +441,18 @@ export default {
},
async deletePurchase (purchase) {
- if (purchase.status !== '待审核') return this.$message.error('订单' + purchase.purchaseNo + '进行中')
+ const sids = []
+ sids.push(purchase.sid)
const result = await this.$confirm('此操作将永久删除订单' + purchase.purchaseNo + ', 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).catch(error => error)
if (result !== 'confirm') return this.$message.info('用户取消操作')
- const { data: resultDB } = await this.$http.delete(`/purchase/delete/${purchase.purchaseNo}`)
- if (resultDB.status !== 200) return this.$message.error('删除订单失败')
- this.getPurchaseList()
+ const { data: resultDB } = await this.$http.post('/purchasenew/delBySids', sids)
+ if (resultDB.code == 200)
this.$message.success('订单删除成功')
+ this.getPurchaseList()
},
async open (purchase) {
@@ -507,15 +461,8 @@ export default {
const _this = this
const { data: result } = await this.$http.get(`/purchasenew/fetchDetailsBySid/${purchase.sid}`)
if (result.code==200) {
- // _this.purchaseForm.purchaseDate=result.data.purchaseDate
- // _this.purchaseForm.purchaseNo=result.data.purchaseNo
- // _this.purchaseForm.supplierName=result.data.supplierName
- // _this.purchaseForm.purchasePerson=result.data.purchasePerson
- // _this.purchaseForm.custName=result.data.custName
- // _this.purchaseForm.storehouseName=result.data.storehouseName
_this.purchaseForm=result.data
}
- // if (this.productList2.length == 0) this.productList2 = this.productList
},
checkUpdataPurchase () {
this.$refs.updataPurchaseRuleForm.validate(validate => {
@@ -588,18 +535,44 @@ export default {
this.purchaseForm.products.splice(index, 1);
})
},
- getList(value){
- this.pirce=value
- console.log(this.pirce);
- },
- getLists(value){
- this.num=value
- },
- heji(){
- if(this.pirce && this.num){
- console.log(666);
+ getLists(){
+ let arrList=this.purchaseForm.products
+ for(let i=0;i