tianyi@bogon 3 years ago
parent
commit
0357918b73
  1. 146
      pages/billing/addUser.vue
  2. 58
      pages/index/addHangOrder.vue
  3. 4
      pages/index/index.vue
  4. 2
      pages/index/peopleList.vue
  5. 6
      pages/index/uparrears.vue
  6. 5
      pages/index/upstream.vue
  7. 35
      pages/index/waitStorageDetail.vue
  8. 4
      pages/inventory/addinventory.vue
  9. 4
      pages/inventory/changeGoods1.vue

146
pages/billing/addUser.vue

@ -46,7 +46,8 @@
show: false,
delShow: false,
addressObj: {},
type:'',
type:'',
popleType:'',
formData: {
consigneeMobile: '',
consigneeName: '',
@ -106,9 +107,13 @@
this.$refs.form.setRules(this.rules)
},
onLoad(option) {
let data = JSON.parse(option.data)
this.type=option.type
// if(option.data){
// let data = JSON.parse(option.data)
// }
this.popleType = option.popleType
this.type=option.type
console.log(option.popleType)
console.log(option.type)
if (option.type = "edit") {
this.formData.address1 = data.province + data.city + data.area
this.formData.address = data.address
@ -189,48 +194,99 @@
// 触发提交表单
submit() {
let that = this;
this.$refs.form.validate().then(res => {
if (that.type == 'edit') {
res.id = that.userInfo.id
that.tui.request("/app/supplier/edit", "post", this.formData, false,
true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "修改成功",
icon: 'none'
})
uni.navigateBack()
} else {
uni.showToast({
title: "修改失败",
icon: 'none'
})
}
})
} else {
that.tui.request("/app/supplier/save", "post", Object.assign(that.addressObj, res), false,
true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "添加成功",
icon: 'none'
})
let pages =
getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
let prevPage = pages[pages.length - 2]; //上一页页面实例
prevPage.$vm.popleType = 'gysName'
uni.navigateBack({
delta: 1
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
})
this.$refs.form.validate().then(res => {
if(this.popleType == 'khName'){
that.tui.request("/app/customer/save", "post", {
name:this.formData.consigneeName,
phone:this.formData.consigneeMobile,
address:this.formData.address,
province:this.addressObj.province,
city:this.addressObj.city,
area:this.addressObj.area,
userName:this.formData.consigneeMobile
}, false,true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "添加成功",
icon: 'none'
})
let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
let prevPage = pages[pages.length - 2]; //上一页页面实例
prevPage.$vm.popleType = 'khName'
uni.navigateBack({
delta: 1
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
})
}else{
that.tui.request("/app/supplier/save", "post", Object.assign(that.addressObj, res), false,
true).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "添加成功",
icon: 'none'
})
let pages =
getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
let prevPage = pages[pages.length - 2]; //上一页页面实例
prevPage.$vm.popleType = 'gysName'
uni.navigateBack({
delta: 1
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
})
}
// if (that.type == 'edit') {
// res.id = that.userInfo.id
// that.tui.request("/app/supplier/edit", "post", this.formData, false,
// true).then((res) => {
// if (res.code == 200) {
// uni.showToast({
// title: "修改成功",
// icon: 'none'
// })
// uni.navigateBack()
// } else {
// uni.showToast({
// title: "修改失败",
// icon: 'none'
// })
// }
// })
// } else {
// that.tui.request("/app/supplier/save", "post", Object.assign(that.addressObj, res), false,
// true).then((res) => {
// if (res.code == 200) {
// uni.showToast({
// title: "添加成功",
// icon: 'none'
// })
// let pages =
// getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
// let prevPage = pages[pages.length - 2]; //上一页页面实例
// prevPage.$vm.popleType = 'gysName'
// uni.navigateBack({
// delta: 1
// })
// } else {
// uni.showToast({
// title: "添加失败",
// icon: 'none'
// })
// }
// })
// }
}).catch(err => {
console.log('表单错误信息:', err);

58
pages/index/addHangOrder.vue

@ -472,41 +472,33 @@
this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => {
if (res.code == 200) {
this.goodsDetail = res.result;
this.tui.request("/app/productAttribute/selectByCategoryId", "POST", {
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
this.attrList = res1.result;
if (res1.result.length > 0) {
let newArr = []
this.attrList.forEach((items) => {
this.tui.request("/app/productAttributeValue/selectByAttributeId","get", {
id: items.id
}, false, true).then((res2) => {
if (res2.code == 200) {
let valueObj = [];
for (var i = 0; i < res2.result.length; i++) {
valueObj.push({
value: res2.result[i].value,
isChecked: false
})
}
newArr.push({
name: items.attributeName,
value: valueObj
})
this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
})
} else {
this.tui.toast(res.message)
}
console.log(this.goodsDetail)
}).catch((res) => {})
})
}
if (res1.code == 200) {
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
let newArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
}
newArr.push({
name: val,
value: valueObj
})
}
this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
})
}
} else {
this.tui.toast(res.message)
}

