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, show: false,
delShow: false, delShow: false,
addressObj: {}, addressObj: {},
type:'', type:'',
popleType:'',
formData: { formData: {
consigneeMobile: '', consigneeMobile: '',
consigneeName: '', consigneeName: '',
@ -106,9 +107,13 @@
this.$refs.form.setRules(this.rules) this.$refs.form.setRules(this.rules)
}, },
onLoad(option) { onLoad(option) {
let data = JSON.parse(option.data) // if(option.data){
// let data = JSON.parse(option.data)
this.type=option.type // }
this.popleType = option.popleType
this.type=option.type
console.log(option.popleType)
console.log(option.type)
if (option.type = "edit") { if (option.type = "edit") {
this.formData.address1 = data.province + data.city + data.area this.formData.address1 = data.province + data.city + data.area
this.formData.address = data.address this.formData.address = data.address
@ -189,48 +194,99 @@
// 触发提交表单 // 触发提交表单
submit() { submit() {
let that = this; let that = this;
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
if (that.type == 'edit') { if(this.popleType == 'khName'){
that.tui.request("/app/customer/save", "post", {
res.id = that.userInfo.id name:this.formData.consigneeName,
that.tui.request("/app/supplier/edit", "post", this.formData, false, phone:this.formData.consigneeMobile,
true).then((res) => { address:this.formData.address,
if (res.code == 200) { province:this.addressObj.province,
uni.showToast({ city:this.addressObj.city,
title: "修改成功", area:this.addressObj.area,
icon: 'none' userName:this.formData.consigneeMobile
}) }, false,true).then((res) => {
uni.navigateBack() if (res.code == 200) {
} else { uni.showToast({
uni.showToast({ title: "添加成功",
title: "修改失败", icon: 'none'
icon: 'none' })
}) let pages = getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。
} let prevPage = pages[pages.length - 2]; //上一页页面实例
}) prevPage.$vm.popleType = 'khName'
} else { uni.navigateBack({
that.tui.request("/app/supplier/save", "post", Object.assign(that.addressObj, res), false, delta: 1
true).then((res) => { })
if (res.code == 200) { } else {
uni.showToast({ uni.showToast({
title: "添加成功", title: "添加失败",
icon: 'none' icon: 'none'
}) })
let pages = }
getCurrentPages(); // 获取当前页面栈的实例,以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。 })
let prevPage = pages[pages.length - 2]; //上一页页面实例 }else{
prevPage.$vm.popleType = 'gysName' that.tui.request("/app/supplier/save", "post", Object.assign(that.addressObj, res), false,
uni.navigateBack({ true).then((res) => {
delta: 1 if (res.code == 200) {
}) uni.showToast({
} else { title: "添加成功",
uni.showToast({ icon: 'none'
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 => { }).catch(err => {
console.log('表单错误信息:', 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) => { this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.goodsDetail = res.result; this.goodsDetail = res.result;
this.tui.request("/app/productAttribute/selectByCategoryId", "POST", { this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => { }, false, true).then((res1) => {
if (res1.code == 200) { if (res1.code == 200) {
this.attrList = res1.result; if (typeof(res1.result) == 'string') {
if (res1.result.length > 0) { let newObj = JSON.parse(res1.result)
let newArr = [] let newArr = []
this.attrList.forEach((items) => { for (let val in newObj) {
this.tui.request("/app/productAttributeValue/selectByAttributeId","get", { let valueObj = [];
id: items.id for (var i = 0; i < newObj[val].length; i++) {
}, false, true).then((res2) => { valueObj.push({
if (res2.code == 200) { value: newObj[val][i],
let valueObj = []; isChecked: false
for (var i = 0; i < res2.result.length; i++) { })
valueObj.push({ }
value: res2.result[i].value, newArr.push({
isChecked: false name: val,
}) value: valueObj
} })
newArr.push({ }
name: items.attributeName, this.goodsDetail.attributeList = newArr;
value: valueObj this.goodsDetail.attributeList.forEach((item, index) => {
}) this.columns[index] = item.value;
this.goodsDetail.attributeList = newArr; this.keyList[index] = item.name;
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) => {})
})
}
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
} }

4
pages/index/index.vue

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

2
pages/index/peopleList.vue

@ -173,7 +173,7 @@
goAddPeople(type,data){ goAddPeople(type,data){
this.modelShow = true; this.modelShow = true;
uni.navigateTo({ 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.status = 'loading';
// this.page = ++this.page; // this.page = ++this.page;
// this.getList(); // this.getList();
// }, // },
onShow(){
this.getList()
},
onLoad(options) { onLoad(options) {
this.supplierId = options.supplierId this.supplierId = options.supplierId
this.consigneeName = options.consigneeName this.consigneeName = options.consigneeName
this.getList()
}, },
methods: { methods: {
getList() { getList() {

5
pages/index/upstream.vue

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

35
pages/index/waitStorageDetail.vue

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

4
pages/inventory/addinventory.vue

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

4
pages/inventory/changeGoods1.vue

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

Loading…
Cancel
Save