wangfukang 3 years ago
parent
commit
1a88ea9b43
  1. 11
      pages/billing/changeGoods1.vue
  2. 14
      pages/index/downStearmList.vue
  3. 3
      pages/index/order.vue
  4. 6
      pages/index/orderDetail.vue
  5. 9
      pages/index/shareStyle.vue
  6. 33
      pages/index/waitStorageDetail.vue
  7. 11
      pages/inventory/changeGoods1.vue
  8. 299
      pages/inventory/goodsList1.vue
  9. 19
      pages/inventory/inventory.vue
  10. 34
      pages/login/login.vue

11
pages/billing/changeGoods1.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="page1"> <view class="page1">
<view class="title-box"> <view class="title-box">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入商品名称/编号" cancelButton="none" <uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none"
@confirm="search" /> @confirm="search" />
</view> </view>
<view class="content-box"> <view class="content-box">
@ -226,6 +226,7 @@
this.indexList[i].parentId = false this.indexList[i].parentId = false
} }
} }
this.categoryId = this.indexList[0].id
this.getShareList(this.indexList[0].id); this.getShareList(this.indexList[0].id);
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
@ -315,7 +316,7 @@
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", { this.tui.request("/app/product/getShareList", "POST", {
categoryId: id, categoryId: this.categoryId,
supplierName: this.searchName, supplierName: this.searchName,
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: '10' pageSize: '10'
@ -392,10 +393,7 @@
//顶部搜索框 //顶部搜索框
search(res) { search(res) {
this.searchName = res.value this.searchName = res.value
uni.showToast({ this.getShareList()
title: '搜索:' + res.value,
icon: 'none'
})
}, },
//未入库遮罩 //未入库遮罩
clickMask(item){ clickMask(item){
@ -420,6 +418,7 @@
this.indexList[i].parentId = false this.indexList[i].parentId = false
} }
} }
this.categoryId = this.indexList[index].id
this.getShareList(this.indexList[index].id) this.getShareList(this.indexList[index].id)
}, },
inputDialogToggle() { inputDialogToggle() {

14
pages/index/downStearmList.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="page1"> <view class="page1">
<view class="title-box"> <view class="title-box">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入商品名称/编号" cancelButton="none" <uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入商品名称/货号" cancelButton="none"
@confirm="search" /> @confirm="search" />
</view> </view>
<view class="content-box"> <view class="content-box">
@ -183,7 +183,7 @@
shopList: [], shopList: [],
info: 0, info: 0,
categoryId: '', //分类id categoryId: '', //分类id
keywords: '', //搜索框输入值 searchName: '', //搜索框输入值
shopId: '', //店铺id, shopId: '', //店铺id,
checkbox: [], //需要分享的商品id checkbox: [], //需要分享的商品id
temporaryNum: 0, temporaryNum: 0,
@ -388,10 +388,7 @@
//顶部搜索框 //顶部搜索框
search(res) { search(res) {
this.searchName = res.value this.searchName = res.value
uni.showToast({ this.getShareList()
title: '搜索:' + res.value,
icon: 'none'
})
}, },
inputDialogToggle() { inputDialogToggle() {
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
@ -521,9 +518,8 @@
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(id) {
this.tui.request("/app/productShare/getShareList", "POST", { this.tui.request("/app/productShare/getShareList", "POST", {
keywords: this.keywords, keywords: this.searchName,
id: id, id: this.khid,
// id:'1717828137930330112',
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: '10' pageSize: '10'
}, false, true).then((res) => { }, false, true).then((res) => {

3
pages/index/order.vue

@ -45,6 +45,9 @@
console.log('options', options); console.log('options', options);
this.type = options.type; this.type = options.type;
this.listStatus = options.listStatus this.listStatus = options.listStatus
},
onShow(){
this.getOrderInfoList() this.getOrderInfoList()
}, },
onReachBottom() { onReachBottom() {

6
pages/index/orderDetail.vue

@ -24,8 +24,8 @@
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;"> style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;">
<view class="shop-productName"> <view class="shop-productName">
<view style="color:#FF5809;">品名:{{item.productName}} ({{item.productSn == null ? '暂无':item.productSn}})</view> <view style="color:#FF5809;">品名:{{item.productName}} ({{item.productSn == null ? '暂无':item.productSn}})</view>
<view>单价:{{item.price}} 数量:{{item.productCount}} 总价:{{item.discountAmount}}</view> <view>单价:{{item.price == null ? '暂无':item.price}} 数量:{{item.productCount == null ? '暂无':item.productCount}} 总价:{{item.discountAmount == null ? '暂无':item.discountAmount}}</view>
<view v-if="item.supplierName !=undefined">供应商:{{item.supplierName}}</view> <view v-if="item.supplierName !=undefined">供应商:{{item.supplierName == null ? '暂无':item.supplierName}}</view>
</view> </view>
</view> </view>
<view class="shop-type"> <view class="shop-type">
@ -143,7 +143,7 @@
<view class="tui-order-title"> <view class="tui-order-title">
回款历史 回款历史
</view> </view>
<view class="tui-order-content" v-for="(item,index) in collection"> <view class="tui-order-content" style="border-bottom: 1px solid #E0E0E0;" v-for="(item,index) in collection">
<view class="tui-order-flex"> <view class="tui-order-flex">
<view class="tui-item-title">回款金额:</view> <view class="tui-item-title">回款金额:</view>
<view class="tui-item-content">{{ item.amount }}</view> <view class="tui-item-content">{{ item.amount }}</view>

9
pages/index/shareStyle.vue

@ -149,6 +149,7 @@
} else { } else {
this.indexList[i].parentId = false this.indexList[i].parentId = false
} }
this.categoryId = this.indexList[i].id
this.getShareList(this.indexList[i].id); this.getShareList(this.indexList[i].id);
} }
@ -160,7 +161,7 @@
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", { this.tui.request("/app/product/getShareList", "POST", {
categoryId: id, categoryId: this.categoryId,
supplierName: this.searchName, supplierName: this.searchName,
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: '100' pageSize: '100'
@ -177,10 +178,7 @@
//顶部搜索框 //顶部搜索框
search(res) { search(res) {
this.searchName = res.value this.searchName = res.value
uni.showToast({ this.getShareList()
title: '搜索:' + res.value,
icon: 'none'
})
}, },
//未入库遮罩 //未入库遮罩
clickMask(item) { clickMask(item) {
@ -205,6 +203,7 @@
this.indexList[i].parentId = false this.indexList[i].parentId = false
} }
} }
this.categoryId = this.shopList[index].id
this.goodsList = this.shopList[index] this.goodsList = this.shopList[index]
// this.getShareList(this.indexList[index].id) // this.getShareList(this.indexList[index].id)
}, },

33
pages/index/waitStorageDetail.vue

@ -99,7 +99,7 @@
</view> </view>
</view> </view>
<view class="tui-tabbar"> <view class="tui-tabbar">
<view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 1" @tap="inputDialogToggle">回款</view> <view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 1 && noPay >0" @tap="inputDialogToggle">回款</view>
<view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 0" @click="inventorySubmit">确认提交</view> <view class="tui-btn-mr" v-if="type==0 && sales.inStorageStatus == 0" @click="inventorySubmit">确认提交</view>
</view> </view>
<!-- 弹出输入框 --> <!-- 弹出输入框 -->
@ -173,6 +173,26 @@
inputDialogToggle() { inputDialogToggle() {
this.$refs.inputDialog.open() this.$refs.inputDialog.open()
}, },
sureNpPay(e){
if(e>this.noPay){
uni.showToast({
title: "回款金额不应超过欠款金额!",
icon: 'none'
})
return
}
this.tui.request('/app/purchase/editPayPrice','post', {
id:this.sales.id,
price:e
},false,true).then(res => {
uni.showToast({
title: "成功!",
icon: 'none'
})
uni.navigateBack();
}).catch(res => {});
},
inventorySubmit() { inventorySubmit() {
if (this.noPay == 0 || this.alreadyPay == 0 || this.shouldPay == 0) { if (this.noPay == 0 || this.alreadyPay == 0 || this.shouldPay == 0) {
uni.showToast({ uni.showToast({
@ -191,17 +211,6 @@
supplierId: this.sales.supplierId, //供应商id和姓名 supplierId: this.sales.supplierId, //供应商id和姓名
supplierName: this.sales.supplierName supplierName: this.sales.supplierName
} }
// 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", { this.tui.request("/app/stock/putInPrice", "post", {
purchase: purchase, purchase: purchase,
purchaseDetails: this.goodsList purchaseDetails: this.goodsList

11
pages/inventory/changeGoods1.vue

@ -1,7 +1,7 @@
<template> <template>
<view class="page1"> <view class="page1">
<view class="title-box"> <view class="title-box">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入商品名称/编号" cancelButton="none" <uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none"
@confirm="search" /> @confirm="search" />
</view> </view>
<view class="content-box"> <view class="content-box">
@ -206,6 +206,7 @@
this.indexList[i].parentId = false this.indexList[i].parentId = false
} }
} }
this.categoryId = this.indexList[0].id
this.getShareList(this.indexList[0].id); this.getShareList(this.indexList[0].id);
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
@ -292,7 +293,7 @@
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", { this.tui.request("/app/product/getShareList", "POST", {
categoryId: id, categoryId: this.categoryId,
supplierName: this.searchName, supplierName: this.searchName,
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: '10' pageSize: '10'
@ -372,10 +373,7 @@
//顶部搜索框 //顶部搜索框
search(res) { search(res) {
this.searchName = res.value this.searchName = res.value
uni.showToast({ this.getShareList()
title: '搜索:' + res.value,
icon: 'none'
})
}, },
//未入库遮罩 //未入库遮罩
clickMask(item){ clickMask(item){
@ -400,6 +398,7 @@
this.indexList[i].parentId = false this.indexList[i].parentId = false
} }
} }
this.categoryId = this.indexList[index].id
this.getShareList(this.indexList[index].id) this.getShareList(this.indexList[index].id)
}, },
inputDialogToggle() { inputDialogToggle() {

299
pages/inventory/goodsList1.vue

@ -297,12 +297,31 @@
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
<!-- 打印弹出 -->
<uni-popup ref="printerPopup" background-color="#fff">
<view style="width: 500rpx;height: 300rpx;font-size: 36rpx;">
<view style="height: 80rpx;text-align: center;line-height: 80rpx;font-weight: bold;">
提示
</view>
<view style="text-align: center;line-height: 50px;height: 100rpx;">
需要打印销售小票吗?
</view>
<view style="display: flex;height: 100rpx;margin-top: 20rpx;border-top: 1px solid #eee;position: relative;">
<view @tap='printChenel' style="width:250rpx;line-height: 100rpx;text-align: center;border-right: 1px solid #eee;">
暂不需要
</view>
<kk-printer ref="kkprinter" :bufferData="bufferData" @onPrint="onPrint" style="width: 250rpx;height: 100rpx;line-height: 50px;color: #000;background:#088FEB;position: absolute;bottom: 0;text-align: center;right: 0;"></kk-printer>
</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
<script> <script>
import util from '@/components/kk-printer/utils/util.js';
import * as blesdk from '@/components/kk-printer/utils/bluetoolth.js';
import kkPrinter from '@/components/kk-printer/index.vue';
export default { export default {
components: {},
data() { data() {
return { return {
lsprice:0,//临时零售价 lsprice:0,//临时零售价
@ -318,6 +337,7 @@
keyList: [], keyList: [],
temporaryList: [], temporaryList: [],
zNum: 0, zNum: 0,
bufferData: '',
zPrice:0, zPrice:0,
priceOk:'', //已收金额 priceOk:'', //已收金额
value: 0, value: 0,
@ -389,9 +409,14 @@
pbAddress:'', pbAddress:'',
carList1:[], carList1:[],
radioType1:0, radioType1:0,
saleId:'' saleId:'',
saleDetailList:[],
yNum:150
} }
}, },
components: {
kkPrinter
},
onShow() { onShow() {
let that = this; let that = this;
this.khName = JSON.parse(JSON.stringify(this.khName)) this.khName = JSON.parse(JSON.stringify(this.khName))
@ -894,110 +919,192 @@
}, },
//点击底部开单按钮 //点击底部开单按钮
goSell() { goSell() {
console.log(this.carList)
this.$refs.printerPopup.open('center')
// console.log(this.khName) // console.log(this.khName)
// console.log(this.lbgName) // console.log(this.lbgName)
// console.log(this.wlName) // console.log(this.wlName)
if(this.khName == ''){ // if(this.khName == ''){
this.tui.toast('请选择客户!') // this.tui.toast('请选择客户!')
return // return
} // }
if(this.xsyId ==''){ // if(this.xsyId ==''){
this.tui.toast('请选择销售员!') // this.tui.toast('请选择销售员!')
return // return
} // }
if(this.relPrice == (0 || '')){ // if(this.relPrice == (0 || '')){
this.tui.toast('请输入实收金额!') // this.tui.toast('请输入实收金额!')
return // return
}else if(this.priceOk==(0 || '')){ // }else if(this.priceOk==(0 || '')){
this.tui.toast('请输入已收金额!') // this.tui.toast('请输入已收金额!')
return // return
} // }
if(this.carList.size == 0){ // if(this.carList.size == 0){
this.tui.toast('请添加商品!') // this.tui.toast('请添加商品!')
return // return
} // }
if(this.radioType != ''){ // if(this.radioType != ''){
if(this.radioType == 0 || this.radioType == 1 || this.radioType== 4){ // if(this.radioType == 0 || this.radioType == 1 || this.radioType== 4){
if(this.wlName == ''){ // if(this.wlName == ''){
this.tui.toast('请选择配送公司!') // this.tui.toast('请选择配送公司!')
return // return
} // }
if(this.radioType1 == 0){ // if(this.radioType1 == 0){
if(this.lbgName == ''){ // if(this.lbgName == ''){
this.tui.toast('请选择配送人员!') // this.tui.toast('请选择配送人员!')
return // return
} // }
// }
// }else if(this.radioType== 3){
// if(this.pbAddress == ''){
// this.tui.toast('请输入拼包地址!')
// return
// }
// }
// }else{
// this.tui.toast('请选择发货方式!')
// return
// }
// let obj = {
// orderByWorker: this.lbgName.workerId,
// saleId:this.saleId,
// sale: {
// // relPrice:,
// alreadyEarn: this.priceOk, //已付金额
// realAmount: this.relPrice, //实收金额
// noEarn: this.relPrice - this.priceOk, //欠款
// totalAmount: this.shouldPay, //总金额
// area: this.khName.area,
// city: this.khName.city,
// province: this.khName.province,
// payStatus: 1,
// receiveAddress: this.khName.address,
// userId:this.khName.userId,
// userName:this.khName.name,
// transportType: this.radioType1 == 1?2:this.radioType, //this.radioType
// discount: this.discountNum,
// createBy: this.xsyId,
// createByName:this.createByName,
// remark: this.remark,
// otherExpense:this.otherExpense ==''?0:this.otherExpense, //其他费用
// shareAddress:this.pbAddress,
// transCompany: this.wlName.id,
// companyName:this.wlName.companyName,
// },
// saleDetailList: []
// }
// let purchaseDetails = [];
// this.carList.forEach(function(value, key) {
// console.log(value.stockLogList)
// value.stockLogList.forEach(function(values, keys) {
// let obj = {
// productCount: values,
// attributeList: keys
// }
// value.stockLogList1.push(obj)
// })
// console.log(value)
// purchaseDetails.push(value)
// })
//this.saleDetailList = purchaseDetails;
// obj.saleDetailList = purchaseDetails;
// this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => {
// if (res.code == 200) {
// uni.showToast({
// title: "开单成功",
// icon: 'none'
// })
// setTimeout(res => {
// this.$refs.printerPopup.open('center')
// }, 1000)
// }else{
// this.tui.toast(res.message)
// }
// })
}
}else if(this.radioType== 3){
if(this.pbAddress == ''){
this.tui.toast('请输入拼包地址!')
return
}
}
}else{
this.tui.toast('请选择发货方式!')
return
}
let obj = {
orderByWorker: this.lbgName.workerId,
saleId:this.saleId,
sale: {
// relPrice:,
alreadyEarn: this.priceOk, //已付金额
realAmount: this.relPrice, //实收金额
noEarn: this.relPrice - this.priceOk, //欠款
totalAmount: this.shouldPay, //总金额
area: this.khName.area,
city: this.khName.city,
province: this.khName.province,
payStatus: 1,
receiveAddress: this.khName.address,
userId:this.khName.userId,
userName:this.khName.name,
transportType: this.radioType1 == 1?2:this.radioType, //this.radioType
discount: this.discountNum,
createBy: this.xsyId,
createByName:this.createByName,
remark: this.remark,
otherExpense:this.otherExpense ==''?0:this.otherExpense, //其他费用
shareAddress:this.pbAddress,
transCompany: this.wlName.id,
companyName:this.wlName.companyName,
}, },
saleDetailList: [] //打印取消按钮
} printChenel(){
let purchaseDetails = [];
this.carList.forEach(function(value, key) {
console.log(value.stockLogList)
value.stockLogList.forEach(function(values, keys) {
let obj = {
productCount: values,
attributeList: keys
}
value.stockLogList1.push(obj)
})
console.log(value)
purchaseDetails.push(value)
})
obj.saleDetailList = purchaseDetails;
this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: res.message,
icon: 'none'
})
setTimeout(res => {
uni.redirectTo({ uni.redirectTo({
url: "/pages/index/order" url: "/pages/index/order"
}) })
}, 500) },
//打印小票
}else{ onPrint(opt) {
this.tui.toast(res.message) let that = this;
} //快递单600*1040 入库单440*320 8像素=1mm
/**
* 打印文字
* x: 文字方块左上角X座标,单位dot
* y: 文字方块左上角Y座标,单位dot
* fontName,fontSize: 字体,取值: 參考文檔
* rotation: 旋转 1-90度 2-180度 3-270度 其他-不旋转
* content: 文字内容
*/
let strCmd = blesdk.CreatCPCLPage(600, 1040, 1, 0);
strCmd += blesdk.addCPCLSETMAG(2, 2)
blesdk.addCPCLSETBOLD('bold')
strCmd += blesdk.addCPCLLocation(2); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, uni.getStorageSync('shopName'))
strCmd += blesdk.addCPCLSETMAG(1, 1)
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLText('0', '100', '24', '0', 0, '客户:'+this.khName.name)
strCmd += blesdk.addCPCLText('0', '130', '24', '0', 0, '销售:'+this.createByName)
strCmd += blesdk.addCPCLText('280', '130', '24', '0', 0, '日期:'+this.formatDate(new Date(), 'YYYY-MM-DD')) //+
strCmd += blesdk.addCPCLText('0', '150', '24', '0', 0, '=========================================================')
this.carList.forEach(function(value,key){
strCmd += blesdk.addCPCLText('0', that.yNum+= 30, '24', '0', 0, value.productName+'('+value.productSn+')'+'折扣:'+(value.discount<10?value.discount:'无折扣'))
value.stockLogList.forEach(function(value1,key1){
strCmd += blesdk.addCPCLText('0', that.yNum+= 30, '24', '0', 0,(that.slicePrint(key1))+'*'+value1)
strCmd += blesdk.addCPCLText('200', that.yNum, '24', '0', 0, '单价:'+value.lsprice)
strCmd += blesdk.addCPCLText('360', that.yNum, '24', '0', 0, '总价:'+(value.lsprice*value1))
})
}) })
strCmd += blesdk.addCPCLText('0', this.yNum+=20, '24', '0', 0, '===============================================================')
strCmd += blesdk.addCPCLText('0', this.yNum+=30, '24', '0', 0, '总数量:'+this.totalAmount)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '总金额'+this.shouldPay)
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '应收:'+this.relPrice)
strCmd += blesdk.addCPCLText('0', this.yNum+=30, '24', '0', 0, '实收:'+this.priceOk)
strCmd += blesdk.addCPCLText('200', this.yNum, '24', '0', 0, '欠款:'+this.noPay)
strCmd += blesdk.addCPCLText('400', this.yNum, '24', '0', 0, '其他费用:'+this.otherExpense)
strCmd += blesdk.addCPCLText('0', this.yNum+=30, '24', '0', 0, '备注:'+this.remark)
strCmd += blesdk.addCPCLLocation(0); //对齐指令 0-左对齐 1-右对齐 2-居中
strCmd += blesdk.addCPCLPrint();
this.bufferData = strCmd;
},
//截取
slicePrint(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
},
formatDate(date, fmt) {
var o = {
'M+': date.getMonth() + 1, //月份
'D+': date.getDate(), //日
'H+': date.getHours(), //小时
'm+': date.getMinutes(), //分
's+': date.getSeconds(), //秒
'q+': Math.floor((date.getMonth() + 3) / 3), //季度
'S': date.getMilliseconds() //毫秒
};
if (/(Y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp('(' + k + ')').test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
return fmt;
}, },
//编辑每一个的单价 //编辑每一个的单价
clickPrice(index) { clickPrice(index) {

19
pages/inventory/inventory.vue

@ -37,7 +37,7 @@
</view> </view>
</view> </view>
<view class="search"> <view class="search">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/编号" cancelButton="none" @confirm="search" /> <uni-search-bar class="uni-mt-10" radius="5" placeholder="商品名称/货号/供应商" cancelButton="none" @confirm="search" />
<view class="title-right-bottom title-btn" <view class="title-right-bottom title-btn"
style="width:22%;float: left;height:75rpx;line-height: 75rpx;margin-top:5px;" style="width:22%;float: left;height:75rpx;line-height: 75rpx;margin-top:5px;"
@tap.stop="onGridClick('1')"> @tap.stop="onGridClick('1')">
@ -98,14 +98,14 @@
data() { data() {
return { return {
size: 30, size: 30,
keyword: '',
indexList: [], indexList: [],
pageNum: 1, //分页的页码 pageNum: 1, //分页的页码
shopList: [], shopList: [],
categoryId: '', //分类id categoryId: '', //分类id
shopId: '', //店铺id, shopId: '', //店铺id,
type:'', type:'',
warnMsg:[] warnMsg:[],
searchName:''
} }
}, },
onShow() { onShow() {
@ -129,6 +129,7 @@
this.indexList[i].parentId = false this.indexList[i].parentId = false
} }
} }
this.categoryId = this.indexList[0].id
this.getShareList(this.indexList[0].id); this.getShareList(this.indexList[0].id);
} else { } else {
this.tui.toast(res.message) this.tui.toast(res.message)
@ -154,6 +155,7 @@
this.indexList[i].parentId = false this.indexList[i].parentId = false
} }
} }
this.categoryId = this.indexList[index].id
this.getShareList(this.indexList[index].id) this.getShareList(this.indexList[index].id)
}, },
//入库单详情 //入库单详情
@ -165,8 +167,8 @@
//点击分类获取商品列表 //点击分类获取商品列表
getShareList(id) { getShareList(id) {
this.tui.request("/app/product/getShareList", "POST", { this.tui.request("/app/product/getShareList", "POST", {
categoryId: id, categoryId: this.categoryId,
supplierName: this.keyword, supplierName: this.searchName,
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: '10' pageSize: '10'
}, false, false).then((res) => { }, false, false).then((res) => {
@ -196,6 +198,7 @@
} else { } else {
that.tui.toast(res.message) that.tui.toast(res.message)
} }
this.categoryId = data.categoryId
that.getShareList(data.categoryId) that.getShareList(data.categoryId)
}).catch((res) => {}) }).catch((res) => {})
} else { //上架 } else { //上架
@ -207,6 +210,7 @@
} else { } else {
that.tui.toast(res.message) that.tui.toast(res.message)
} }
this.categoryId = data.categoryId
that.getShareList(data.categoryId) that.getShareList(data.categoryId)
}).catch((res) => {}) }).catch((res) => {})
} }
@ -214,6 +218,11 @@
} }
}) })
}, },
//搜索接口
search(e){
this.searchName = e.value
this.getShareList()
},
//点击头部 分类管理 和 新增入库 按钮 //点击头部 分类管理 和 新增入库 按钮
onGridClick(target) { onGridClick(target) {
if (target == '0') { if (target == '0') {

34
pages/login/login.vue

@ -157,6 +157,29 @@
} }
loginUrl='/auth/smsLogin' loginUrl='/auth/smsLogin'
} }
if(this.wayValue == 1){
this.tui.request("/app/logitics/login", "POST", {
username: this.username,
password: this.password,
code: this.code,
saveLogin: true,
type: this.wayValue
}, true, true).then((res) => {
console.log(res)
if (res.code == 200) {
uni.setStorageSync("hiver_token", res.result.lcomToken)
uni.setStorageSync("transCompany", res.result.logiticsCompany.id)
this.tui.toast('登录成功', 2000, true)
setTimeout(() => {
uni.reLaunch({
url: '/pages/other/logistics'
})
}, 200)
}else{
this.tui.toast(res.message)
}
}).catch((res) => {})
}else{
this.tui.request(loginUrl, "POST", data, true, true).then((res) => { this.tui.request(loginUrl, "POST", data, true, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.setStorageSync("hiver_token", res.result.accessToken) uni.setStorageSync("hiver_token", res.result.accessToken)
@ -165,14 +188,7 @@
// } // }
// this.login(state) // this.login(state)
//多店铺的时候,在这里加上打开店铺选择弹窗 //多店铺的时候,在这里加上打开店铺选择弹窗
if (this.wayValue == 1) { //物流公司登录 if(this.wayValue == 2){ //下游客户登录
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/logistics'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
} else if(this.wayValue == 2){ //下游客户登录
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/other/custom' url: '/pages/other/custom'
@ -197,6 +213,8 @@
this.tui.toast(res.message) this.tui.toast(res.message)
} }
}).catch((res) => {}) }).catch((res) => {})
}
}, },
//多店铺的时候点击选择需要登录的店铺 //多店铺的时候点击选择需要登录的店铺
checkShop(item) { checkShop(item) {

Loading…
Cancel
Save