4
pages/index/index.vue

@ -20,7 +20,7 @@
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/shareStyle')">
<text>推款</text>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/waitStorageDetail')">
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/waitStorage?inStorageStatus=0')">
<text>待入库</text>
</view>
</view>
@ -106,7 +106,7 @@
arrow-direction="left"></u-cell>
<u-cell icon="integral-fill" url="/pages/index/downstream" title="客户欠款" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="integral-fill" url="/pages/index/order?type=ruku" title="采购单历史" clickable isLink
<u-cell icon="integral-fill" url="/pages/index/waitStorage" title="采购单历史" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="integral-fill" url="/pages/index/order?type=dingdan" title="销售单历史" clickable isLink
arrow-direction="left"></u-cell>

2
pages/index/peopleList.vue

@ -173,7 +173,7 @@
goAddPeople(type,data){
this.modelShow = true;
uni.navigateTo({
url: "/pages/billing/addUser?type="+type+'&data='+JSON.stringify(data)
url: "/pages/billing/addUser?type="+type+'&data='+JSON.stringify(data) + '&popleType=' + this.popleType
})
},
//打开弹出层

6
pages/index/uparrears.vue

@ -48,11 +48,13 @@
// this.status = 'loading';
// this.page = ++this.page;
// this.getList();
// },
// },
onShow(){
this.getList()
},
onLoad(options) {
this.supplierId = options.supplierId
this.consigneeName = options.consigneeName
this.getList()
},
methods: {
getList() {

5
pages/index/upstream.vue

@ -37,9 +37,12 @@
shopName: '',
list: []
}
},
onShow(){
this.getList()
},
onLoad() {
this.getList()
},
methods: {
getList() {

35
pages/index/waitStorageDetail.vue

@ -64,7 +64,7 @@
</view>
<view class="tui-tabbar">
<view class="tui-btn-mr">
<u-button type="error" :plain="true" shape="circle" @click="cancelOrder">确认提交</u-button>
<u-button type="error" :plain="true" shape="circle" @click="inventorySubmit">确认提交</u-button>
</view>
</view>
<!-- 弹出输入框 -->
@ -86,7 +86,8 @@
noPay:0,
alreadyPay:0,
otherPay:0,
remark:'',
remark:'',
id:''
}
},
filters: {
@ -101,7 +102,8 @@
return name;
}
},
onLoad(option) {
onLoad(option) {
this.id = option.id
this.getWaitStorage(option.id)
},
methods: {
@ -132,6 +134,7 @@
}
let that = this;
let purchase = {
id:this.id,
alreadyPay: this.alreadyPay, //已付金额
noPay: this.noPay, //欠款
shouldPay: this.shouldPay, //应付金额
@ -140,20 +143,20 @@
supplierId: this.sales.supplierId, //供应商id和姓名
supplierName: this.sales.supplierName
}
let purchaseDetails = [];
this.carList.forEach(function(value, key) {
value.stockLogList.forEach(function(values, keys) {
let obj = {
productCount: values,
attributeList: keys
}
value.stockLogList1.push(obj)
})
purchaseDetails.push(value)
})
this.tui.request("/app/stock/putInOfProduct", "post", {
// let purchaseDetails = [];
// this.goodsList.forEach(function(value, key) {
// value.stockLogList.forEach(function(values, keys) {
// let obj = {
// productCount: values,
// attributeList: keys
// }
// value.stockLogList1.push(obj)
// })
// purchaseDetails.push(value)
// })
this.tui.request("/app/stock/putInPrice", "post", {
purchase: purchase,
purchaseDetails: purchaseDetails
purchaseDetails: this.goodsList
}, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({

4
pages/inventory/addinventory.vue

@ -151,7 +151,7 @@
if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < this.carList1.length; i++) {
let obj = {
purchasePrice: this.carList1[i].price, //进货价
purchasePrice: "", //进货价
price: 0,
productCount: this.carList1[i].num,
productId: this.carList1[i].id,
@ -185,7 +185,7 @@
}
} else { //商品不同
let obj = {
purchasePrice: this.carList1[i].price, //进货价
purchasePrice: "", //进货价
price: 0,
productCount: this.carList1[i].num,
productId: this.carList1[i].id,

4
pages/inventory/changeGoods1.vue

@ -177,7 +177,7 @@
keyList: [],
evalue: [],
attributeList: [],
purchasePrice: 0,
purchasePrice: "",
zPrice:0,
zNum:0,
storageType:0,
@ -422,7 +422,7 @@
this.carList.push(data)
console.log(this.carList)
this.temporaryList = []
this.purchasePrice = 0
this.purchasePrice = ""
this.zPrice = ''
this.zNum = ''
for(let i=0;i<this.goodsDetail.attributeList.length;i++){

Loading…
Cancel
Save