wangfukang 3 years ago
parent
commit
1a88ea9b43
  1. 17
      pages/billing/changeGoods1.vue
  2. 16
      pages/index/downStearmList.vue
  3. 5
      pages/index/order.vue
  4. 6
      pages/index/orderDetail.vue
  5. 13
      pages/index/shareStyle.vue
  6. 33
      pages/index/waitStorageDetail.vue
  7. 15
      pages/inventory/changeGoods1.vue
  8. 313
      pages/inventory/goodsList1.vue
  9. 23
      pages/inventory/inventory.vue
  10. 92
      pages/login/login.vue

17
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">
@ -225,7 +225,8 @@
} else { } else {
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'
@ -391,11 +392,8 @@
}, },
//顶部搜索框 //顶部搜索框
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){
@ -419,7 +417,8 @@
} else { } else {
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() {

16
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,
@ -387,11 +387,8 @@
}, },
//顶部搜索框 //顶部搜索框
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) => {

5
pages/index/order.vue

@ -45,7 +45,10 @@
console.log('options', options); console.log('options', options);
this.type = options.type; this.type = options.type;
this.listStatus = options.listStatus this.listStatus = options.listStatus
this.getOrderInfoList()
},
onShow(){
this.getOrderInfoList()
}, },
onReachBottom() { onReachBottom() {
if (this.page >= this.totalPages) return; if (this.page >= this.totalPages) return;

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>

13
pages/index/shareStyle.vue

@ -148,7 +148,8 @@
this.indexList[i].parentId = true this.indexList[i].parentId = true
} 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) {
@ -204,7 +202,8 @@
} else { } else {
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

15
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">
@ -205,7 +205,8 @@
} else { } else {
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){
@ -399,7 +397,8 @@
} else { } else {
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() {

313
pages/inventory/goodsList1.vue

@ -296,13 +296,32 @@
</view> </view>
</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,8 +409,13 @@
pbAddress:'', pbAddress:'',
carList1:[], carList1:[],
radioType1:0, radioType1:0,
saleId:'' saleId:'',
saleDetailList:[],
yNum:150
} }
},
components: {
kkPrinter
}, },
onShow() { onShow() {
let that = this; let that = this;
@ -893,112 +918,194 @@
}) })
}, },
//点击底部开单按钮 //点击底部开单按钮
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){ // }else if(this.radioType== 3){
if(this.pbAddress == ''){ // if(this.pbAddress == ''){
this.tui.toast('请输入拼包地址!') // this.tui.toast('请输入拼包地址!')
return // return
} // }
} // }
}else{ // }else{
this.tui.toast('请选择发货方式!') // this.tui.toast('请选择发货方式!')
return // return
} // }
let obj = { // let obj = {
orderByWorker: this.lbgName.workerId, // orderByWorker: this.lbgName.workerId,
saleId:this.saleId, // saleId:this.saleId,
sale: { // sale: {
// relPrice:, // // relPrice:,
alreadyEarn: this.priceOk, //已付金额 // alreadyEarn: this.priceOk, //已付金额
realAmount: this.relPrice, //实收金额 // realAmount: this.relPrice, //实收金额
noEarn: this.relPrice - this.priceOk, //欠款 // noEarn: this.relPrice - this.priceOk, //欠款
totalAmount: this.shouldPay, //总金额 // totalAmount: this.shouldPay, //总金额
area: this.khName.area, // area: this.khName.area,
city: this.khName.city, // city: this.khName.city,
province: this.khName.province, // province: this.khName.province,
payStatus: 1, // payStatus: 1,
receiveAddress: this.khName.address, // receiveAddress: this.khName.address,
userId:this.khName.userId, // userId:this.khName.userId,
userName:this.khName.name, // userName:this.khName.name,
transportType: this.radioType1 == 1?2:this.radioType, //this.radioType // transportType: this.radioType1 == 1?2:this.radioType, //this.radioType
discount: this.discountNum, // discount: this.discountNum,
createBy: this.xsyId, // createBy: this.xsyId,
createByName:this.createByName, // createByName:this.createByName,
remark: this.remark, // remark: this.remark,
otherExpense:this.otherExpense ==''?0:this.otherExpense, //其他费用 // otherExpense:this.otherExpense ==''?0:this.otherExpense, //其他费用
shareAddress:this.pbAddress, // shareAddress:this.pbAddress,
transCompany: this.wlName.id, // transCompany: this.wlName.id,
companyName:this.wlName.companyName, // companyName:this.wlName.companyName,
}, // },
saleDetailList: [] // saleDetailList: []
} // }
let purchaseDetails = []; // let purchaseDetails = [];
this.carList.forEach(function(value, key) { // this.carList.forEach(function(value, key) {
console.log(value.stockLogList) // console.log(value.stockLogList)
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)
}) // })
console.log(value) // console.log(value)
purchaseDetails.push(value) // purchaseDetails.push(value)
}) // })
obj.saleDetailList = purchaseDetails; //this.saleDetailList = purchaseDetails;
this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => { // obj.saleDetailList = purchaseDetails;
if (res.code == 200) { // this.tui.request("/app/sale/buyNew", "post", obj, false, false).then((res) => {
uni.showToast({ // if (res.code == 200) {
title: res.message, // uni.showToast({
icon: 'none' // title: "开单成功",
}) // icon: 'none'
setTimeout(res => { // })
uni.redirectTo({ // setTimeout(res => {
url: "/pages/index/order" // this.$refs.printerPopup.open('center')
}) // }, 1000)
}, 500)
}else{ // }else{
this.tui.toast(res.message) // this.tui.toast(res.message)
} // }
}) // })
}, },
//打印取消按钮
printChenel(){
uni.redirectTo({
url: "/pages/index/order"
})
},
//打印小票
onPrint(opt) {
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) {
console.log(index) console.log(index)

23
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() {
@ -128,7 +128,8 @@
} else { } else {
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)
@ -153,7 +154,8 @@
} else { } else {
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,12 +210,18 @@
} 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) => {})
} }
} }
} }
}) })
},
//搜索接口
search(e){
this.searchName = e.value
this.getShareList()
}, },
//点击头部 分类管理 和 新增入库 按钮 //点击头部 分类管理 和 新增入库 按钮
onGridClick(target) { onGridClick(target) {

92
pages/login/login.vue

@ -156,47 +156,65 @@
type: this.wayValue type: this.wayValue
} }
loginUrl='/auth/smsLogin' loginUrl='/auth/smsLogin'
} }
this.tui.request(loginUrl, "POST", data, true, true).then((res) => { if(this.wayValue == 1){
if (res.code == 200) { this.tui.request("/app/logitics/login", "POST", {
uni.setStorageSync("hiver_token", res.result.accessToken) username: this.username,
// let state = { password: this.password,
// token: res.result.accessToken code: this.code,
// } saveLogin: true,
// this.login(state) type: this.wayValue
//多店铺的时候,在这里加上打开店铺选择弹窗 }, true, true).then((res) => {
if (this.wayValue == 1) { //物流公司登录 console.log(res)
setTimeout(() => { if (res.code == 200) {
uni.reLaunch({ uni.setStorageSync("hiver_token", res.result.lcomToken)
url: '/pages/index/logistics' uni.setStorageSync("transCompany", res.result.logiticsCompany.id)
}) this.tui.toast('登录成功', 2000, true)
}, 200)
this.tui.toast('登录成功', 2000, true)
} else if(this.wayValue == 2){ //下游客户登录
setTimeout(() => {
uni.reLaunch({
url: '/pages/other/custom'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
}else if (res.result.shopList.length > 1 && this.wayValue == 0) {
this.shopList = res.result.shopList;
this.toggle("center");
}else{
uni.setStorageSync('shopName',res.result.shopList[0].shopName)
uni.setStorageSync('type',res.result.shopList[0].type)
setTimeout(() => { setTimeout(() => {
uni.reLaunch({ uni.reLaunch({
url: '/pages/index/index' url: '/pages/other/logistics'
// url: '/pages/index/logistics'
}) })
}, 200) }, 200)
this.tui.toast('登录成功', 2000, true) }else{
} this.tui.toast(res.message)
} else { }
this.tui.toast(res.message) }).catch((res) => {})
} }else{
}).catch((res) => {}) this.tui.request(loginUrl, "POST", data, true, true).then((res) => {
if (res.code == 200) {
uni.setStorageSync("hiver_token", res.result.accessToken)
// let state = {
// token: res.result.accessToken
// }
// this.login(state)
//多店铺的时候,在这里加上打开店铺选择弹窗
if(this.wayValue == 2){ //下游客户登录
setTimeout(() => {
uni.reLaunch({
url: '/pages/other/custom'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
}else if (res.result.shopList.length > 1 && this.wayValue == 0) {
this.shopList = res.result.shopList;
this.toggle("center");
}else{
uni.setStorageSync('shopName',res.result.shopList[0].shopName)
uni.setStorageSync('type',res.result.shopList[0].type)
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/index'
// url: '/pages/index/logistics'
})
}, 200)
this.tui.toast('登录成功', 2000, true)
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
}
}, },
//多店铺的时候点击选择需要登录的店铺 //多店铺的时候点击选择需要登录的店铺
checkShop(item) { checkShop(item) {

Loading…
Cancel
Save