wangfukang 3 years ago
parent
commit
59b37416ca
  1. BIN
      pages/.DS_Store
  2. 12
      pages/billing/changeGoods1.vue
  3. 2
      pages/index/index.vue
  4. 2
      pages/index/peopleList.vue
  5. BIN
      pages/inventory/.DS_Store
  6. 88
      pages/inventory/AIInventory.vue
  7. 17
      pages/inventory/addinventory.vue
  8. 3
      pages/inventory/changeGoods1.vue
  9. 811
      pages/inventory/gategory.vue
  10. 552
      pages/inventory/gategoryLow.vue
  11. 547
      pages/inventory/goodsList1.vue
  12. 2
      pages/inventory/inventory.vue
  13. 285
      pages/inventory/inventoryConfirm.vue

BIN
pages/.DS_Store

Binary file not shown.

12
pages/billing/changeGoods1.vue

@ -102,7 +102,7 @@
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="checkList-box">
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
<text style="width: 250rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
</view>
<uni-number-box max="100000" v-model="item.productCount" @change="temporaryChange" />
</view>
@ -230,7 +230,8 @@
onLoad() {
this.height = wx.getSystemInfoSync().windowHeight
this.getGategoryList()
this.storageType = uni.getStorageSync('type')
this.storageType = uni.getStorageSync('type')
uni.setStorageSync('clearMsg','1')
},
methods: {
//初始化获取分类列表
@ -451,7 +452,6 @@
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.carList1 = this.carList
prevPage.$vm.clearMsg = '1'
uni.navigateBack({
delta: 1
})
@ -647,7 +647,11 @@
this.goodsDetail.price = this.temporaryList[0].price = val
},
//弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() {
temporaryCheck() {
if(this.temporaryList == ''){
this.tui.toast("请选择规格!")
return;
}
let data = {
id: this.goodsDetail.id,
price: this.zPrice,

2
pages/index/index.vue

@ -15,7 +15,7 @@
<text v-if="waitCount.waitAddProductCount > 0"
class="red-circle">{{waitCount.waitAddProductCount > 99 ? '99+' :waitCount.waitAddProductCount}}</text>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/addHangOrder')">
<view class="title-btn-sbtn" @tap="goSonPage('/package1/AI/AIHangOrderList')">
<text>挂单</text>
<text v-if="waitCount.registrationCount > 0"
class="red-circle">{{waitCount.registrationCount > 99 ? '99+' :waitCount.registrationCount}}</text>

2
pages/index/peopleList.vue

@ -168,6 +168,7 @@
this.popleType = options.popleType
this.noClick = options.noClick || 0
this.companyType = options.companyType || ''
uni.setStorageSync('clearMsg','1')
if(options.khName){
this.khName = JSON.parse(options.khName) || ''
}
@ -323,7 +324,6 @@
} else if (this.popleType == 'kdyName') {
prevPage.$vm.kdyName = item
}
prevPage.$vm.clearMsg = '1'
uni.navigateBack({
delta: 1
})

BIN
pages/inventory/.DS_Store

Binary file not shown.

88
pages/inventory/AIInventory.vue

@ -46,19 +46,30 @@
<uni-icons type="closeempty" size=""></uni-icons>
<text>{{value[1].productCount}}</text>
</view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;">品名:<input type="text" :value="value[1].productName" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 318rpx;padding-left: 20rpx;"></view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;">货号:<input type="text" :value="value[1].productSn" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 318rpx;padding-left: 20rpx;"></view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;">
品名:<input type="text" v-if="value[1].isNew" :value="value[1].productName" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 318rpx;padding-left: 20rpx;">
<input type="text" v-else disabled :value="value[1].productName" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 318rpx;padding-left: 20rpx;">
</view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;">
货号:<input type="text" v-if="value[1].isNew" :value="value[1].productSn" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 318rpx;padding-left: 20rpx;">
<input type="text" v-else disabled :value="value[1].productSn" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 318rpx;padding-left: 20rpx;">
</view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;" v-if="value[1].isNew">
分类: <text style="color: #777;padding-left: 20rpx;">{{value[1].categoryName}}</text>
<uni-icons type="compose" color="#777" size='25' @tap="toggle('typePopup',value[0])"></uni-icons>
</view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;">
单价:<input type="number" v-model="value[1].purchasePrice" @blur="clickCollapse($event,value[0])" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 319rpx;padding-left: 20rpx;">
<view @tap="AiAddSpec(value[1])" style="height: 27px;width: 70px;background: #088FEB;color: #fff;border-radius: 5px;margin-top: -10rpx;text-align: center;">
添加规格
</view>
单价:<input type="number" v-model="value[1].purchasePrice" v-if="value[1].isNew" @blur="clickCollapse($event,value[0])" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 300rpx;padding-left: 20rpx;">
<input type="number" v-model="value[1].purchasePrice" disabled v-else @blur="clickCollapse($event,value[0])" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 300rpx;padding-left: 20rpx;">
</view>
<view style="display: flex;height: 55rpx;line-height: 55rpx;">
批发价:<input type="number" v-model="value[1].wholesalePrice" v-if="value[1].isNew" @blur="clickCollapse($event,value[0])" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 100rpx;padding-left: 20rpx;">
零售价:<input type="number" v-model="value[1].price" v-if="value[1].isNew" @blur="clickCollapse($event,value[0])" style="height: 55rpx;border-bottom: 1px solid #eee;color:#777;width: 100rpx;padding-left: 20rpx;">
</view>
<view @tap="AiAddSpec(value[1])" style="height: 27px;width: 70px;background: #088FEB;color: #fff;border-radius: 5px;text-align: center;position: absolute;top: 130rpx;right: 0px;line-height: 54rpx;">
添加规格
</view>
</view>
</view>
<view class="shop-type">
@ -187,14 +198,10 @@
</view>
</uni-popup>
</view>
<!-- 新增分类输入框 -->
<uni-popup ref="addGateDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="新增分类" placeholder="请输入分类名称"
@confirm="addGategory"></uni-popup-dialog>
</uni-popup>
<!-- 弹出分类选择 -->
<uni-popup ref="typePopup" background-color="#fff" :is-mask-click="true">
<view class="type-popup">
<view class="type-popup" style="margin-bottom: 0;">
<view style="height: 80rpx;font-size: 36rpx;font-weight: bold;line-height: 80rpx;text-align: center;">
选择分类
</view>
@ -203,7 +210,7 @@
新增分类
</view>
</view>
<view style="overflow: scroll;height: 630rpx;">
<view style="overflow: scroll;height: 630rpx;padding-bottom: 90rpx;">
<view v-for="(item,index) in indexList" :key="index" @tap="clickGategroy(item)" style="height: 80rpx;font-size: 32rpx;width: 90%;line-height:80rpx;margin: 0 auto;border-top: 1px solid #eee;">
<view style="width: 89%;padding-left: 20rpx;float:left">{{item.categoryName}}</view>
<uni-icons type="right" size="18"></uni-icons>
@ -211,6 +218,11 @@
</view>
</view>
</uni-popup>
<!-- 新增分类输入框 -->
<uni-popup ref="addGateDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="新增分类" placeholder="请输入分类名称"
@confirm="addGategory"></uni-popup-dialog>
</uni-popup>
<!-- 弹出合并商品 -->
<uni-popup ref="mergePopup" background-color="#fff" :is-mask-click="true">
<view class="type-popup" style="max-height: 1000rpx;overflow: scroll;margin-bottom: 0;border-radius: 0;">
@ -351,6 +363,8 @@
this.carList.get(this.mergeId).productSn = this.carList1.productSn
this.carList.get(this.mergeId).categoryId = this.carList1.categoryId
this.carList.get(this.mergeId).isNew=false
this.carList.set(this.carList1.id,this.carList.get(this.mergeId))
this.carList.delete(this.mergeId)
setTimeout(res => {
uni.hideLoading();
}, 300)
@ -397,7 +411,8 @@
that.carList.get(that.carList1[i].id).productCount;
}
this.carList1 = []
} else { //当前页有数据
} else { //当前页有数据
console.log('111')
for (let i = 0; i < this.carList1.length; i++) {
if (this.carList.has(this.carList1[i].id) == true) { //商品相同
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
@ -425,7 +440,7 @@
}
} else { //商品不同
let obj = {
purchasePrice: "", //进货价
purchasePrice: this.carList1[i].price, //进货价
price: 0,
productCount: 0,
id:this.carList1[i].id,
@ -455,15 +470,20 @@
}
this.carList.set(this.carList1[i].id, obj)
}
this.$nextTick(()=>{
console.log('啊啊啊',that.carList1[i]);
console.log(that.carList1);
that.carList.get(that.carList1[i].id).price = that.carList.get(that.carList1[i].id).purchasePrice *
that.carList.get(that.carList1[i].id).productCount;
})
that.carList.get(that.carList1[i].id).productCount;
}
this.carList1 = []
}
uni.removeStorageSync('carList1')
this.$nextTick(()=>{
this.carList1 = []
uni.removeStorageSync('carList1')
})
this.getAllPrice()
if(this.carList1 != ''){
setTimeout(res => {
@ -496,13 +516,14 @@
}
this.temporary = [id,attr,type,value]
let num = type == '颜色' ? 0 : 1
this.getGategoryLowList(num,this.carList.get(id).categoryId)
this.getGategoryLowList()
},
//初始化获取子分类列表
getGategoryLowList(num,categoryId) {
getGategoryLowList() {
this.attrList = []
let num = this.temporary[2] == '颜色' ? 0 : 1
this.tui.request("/app/productAttribute/selectByCategoryId", "POST", {
categoryId: categoryId
categoryId: this.carList.get(this.temporary[0]).categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
this.attrList.push(res1.result[num])
@ -515,7 +536,7 @@
}, false, true).then((res2) => {
if (res2.code == 200) {
this.attributeValue = res2.result;
//
this.$forceUpdate()
} else {
this.tui.toast(res.message)
}
@ -586,6 +607,7 @@
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryLowList()
this.$forceUpdate()
uni.showToast({
title: "添加成功",
icon: 'none'
@ -722,7 +744,7 @@
mergeGoods(){
},
addGategory(){
addGategory(e){
this.tui.request("/app/productCategory/save", "post", {
categoryName: e
}, false, true).then((res) => {
@ -1134,7 +1156,8 @@
this.goodsDetail.attributeList[i].value[m].isChecked = false
}
}
console.log('carList1',carList1)
console.log('这里',this.carList)
if (this.carList.size == 0) { //当前页没有数据
for (let i = 0; i < carList1.length; i++) {
let obj = {
@ -1234,10 +1257,11 @@
carList1 = []
}
this.getAllPrice()
this.$refs.shopPopup.close()
this.$refs.shopPopup.close()
this.allChangeNum = 0
setTimeout(res => {
uni.hideLoading();
}, 2000)
}, 500)
},
changessPrice() {
this.noPay = this.shouldPay - this.alreadyPay;
@ -1343,7 +1367,7 @@
})
return
}
if(value.categoryId == ''){
if(value.categoryId == '' && value.productId == ''){
that.tui.toast(value.productName + "的分类未维护!")
return;
}
@ -1369,7 +1393,7 @@
},
goInventory(purchase,purchaseDetails){
uni.navigateTo({
url: '/pages/inventory/inventoryConfirm?aiinventory=1&purchase=' + JSON.stringify(purchase) + '&purchaseDetails=' + JSON.stringify(purchaseDetails)
url: '/package1/inventory/inventoryConfirm?aiinventory=1&purchase=' + JSON.stringify(purchase) + '&purchaseDetails=' + JSON.stringify(purchaseDetails)
})
},
//编辑每一个的单价
@ -1502,7 +1526,7 @@
.shop-name {
width: 100%;
height: 230rpx;
height: 277rpx;
line-height: 80rpx;
border-top: 1px solid #eee;
font-size: 28rpx;

17
pages/inventory/addinventory.vue

@ -31,7 +31,7 @@
<img class="img-radius" :src="value[1].productPicture" alt=""
style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;">
<view class="shop-productName">
<view style="color:#FF5809;">品名:{{value[1].productName}} ({{value[1].productSn}})</view>
<view style="color:#FF5809;">{{value[1].productName}} ({{value[1].productSn}})</view>
<view>单价:{{value[1].purchasePrice || 0}} 数量:{{value[1].productCount}}</view>
<view>总价:{{value[1].price}}</view>
</view>
@ -48,13 +48,16 @@
<view style="text-align: left;padding-left: 5px;width:50%;display: flex;">数量:<uni-number-box
max="100000" style="margin-top:16rpx;" v-model="values[1].productCount"
@change="GoodsNumChange($event,value,values[0])" /></view>
</view>
<view @tap.stop="AiAddSpec(value[1])" style="position: absolute;top: 76rpx;right: 40rpx;color: blue;text-decoration: underline;">
添加规格
</view>
<view
style="position: absolute;top: 130rpx;right: 40rpx;color: blue;text-decoration: underline;"
@tap="clickCollapse(value[0])" v-if='storageType==0'>
维护采购价
</view>
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[0])">
<view style="position: absolute;top: 0;right: 30rpx;" @tap.stop="delShop(value[0])">
<uni-icons color="red" type="trash" size="26"></uni-icons>
</view>
</view>
@ -596,6 +599,14 @@
this.allChangeNum = 0
this.getById(id);
}
},
AiAddSpec(value){
console.log(value)
if(value.categoryId == ''){
this.tui.toast('请先选择商品分类')
return;
}
this.getById(value.productId);
},
//通过商品id查询商品详细信息
getById(id) {
@ -1024,7 +1035,7 @@
console.log(purchaseDetails)
console.log(purchase)
uni.navigateTo({
url: '/pages/inventory/inventoryConfirm?purchase=' + JSON.stringify(purchase) + '&purchaseDetails=' + JSON.stringify(purchaseDetails)
url: '/package1/inventory/inventoryConfirm?purchase=' + JSON.stringify(purchase) + '&purchaseDetails=' + JSON.stringify(purchaseDetails)
})
},
//编辑每一个的单价

3
pages/inventory/changeGoods1.vue

@ -686,8 +686,9 @@
id: this.goodsDetail.id,
price: this.zPrice,
num: this.zNum,
productId:this.goodsDetail.id,
wholesalePrice: this.goodsDetail.wholesalePrice,
price: this.goodsDetail.price,
price: this.goodsDetail.purchasePrice,
productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture,

811
pages/inventory/gategory.vue

@ -1,811 +0,0 @@
<template>
<view class="u-wrap">
<view style="width: 100%;position: fixed;background: #fff;z-index: 99;">
<button size="default" type="default" @tap="inputDialogToggle('add')" hover-class="is-hover">添加分类</button>
</view>
<view class="card-list">
<ul>
<li v-for="(item, index) in indexList" :key="index" @tap="clickList(item)">
<view class="name">
<text>{{item.categoryName}}</text>
<u-icon name="edit-pen-fill" size="22" @tap.stop="inputDialogToggle('edit', item)"></u-icon>
</view>
<button class="bj-btn" @tap.stop="goGategoryLow(item.id)">编辑规格</button>
</li>
</ul>
</view>
<u-modal :show="show" :title="'删除'" :content="'是否确认删除此分类?'" showCancelButton="true" @cancel="show = false"
@confirm="delItemModal"></u-modal>
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" :title="dialogTit" :value="inputVal" placeholder="请输入名称"
@confirm="dialogInputConfirm" @close="dialogClose">
</uni-popup-dialog>
</uni-popup>
<uni-popup ref="delDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" :title="dialogTit" :value="inputVal" placeholder="请输入名称"
cancelText="删除" @confirm="dialogInputConfirm" @close="dialogDel">
</uni-popup-dialog>
</uni-popup>
<!-- 添加分类弹出层 -->
<uni-popup ref="addTypeDialog" background-color="#fff">
<view class="add-popup-content">
<view class="add-popup-title">
<text>新增分类</text>
<uni-icons @tap='close' type="closeempty" color='red' size="16"
style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons>
</view>
<view class="add-popup-container">
<view>
<text style="color:red;font-size:22rpx;">*您可以点击默认项快捷添加分类,如没有想要的快捷项,可以手动输入</text>
</view>
<textarea name="" id="" style="width: 100%;border: 1px solid #eee;height: 80rpx;padding: 12px;margin:20rpx 0;" v-model="typeText"
placeholder="请输入分类名称"></textarea>
<ul>
<li v-for="(item,index) in defaultList" :key="index">
<view class="title-fur">
<view class="name">{{item.name}}</view>
<u-icon size="20" name="plus" color="#5fd9ee"
@tap="toggle(index) "></u-icon>
</view>
<view class="content-fur">
<view class="content-low" :class="item1.checked?'checked':''" v-for="(item1,index1) in item.list" :key="index1"
@tap.stop="addMultipleType(item,item1.value,index1)">{{item1.value}}</view>
</view>
</li>
</ul>
<view class="add-popup-bottom">
<view class="add-popup-btn" @tap="dialogInputConfirm(typeText)">确认</view>
</view>
</view>
</view>
</uni-popup>
<!-- 查看商品库存弹出层 -->
<uni-popup ref="carPopup" background-color="#fff">
<view class="popup-content" style="height:auto !important;">
<view style="font-size: 36rpx;font-weight: bold;text-align: center;">提示</view>
<view v-if="goodsList !=''"
style="width:100%;font-weight:bold;text-align: center;font-size: 28rpx;margin: 20rpx 0;">
{{goodsList[0].productName}}商品有以下库存,确认继续删除吗?
</view>
<view class="tui-order-item boxbg">
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;">
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;">商品规格</view>
<view style="width: 29%;text-align: center;">数量</view>
</view>
<view class="shop-box" v-for="(item,index) in goodsList" :key="index" style="position: relative;">
<view style='height: 50rpx;line-height: 50rpx;'>
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;float: left;height: 50rpx;overflow: hidden;">
{{item.attributeList | sliceMsg}}
</view>
<view style="width: 29%;text-align: center;float: left;">
{{item.stockCount}}
</view>
</view>
</view>
</view>
<!-- <u-loadmore :status="status" /> -->
<view class="popup-bottom">
<view class="popup-bottom-left">
<view class="bottom-btn" @tap="this.$refs.carPopup.close()"
style="background: linear-gradient(90deg, #FF9797, #FFC1E0);">再想想</view>
</view>
<view class="popup-bottom-right">
<view class="bottom-btn" @tap="this.show = true">确认删除</view>
</view>
</view>
</view>
</uni-popup>
<uni-popup ref="addDialog" type="dialog">
<uni-popup-dialog ref="addClose" mode="input" :title="'请输入规格名'" :value="specVal" placeholder="请输入规格名称"
@confirm="addSpec" @close="dialogClose">
</uni-popup-dialog>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
indexList: [],
show: false,
inputVal: '',
specVal:'',
addIndex:0,
typeModel: '',
editItem: {},
delItems: {},
isOpenId: '',
delType: '',
goodsList: [],
dialogTit: '输入分类名',
typeText:'',
defaultList:[{
name:'颜色',
list:[{
value:'均色',
checked:false,
},{
value:'白色',
checked:false,
},{
value:'黑色',
checked:false,
},{
value:'浅蓝',
checked:false,
},{
value:'蓝色',
checked:false,
},{
value:'灰色',
checked:false,
},{
value:'咖色',
checked:false,
},{
value:'紫色',
checked:false,
},{
value:'红色',
checked:false,
},{
value:'米色',
checked:false,
}]
},{
name:'尺码',
list:[{
value:'均码',
checked:false,
},{
value:'XS码',
checked:false
},{
value:'S码',
checked:false,
},{
value:'M码',
checked:false,
},{
value:'L码',
checked:false,
},{
value:'XL码',
checked:false,
},{
value:'XXL码',
checked:false,
},{
value:'XXXL码',
checked:false,
},{
value:'XXXXL码',
checked:false,
},{
value:'25码',
checked:false
},{
value:'26码',
checked:false
},{
value:'27码',
checked:false
},{
value:'28码',
checked:false
},{
value:'29码',
checked:false
},{
value:'30码',
checked:false
},{
value:'31码',
checked:false
},{
value:'32码',
checked:false
},{
value:'33码',
checked:false
},{
value:'34码',
checked:false
},{
value:'35码',
checked:false
},{
value:'36码',
checked:false
},{
value:'37码',
checked:false
},{
value:'38码',
checked:false
},{
value:'39码',
checked:false
},{
value:'40码',
checked:false
},{
value:'41码',
checked:false
},{
value:'42码',
checked:false
},{
value:'43码',
checked:false
},{
value:'44码',
checked:false
},{
value:'45码',
checked:false
}]
}],
multipleList:[]
}
},
computed: {
},
filters: {
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
}
},
onShow() {
this.getGategoryList()
},
methods: {
//初始化获取分类列表
getGategoryList() {
this.tui.request("/app/productCategory/list", "get", {
// shopId: 1,
}, false, true).then((res) => {
if (res.code == 200) {
this.indexList = res.result;
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//判断需要打开哪个弹窗(删除弹窗、取消弹窗)
inputDialogToggle(type, item, parent) {
this.typeModel = type;
if (type == 'edit') {
this.inputVal = item.categoryName;
this.editItem = item;
this.$refs.delDialog.open()
} else if (type == 'add') {
this.inputVal = '';
this.isOpenId = item;
this.dialogTit = '输入分类名'
this.$refs.addTypeDialog.open('bottom')
}
},
close(){
this.$refs.addTypeDialog.close()
},
//查询分类下有没有库存
getTypeToNum(id) {
let that = this;
this.tui.request("/app/stock/getlistByAttributeList", "post", {
categoryId: id,
}, false, true).then((res) => {
if (res.code == 200) {
if (res.result != '') {
this.goodsList = res.result
this.$refs.carPopup.open('bottom')
} else {
this.tui.request("/app/productAttribute/selectByCategoryId", "POST", {
categoryId: this.delItems.id
}, false, true).then((res1) => {
if (res1.code == 200) {
if (res1.result.length > 0) {
uni.showModal({
title: "提示",
content: "此分类已经维护了子分类,确定继续删除吗?",
success: function(res2) {
if (res2.confirm) {
that.delItemModal()
}
}
})
} else {
that.show = true
}
}
}).catch((res) => {})
}
}
}).catch((res) => {})
},
//点击选择列表,带参数 返回上一页
clickList(item) {
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.$vm.typeItem = item
uni.navigateBack({
delta: 1
})
},
toggle(index){
this.addIndex = index
this.$refs.addDialog.open()
},
addSpec(e){
console.log(e)
let data = {
value:e,
checked:false
}
this.defaultList[this.addIndex].list.push(data)
this.$refs.addClose.val = ''
},
//分类编辑(新增,修改)
dialogInputConfirm(e) {
let that = this;
switch (that.typeModel) {
case 'add':
for (let i = 0; i < that.indexList.length; i++) {
if (that.indexList[i].categoryName == e) {
uni.showToast({
title: "请勿重复添加!",
icon: 'error'
})
return
}
}
if(e == ''){
that.tui.toast("请输入分类名")
return
}
if(e != '' && that.multipleList == ''){
that.multipleList = [{
attributeName:'颜色',
productAttributeValueVoList:[{
checked: true,
value: "均色"
}]
},{
attributeName:'尺码',
productAttributeValueVoList:[{
checked: true,
value: "均码"
}]
}]
}else if(e != '' && that.multipleList != ''){
for(let i=0;i<that.multipleList.length;i++){
if(that.multipleList[i].productAttributeValueVoList == ''){
if(that.multipleList[i].attributeName == '颜色'){
that.multipleList[i].productAttributeValueVoList = [{
checked: true,
value: "均色"
}]
}else{
that.multipleList[i].productAttributeValueVoList = [{
checked: true,
value: "均码"
}]
}
}else{
if(that.multipleList.length != 2){
if(that.multipleList[i].attributeName == '颜色'){
let data = {
attributeName:'尺码',
productAttributeValueVoList:[{
checked: true,
value: "均码"
}]
}
that.multipleList.push(data)
}else{
let data = {
attributeName:'颜色',
productAttributeValueVoList:[{
checked: true,
value: "均码"
}]
}
that.multipleList.push(data)
}
}
}
}
}
that.tui.request("/app/productCategory/batchSaveCategoryAndAttribute", "post", {
categoryName: e,
productAttributeOfAddVos:that.multipleList
}, false, false).then((res) => {
if (res.code == 200) {
that.tui.toast("添加成功")
that.$refs.addTypeDialog.close()
that.getGategoryList()
} else {
that.tui.toast("添加失败")
}
}).catch((res) => {})
// that.$refs.addTypeDialog.val = ''
for(var i=0;i<that.defaultList.length;i++){
for(var m=0;m<that.defaultList[i].list.length;m++){
that.defaultList[i].list[m].checked = false
}
}
that.typeText = ''
that.multipleList = []
break;
case 'edit':
that.tui.request("/app/productCategory/edit", "post", {
categoryName: e,
id: that.editItem.id
}, false, true).then((res) => {
if (res.code == 200) {
that.getGategoryList()
uni.showToast({
title: "修改成功",
icon: 'none'
})
} else {
uni.showToast({
title: "修改失败",
icon: 'none'
})
}
}).catch((res) => {})
break;
default:
}
that.$refs.inputClose.val = ''
},
//点击取消按钮
dialogClose() {
this.inputVal = '';
this.specVal = '';
this.$refs.inputClose.val = ''
this.$refs.addClose.val = ''
},
//带删除按钮的弹窗
dialogDel() {
this.delItem(this.editItem, 'del')
},
delItemModal() {
this.show = false;
if (this.delType == 'del') {
this.tui.request("/app/productCategory/delById", "post", {
id: this.delItems.id,
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "删除成功",
icon: 'none'
})
this.$refs.carPopup.close()
} else {
uni.showToast({
title: "删除失败",
icon: 'none'
})
}
}).catch((res) => {})
}
},
delItem(item, type) {
this.delType = type;
this.delItems = item;
this.getTypeToNum(this.delItems.id)
},
//跳转子分类页
goGategoryLow(id) {
uni.navigateTo({
url: '/pages/inventory/gategoryLow?id=' + id
})
},
//选择多个规格保存
addMultipleType(item,item1,index){
console.log(item);
console.log(item1);
item.list[index].checked = !item.list[index].checked
var list = []
if(this.multipleList == ''){
console.log("首次");
list.push(item.list[index])
var data = {
attributeName:item.name,
productAttributeValueVoList: list
}
this.multipleList.push(data)
}else{
for(var i=0;i<this.multipleList.length;i++){
if(this.multipleList[i].attributeName == item.name){ //同种分类
console.log("同分类");
for(var m=0;m<this.multipleList[i].productAttributeValueVoList.length;m++){
if(this.multipleList[i].productAttributeValueVoList[m].value == item.list[index].value){ //规格相同
console.log("同规格");
this.multipleList[i].productAttributeValueVoList.splice(m,1)
console.log(this.multipleList);
return;
}else{ //规格不同
if(m+1 == this.multipleList[i].productAttributeValueVoList.length){
console.log("不同规格");
this.multipleList[i].productAttributeValueVoList.push(item.list[index])
console.log(this.multipleList);
return;
}
}
}
}else{ //不同分类
if(this.multipleList.length == i+1){
console.log("不同分类");
list.push(item.list[index])
var data = {
attributeName:item.name,
productAttributeValueVoList: list
}
this.multipleList.push(data)
console.log(this.multipleList);
return;
}
}
}
}
console.log(this.multipleList);
},
}
}
</script>
<style lang="scss" scoped>
.u-wrap {
height: calc(100vh);
/* #ifdef H5 */
height: calc(100vh - var(--window-top));
/* #endif */
display: flex;
flex-direction: column;
.top {
line-height: 70rpx;
margin: 20rpx 0;
padding: 0 20rpx;
background-color: #fff;
.u-collapse-content {
.icon {
display: flex;
float: right;
.u-icon {
flex: 1;
}
}
}
.name {
font-size: 14px;
.rightBox {
display: flex;
float: right;
}
}
.attr {
line-height: 28px;
margin-left: 20rpx;
.attrName {
color: #767a82;
font-size: 12px;
display: flex;
box-sizing: border-box;
width: 100%;
margin-top: 20rpx;
}
.attrs {
margin-left: 20rpx;
.u-tag-wrapper {
width: 20%;
}
}
}
}
}
button {
color: #ffffff;
background: #5fd9ee;
width: 90%;
margin: 20rpx auto 20rpx;
}
.card-list {
width: 95%;
border-radius: 10upx;
background: #fff;
height: auto;
margin: 150rpx auto 0;
}
.checked{
background: #60F3FF;
color: #fff;
}
.card-list ul {}
.card-list li {
width: 95%;
height: 100rpx;
line-height: 100rpx;
padding-left: 20rpx;
font-size: 37rpx;
border-bottom: 0.5px solid #eee;
margin: 0 auto;
}
.bj-btn {
width: 120rpx;
height: 60rpx;
font-size: 26rpx;
background: red;
margin: 20rpx 0;
float: left;
padding: 0;
line-height: 60rpx;
}
.name {
width: 75%;
float: left;
display: flex;
}
.data-v-5ff5d986 {}
.popup-content {
align-items: center;
justify-content: center;
padding: 15px;
height: 1200rpx;
background-color: #fff;
margin-bottom: 30rpx;
overflow: scroll;
}
.popup-container {
width: 100%;
background: #fff;
height: 50rpx;
}
.checkList {
display: flex;
height: 50rpx;
font-size: 28rpx;
line-height: 50rpx;
margin: 20rpx 0;
}
.checkList-box {
height: 50rpx;
width: 60%;
}
.popup-bottom {
width: 95%;
height: 100rpx;
position: fixed;
bottom: 0;
left: 2.5%;
display: flex;
z-index: 99;
background: #fff;
}
.popup-bottom-left {
width: 50%;
line-height: 80rpx;
}
.popup-bottom-right {
width: 50%;
line-height: 100rpx;
}
.bottom-btn {
width: 70%;
line-height: 35px;
height: 70rpx;
text-align: center;
/* margin-top: 10rpx; */
color: #fff;
font-size: 28rpx;
margin: 0 auto;
background: linear-gradient(90deg, #60F3FF, #088FEB);
border-radius: 70rpx;
}
.add-popup-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 100%;
height: 1300rpx;
background-color: #fff;
}
.add-popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.add-popup-container {
margin-top: 20rpx;
}
.add-popup-bottom {
display: flex;
height: 80rpx;
color: #fff;
line-height: 80rpx;
margin-top: 50rpx;
}
.add-popup-btn {
flex: 1;
text-align: center;
background: linear-gradient(90deg, #60F3FF, #088FEB);
}
.title-fur {
width: 95%;
height: 70rpx;
margin: 0 auto;
border-bottom: 1px solid #eee;
.name {
font-size: 30rpx;
width: 90%;
float: left;
height: 70rpx;
line-height: 70rpx;
}
}
.content-fur {
padding-bottom: 25rpx;
}
.content-low {
width: auto;
border: 1px solid #eee;
display: inline-block;
min-width: 90rpx;
padding: 5rpx;
font-size: 35rpx;
text-align: center;
color: #777;
margin: 20rpx 0 0 20rpx;
}
</style>

552
pages/inventory/gategoryLow.vue

@ -1,552 +0,0 @@
<template>
<view class="u-wrap">
<!-- <view style="width: 100%;position: fixed;z-index: 99;">
<button size="default" type="default" @tap="inputDialogToggle('attrAdd',categoryId)"
hover-class="is-hover">添加分类</button>
</view> -->
<view class="card-list">
<ul>
<li v-for="items in attrList" :key="items.id">
<view class="title-fur">
<view class="name">{{items.attributeName}}</view>
<view class="rightBox">
<u-icon size="20" name="plus" color="#5fd9ee"
@tap="inputDialogToggle('attrValAdd', items.id) "></u-icon>
<!-- <u-icon size="24" name="edit-pen" color="#5fd9ee" @tap="inputDialogToggle('attrEdit', items, item) "></u-icon> -->
<!-- <u-icon size="24" name="trash" color="#f56c6c" @tap="delItem(items, 'attrDel')"></u-icon> -->
</view>
</view>
<view class="content-fur">
<view class="content-low" v-for="item in items.attributeValue" :key="item.id"
@tap="delItem(item, 'attrNameDel')">{{item.value}}</view>
</view>
</li>
</ul>
</view>
<u-modal :show="show" :title="'删除'" :content="'是否确认删除此分类?'" showCancelButton="true" @cancel="show = false"
@confirm="delItemModal"></u-modal>
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" :title="dialogTit" :value="inputVal" placeholder="请输入名称"
@confirm="dialogInputConfirm" @close="dialogClose">
</uni-popup-dialog>
</uni-popup>
<!-- 查看商品库存弹出层 -->
<uni-popup ref="carPopup" background-color="#fff">
<view class="popup-content" style="height:auto !important;">
<view style="font-size: 36rpx;font-weight: bold;text-align: center;">提示</view>
<view v-if="goodsList !=''"
style="width:100%;font-weight:bold;text-align: center;font-size: 28rpx;margin: 20rpx 0;">
{{goodsList[0].productName}}商品有以下库存,确认继续删除吗?
</view>
<view class="tui-order-item boxbg">
<view style="display: flex;border-bottom: 1px solid #eee;height: 50rpx;line-height: 50rpx;">
<view style="width: 70%;text-align: center;border-right: 1px solid #eee;">商品规格</view>
<view style="width: 29%;text-align: center;">数量</view>
</view>
<view class="shop-box" v-for="(item,index) in goodsList" :key="index" style="position: relative;">
<view style='height: 50rpx;line-height: 50rpx;'>
<view
style="width: 70%;text-align: center;border-right: 1px solid #eee;float: left;height: 50rpx;overflow: hidden;">
{{item.attributeList | sliceMsg}}
</view>
<view style="width: 29%;text-align: center;float: left;">
{{item.stockCount}}
</view>
</view>
</view>
</view>
<!-- <u-loadmore :status="status" /> -->
<view class="popup-bottom">
<view class="popup-bottom-left">
<view class="bottom-btn" @tap="this.$refs.carPopup.close()"
style="background: linear-gradient(90deg, #FF9797, #FFC1E0);">再想想</view>
</view>
<view class="popup-bottom-right">
<view class="bottom-btn" @tap="this.show = true">确认删除</view>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
// indexList: [],
show: false,
inputVal: '',
typeModel: '',
editItem: {},
delItems: {},
isOpenId: '',
attrList: [],
openIndex: '',
delType: '',
dialogTit: '输入分类名',
categoryId: '',
goodsList: []
}
},
computed: {
},
filters: {
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
}
},
onLoad(options) {
this.categoryId = options.id
this.getGategoryList(options.id)
},
methods: {
//初始化获取子分类列表
getGategoryList() {
let data = []
this.tui.request("/app/productAttribute/selectByCategoryId", "POST", {
categoryId: this.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
data = res1.result;
if (res1.result.length > 0) {
data.forEach((items) => {
this.tui.request(
"/app/productAttributeValue/selectByAttributeId",
"get", {
id: items.id
}, false, true).then((res2) => {
if (res2.code == 200) {
items.attributeValue = res2.result;
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
})
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
this.$forceUpdate()
setTimeout(() => {
this.attrList = data
}, 1000)
},
//查询分类下有没有库存
getTypeToNum() {
let that = this;
this.tui.request("/app/stock/getlistByAttributeList", "post", {
categoryId: this.categoryId,
attributeList: this.delItems.attributeName || this.delItems.value,
}, false, true).then((res) => {
if (res.code == 200) {
if (res.result != '') {
this.goodsList = res.result
this.$refs.carPopup.open('bottom')
} else {
that.show = true
}
}
}).catch((res) => {})
},
inputDialogToggle(type, item, parent) {
this.typeModel = type;
if (type == 'edit') {
this.inputVal = item.categoryName;
this.editItem = item;
} else if (type == 'add' || type == 'attrAdd' || type == 'attrValAdd') {
this.inputVal = '';
this.isOpenId = item;
if (type == 'add') {
this.dialogTit = '输入分类名'
} else if (type == 'attrAdd') {
this.dialogTit = '输入分类名'
// this.$refs.addTypeDialog.open('bottom')
} else if (type == 'attrValAdd') {
this.dialogTit = '输入属性值'
}
} else if (type == 'attrEdit') {
this.inputVal = item.attributeName;
this.editItem = item;
}
this.$refs.inputDialog.open()
},
dialogInputConfirm(e) {
switch (this.typeModel) {
case 'add':
this.tui.request("/app/productCategory/save", "post", {
categoryName: e
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "添加成功",
icon: 'none'
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
}).catch((res) => {})
break;
case 'edit':
this.tui.request("/app/productCategory/edit", "post", {
categoryName: e,
id: this.editItem.id
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "修改成功",
icon: 'none'
})
} else {
uni.showToast({
title: "修改失败",
icon: 'none'
})
}
}).catch((res) => {})
break;
case 'attrAdd':
for (let i = 0; i < this.attrList.length; i++) {
if (this.attrList[i].attributeName == e) {
uni.showToast({
title: "请勿重复添加",
icon: 'none'
})
return
}
}
this.tui.request("/app/productAttribute/save", "post", {
attributeName: e,
categoryId: this.isOpenId
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "添加成功",
icon: 'none'
})
} else {
uni.showToast({
title: "添加失败",
icon: 'none'
})
}
}).catch((res) => {})
break;
case 'attrValAdd':
if (e == '') {
uni.showToast({
title: "不能为空!",
icon: 'none'
})
return
}
this.tui.request("/app/productAttributeValue/save", "post", {
value: e,
attributeId: this.isOpenId
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "添加成功",
icon: 'none'
})
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
}).catch((res) => {})
break;
case 'attrEdit':
this.tui.request("/app/productAttribute/edit", "post", {
attributeName: e,
categoryId: this.editItem.categoryId,
id: this.editItem.id
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "修改成功",
icon: 'none'
})
} else {
uni.showToast({
title: "修改失败",
icon: 'none'
})
}
}).catch((res) => {})
break;
default:
}
this.$refs.inputClose.val = ''
},
dialogClose() {
this.inputVal = '';
this.$refs.inputClose.val = ''
},
dialogDel() {
this.delItem(this.editItem, 'del')
},
delItemModal() {
this.show = false;
if (this.delType == 'del') {
this.tui.request("/app/productCategory/delById", "post", {
id: this.delItems.id,
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "删除成功",
icon: 'none'
})
this.$refs.carPopup.close()
} else {
uni.showToast({
title: "删除失败",
icon: 'none'
})
}
}).catch((res) => {})
} else if (this.delType == 'attrDel') {
this.tui.request("/app/productAttribute/delById", "post", {
categoryId: this.delItems.categoryId,
attributeName: this.delItems.attributeName,
id: this.delItems.id,
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "删除成功",
icon: 'none'
})
this.$refs.carPopup.close()
} else {
uni.showToast({
title: "删除失败",
icon: 'none'
})
}
}).catch((res) => {})
} else if (this.delType == 'attrNameDel') {
this.tui.request("/app/productAttributeValue/delById", "post", {
attributeId: this.delItems.attributeId,
value: this.delItems.value,
id: this.delItems.id,
}, false, true).then((res) => {
if (res.code == 200) {
this.getGategoryList()
uni.showToast({
title: "删除成功",
icon: 'none'
})
this.$refs.carPopup.close()
} else {
uni.showToast({
title: "删除失败",
icon: 'none'
})
}
}).catch((res) => {})
}
},
delItem(item, type) {
this.delType = type;
this.delItems = item;
this.getTypeToNum()
// this.show = true;
},
}
}
</script>
<style lang="scss" scoped>
.u-wrap {
height: calc(100vh);
/* #ifdef H5 */
height: calc(100vh - var(--window-top));
/* #endif */
display: flex;
flex-direction: column;
}
button {
color: #ffffff;
background: #5fd9ee;
width: 90%;
margin-top: 20upx;
}
.card-list {
width: 95%;
border-radius: 10upx;
background: #fff;
height: auto;
margin: 40rpx auto 0;
}
.title-fur {
width: 95%;
height: 70rpx;
margin: 0 auto;
border-bottom: 1px solid #eee;
}
.name {
font-size: 30rpx;
width: 50%;
float: left;
height: 70rpx;
line-height: 70rpx;
}
.rightBox {
display: flex;
float: right;
}
.content-fur {
padding-bottom: 25rpx;
}
.content-low {
width: auto;
border: 1px solid #eee;
display: inline-block;
min-width: 90rpx;
padding: 5rpx;
font-size: 35rpx;
text-align: center;
color: #777;
margin: 20rpx 0 0 20rpx;
}
.popup-content {
align-items: center;
justify-content: center;
padding: 15px;
height: 1200rpx;
background-color: #fff;
margin-bottom: 30rpx;
overflow: scroll;
}
.popup-container {
width: 100%;
background: #fff;
height: 50rpx;
}
.checkList {
display: flex;
height: 50rpx;
font-size: 28rpx;
line-height: 50rpx;
margin: 20rpx 0;
}
.checkList-box {
height: 50rpx;
width: 60%;
}
.popup-bottom {
width: 95%;
height: 100rpx;
position: fixed;
bottom: 0;
left: 2.5%;
display: flex;
z-index: 99;
background: #fff;
}
.popup-bottom-left {
width: 50%;
line-height: 80rpx;
}
.popup-bottom-right {
width: 50%;
line-height: 100rpx;
}
.bottom-btn {
width: 70%;
line-height: 35px;
height: 70rpx;
text-align: center;
/* margin-top: 10rpx; */
color: #fff;
font-size: 28rpx;
margin: 0 auto;
background: linear-gradient(90deg, #60F3FF, #088FEB);
border-radius: 70rpx;
}
.checked{
background: #60F3FF;
color: #fff;
}
.add-popup-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 100%;
height: 1300rpx;
background-color: #fff;
}
.add-popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.add-popup-container {
margin-top: 20rpx;
}
.add-popup-bottom {
display: flex;
height: 80rpx;
color: #fff;
line-height: 80rpx;
margin-top: 50rpx;
}
.add-popup-btn {
flex: 1;
text-align: center;
background: linear-gradient(90deg, #60F3FF, #088FEB);
}
</style>

547
pages/inventory/goodsList1.vue

@ -33,7 +33,7 @@
</view>
<view style="height: 150rpx;width: 100%;display: flex;" @tap="toggle('center',item)">
<view style="width: 70rpx;height: 70rpx;margin: 40rpx;display: block;overflow: hidden;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/0db7dd480e4644af871ce7bf97f4f775.jpg" alt="" style="width: 100%;height: 100%;" />
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/27e2655fe19f454d93970f968d91fbef.png" alt="" style="width: 100%;height: 100%;" />
</view>
<view>
<view style="height: 80rpx;font-size: 30rpx;font-weight: bold;line-height: 80rpx;">AI开单</view>
@ -53,19 +53,22 @@
<view class="noPic" v-else>暂无图片</view>
<view class="shop-productName">
<view style="color:#FF5809;">{{value[1].productName}} ({{value[1].productSn}})</view>
<view>单价:{{value[1].discountAmount}} 数量:{{value[1].productCount}} 总价:{{value[1].price}}
<view>¥{{value[1].discountAmount}} * {{value[1].productCount}} 总价:{{value[1].price}}
</view>
<view v-if="value[1].supplierName !=undefined">供应商:{{value[1].supplierName}}</view>
</view>
<view @tap.stop="clickPrice(value[0])"
style="position: absolute;top: 110rpx;right: 40rpx;color: blue;text-decoration: underline;">
改价</view>
<view @tap.stop="clickPrice(value[0])" style="position: absolute;top: 58rpx;right: 40rpx;color: blue;text-decoration: underline;">
改价
</view>
<view @tap.stop="AiAddSpec(value[1])" style="position: absolute;bottom: 10rpx;right: 40rpx;color: blue;text-decoration: underline;">
添加规格
</view>
<view @tap.stop="getHistoryPrice(value[1].productId,value[0])"
v-if="khName !=''&&khName.name !='散客'"
style="position: absolute;top: 126rpx;right: 120rpx;">
style="position: absolute;top: 120rpx;right: 160rpx;">
<u-icon name="clock" size="20"></u-icon>
</view>
<view style="position: absolute;top: 30rpx;right: 30rpx;" @tap.stop="delShop(value[0])">
<view style="position: absolute;top: 0;right: 30rpx;" @tap.stop="delShop(value[0])">
<uni-icons color="red" type="trash" size="26"></uni-icons>
</view>
</view>
@ -88,16 +91,25 @@
<text>数量</text>
<input class="input" type="number" :value='value[1].productCount' disabled>
</view>
</view>
<view class="shop-checkList" v-if="value[1].stockLogList !=''">
<view class="shop-checkList-box" style="width: 67%;">
<text style="text-align:center;width: 300rpx;display: inline-block;font-size: 30rpx;font-weight: bold;padding-left: 40rpx;">规格</text>
<text style="font-size: 30rpx;color: #000;font-weight: bold;width: 110rpx;display: inline-block;text-align: right;">库存</text>
</view>
<view style="font-size: 30rpx;color: #000;font-weight: bold;width: 140rpx;display: inline-block;text-align: right;">数量</view>
</view>
<view class="shop-collapse" v-for="(values,keys) in Array.from(value[1].stockLogList)"
:key='keys'>
<view @tap.stop="delShopSpec(value[0],values[0])">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<text>{{values[0] | sliceMsg}}</text>
<text>{{values[0] | sliceMsg}}</text>
<text>{{values[1].productNum}}</text>
<view style="text-align: left;padding-left: 5px;width:50%;display: flex;">
数量:<uni-number-box max="100000" style="margin-top:16rpx;" v-model="values[1].productCount"
@change="GoodsNumChange($event,value,values[0])" /></view>
<uni-number-box max="100000" style="margin-top:16rpx;" v-model="values[1].productCount"
@change="GoodsNumChange($event,value,values[0])" />
</view>
</view>
</view>
</view>
@ -235,7 +247,7 @@
placeholder="请选择配送方式" @change="checkBoxChange"></uni-data-select>
</view>
</view>
<view class="content-list" v-if="radioType1 != '1' && radioType !=''"
<view class="content-list" v-if="radioType1 == '0' && radioType !=''"
@tap.stop="goPopleList(radioType == '1'? 'kdyName' :'lbgName')">
<view class="list-name" style="width:150rpx;padding-left:0;">
{{radioType == '1'? '快递员' :'拉包工'}}
@ -377,34 +389,32 @@
</view>
</uni-popup>
<!-- 语音识别弹出层 -->
<view>
<uni-popup ref="popup" background-color="#fff">
<view class="voice-popup-content">
<view class="voice-popup-title">
<text>语音录入</text>
<uni-icons @tap='close' type="closeempty" color='red' size="16"
style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons>
</view>
<view style="text-align: center;width: 100%;line-height: 40rpx;font-size: 11px;color: #777;">
语音示例:货号02-37,白色M码,10件
</view>
<view class="voice-popup-container">
<textarea name="" id="" style="width:100%;height:300rpx;border:1px solid #eee;margin:0;" v-model="voiceText"
placeholder="等待语音识别中..."></textarea>
<view>
<text style="color:red;font-size:22rpx;">*长按“语音”按钮录入,系统将自动识别</text>
</view>
<view class="voice-popup-bottom">
<view class="voice-popup-btn" @tap="clearText">清空</view>
<view class="voice-popup-btn" @tap="setDetail">确认</view>
</view>
<uni-popup ref="popup" background-color="#fff">
<view class="voice-popup-content">
<view class="voice-popup-title">
<text>语音录入</text>
<uni-icons @tap='close' type="closeempty" color='red' size="16"
style="height:40rpx;line-height: 40rpx;position: absolute !important;bottom:0;right: 30rpx;"></uni-icons>
</view>
<view style="text-align: center;width: 100%;line-height: 40rpx;font-size: 11px;color: #777;">
语音示例:货号02-37,白色M码,10件
</view>
<view class="voice-popup-container">
<textarea name="" id="" style="width:100%;height:300rpx;border:1px solid #eee;margin:0;" v-model="voiceText"
placeholder="等待语音识别中..."></textarea>
<view>
<text style="color:red;font-size:22rpx;">*长按“语音”按钮录入,系统将自动识别</text>
</view>
<view class="voice-btn" @touchstart="kaishi" @touchend="jieshu">
<img src="/static/images/maikefeng.png" style="width: 80%;height: 80%;margin: 10%;" alt="">
<view class="voice-popup-bottom">
<view class="voice-popup-btn" @tap="clearText">清空</view>
<view class="voice-popup-btn" @tap="setDetail">确认</view>
</view>
</view>
</uni-popup>
</view>
<view class="voice-btn" @touchstart="kaishi" @touchend="jieshu">
<img src="/static/images/maikefeng.png" style="width: 80%;height: 80%;margin: 10%;" alt="">
</view>
</view>
</uni-popup>
<view class="voice-model" v-if="recordState == true">
<img src="/static/images/maikefeng.png" alt="">
<view class="voice-text">语音识别中...</view>
@ -565,7 +575,8 @@
newTemList: [],
pecsList: [],
dataObj: new Map(),
allChangeNum:0
allChangeNum:0,
recordState:false
}
},
components: {
@ -598,7 +609,6 @@
value: 1
}]
}
console.log('商品', this.carList1)
if (uni.getStorageSync('carList1') != '') {
this.carList.clear()
this.carList1 = JSON.parse(uni.getStorageSync('carList1'))
@ -610,163 +620,15 @@
} else {
this.carList1 = this.carList1
}
if (this.carList1 == '' && this.clearMsg != '1' && !uni.getStorageSync('saoma')) {
if (this.carList1 == '' && !uni.getStorageSync('clearMsg') && !uni.getStorageSync('saoma')) {
this.carList.clear()
this.remark = ''
this.clearMsg = '';
this.createByName = ''
this.xsyId = ''
this.khName = []
this.saleId = ''
}
for (let i = 0; i < this.carList1.length; i++) {
// if(that.priceType == 0){ //零售
// this.afterPrice += this.carList1[i].lsprice
// }else if(that.priceType == 1){ //批发
// this.afterPrice += this.carList1[i].wholesalePrice
// }
// if (that.discountType == 1) { //整体折扣
// this.afterPrice = this.afterPrice * 10000 * that.discountNum / 10 / 10000
// }
if (this.carList1[i].saleDetailQueryDTO) {
if (this.carList.size == 0) { //当前页没有数据
let obj = {
purchasePrice: this.carList1[i].price, //采购价
price: 0, //总价
discount: 10, //折扣
unitPrice: this.carList1[i].unitPrice || 0, //单价
discountAmount: this.carList1[i].unitPrice || 0, //折后价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].lsprice, //零售价
productCount: 0, //总数量
productId: this.carList1[i].id,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
productSn: this.carList1[i].productSn,
stockLogList: new Map(),
stockLogList1: [],
supplierName: this.carList1[i].supplierName //供应商
}
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
var data1 = {
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(this.carList1[i].id, obj)
} else { //当前页有数据
if (this.carList.has(this.carList1[i].id) == true) { //商品相同
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i]
.saleDetailQueryDTO[
m].attributeList) == true) { //规格相同
var data1 = {
productCount: this.carList.get(this.carList1[i].id).stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList).productCount + this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
// this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
// .saleDetailQueryDTO[m].attributeList, this.carList.get(this.carList1[i].id).stockLogList.get(
// this.carList1[i].saleDetailQueryDTO[m].attributeList) + this.carList1[i]
// .saleDetailQueryDTO[m].productCount)
// this.carList.get(this.carList1[i].id).productCount += this.carList1[i]
// .saleDetailQueryDTO[m].productCount
} else { //规格不同
// this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
// .saleDetailQueryDTO[
// m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount)
// this.carList.get(this.carList1[i].id).productCount += this.carList1[i]
// .saleDetailQueryDTO[
// m].productCount
var data1 = {
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, data1)
}
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[
m].productCount
}
} else { //商品不同
let obj = {
purchasePrice: this.carList1[i].price, //采购价
price: 0,
discount: 10,
discountAmount: this.carList1[i].unitPrice || 0,
unitPrice: this.carList1[i].unitPrice || 0, //单价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].lsprice, //零售价
productCount: 0,
productId: this.carList1[i].id,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
stockLogList: new Map(),
stockLogList1: [],
productSn: this.carList1[i].productSn,
supplierName: this.carList1[i].supplierName
}
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
// obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
// .saleDetailQueryDTO[m].productCount)
// obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
var data1 = {
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.name = this.carList1[i].saleDetailQueryDTO[m].name
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(this.carList1[i].id, obj)
}
}
}
}
uni.removeStorageSync('carList1')
uni.removeStorageSync('khName')
uni.removeStorageSync('saoma')
this.carList1 = []
this.carList.forEach(function(value, key) {
if (that.priceType == '') {
// value.unitPrice = value.unitPrice
} else if (that.priceType == 0) { //零售
value.unitPrice = value.lsprice
} else if (that.priceType == 1) { //批发
value.unitPrice = value.wholesalePrice
}
if (that.discountType == 1) { //整体折扣
value.price = value.unitPrice * 10000 * value.productCount * that.discountNum / 10 / 10000
}
})
this.getAllPrice()
this.getAmountAndWho()
// this.noPay = this.shouldPay
if (this.xsyId == '') {
this.xsyId = uni.getStorageSync('id')
this.createByName = uni.getStorageSync('nickname')
}
if(this.carList1 != ''){
setTimeout(res => {
uni.hideLoading();
}, 2000)
}else{
setTimeout(res => {
uni.hideLoading();
}, 300)
}
console.log(this.carList)
this.handleData()
},
filters: {
sliceMsg(val) {
@ -785,7 +647,267 @@
this.xsyList();
this.initRecord();
},
methods: {
methods: {
handleData(){
let that = this;
console.log(this.carList1)
for (let i = 0; i < this.carList1.length; i++) {
if (this.carList1[i].saleDetailQueryDTO) {
if (this.carList.size == 0) { //当前页没有数据
let obj = {
purchasePrice: this.carList1[i].price, //采购价
price: 0, //总价
discount: 10, //折扣
unitPrice: this.carList1[i].unitPrice || 0, //单价
discountAmount: this.carList1[i].unitPrice || 0, //折后价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].lsprice, //零售价
productCount: 0, //总数量
productId: this.carList1[i].id,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
productSn: this.carList1[i].productSn,
stockLogList: new Map(),
stockLogList1: [],
supplierName: this.carList1[i].supplierName //供应商
}
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
var data1 = {
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name,
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(this.carList1[i].id, obj)
} else { //当前页有数据
if (this.carList.has(this.carList1[i].id) == true) { //商品相同
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
if (this.carList.get(this.carList1[i].id).stockLogList.has(this.carList1[i]
.saleDetailQueryDTO[
m].attributeList) == true) { //规格相同
var data1 = {
productCount: this.carList.get(this.carList1[i].id).stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList).productCount + this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
// this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
// .saleDetailQueryDTO[m].attributeList, this.carList.get(this.carList1[i].id).stockLogList.get(
// this.carList1[i].saleDetailQueryDTO[m].attributeList) + this.carList1[i]
// .saleDetailQueryDTO[m].productCount)
// this.carList.get(this.carList1[i].id).productCount += this.carList1[i]
// .saleDetailQueryDTO[m].productCount
} else { //规格不同
// this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i]
// .saleDetailQueryDTO[
// m].attributeList, this.carList1[i].saleDetailQueryDTO[m].productCount)
// this.carList.get(this.carList1[i].id).productCount += this.carList1[i]
// .saleDetailQueryDTO[
// m].productCount
var data1 = {
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name
}
this.carList.get(this.carList1[i].id).stockLogList.set(this.carList1[i].saleDetailQueryDTO[
m].attributeList, data1)
}
this.carList.get(this.carList1[i].id).productCount += this.carList1[i].saleDetailQueryDTO[
m].productCount
}
} else { //商品不同
let obj = {
purchasePrice: this.carList1[i].price, //采购价
price: 0,
discount: 10,
discountAmount: this.carList1[i].unitPrice || 0,
unitPrice: this.carList1[i].unitPrice || 0, //单价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].lsprice, //零售价
productCount: 0,
productId: this.carList1[i].id,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
stockLogList: new Map(),
stockLogList1: [],
productSn: this.carList1[i].productSn,
supplierName: this.carList1[i].supplierName
}
for (let m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
// obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, this.carList1[i]
// .saleDetailQueryDTO[m].productCount)
// obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
var data1 = {
productCount: this.carList1[i].saleDetailQueryDTO[m].productCount,
name: this.carList1[i].saleDetailQueryDTO[m].name,
productNum:this.carList1[i].saleDetailQueryDTO[m].productNum
}
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.name = this.carList1[i].saleDetailQueryDTO[m].name
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount
}
this.carList.set(this.carList1[i].id, obj)
}
}
}
}
uni.removeStorageSync('carList1')
uni.removeStorageSync('khName')
uni.removeStorageSync('saoma')
uni.removeStorageSync('clearMsg')
this.carList1 = []
this.carList.forEach(function(value, key) {
if (that.priceType == '') {
// value.unitPrice = value.unitPrice
} else if (that.priceType == 0) { //零售
value.unitPrice = value.lsprice
} else if (that.priceType == 1) { //批发
value.unitPrice = value.wholesalePrice
}
if (that.discountType == 1) { //整体折扣
value.price = value.unitPrice * 10000 * value.productCount * that.discountNum / 10 / 10000
}
})
this.getAllPrice()
this.getAmountAndWho()
// this.noPay = this.shouldPay
if (this.xsyId == '') {
this.xsyId = uni.getStorageSync('id')
this.createByName = uni.getStorageSync('nickname')
}
if(this.carList1 != ''){
setTimeout(res => {
uni.hideLoading();
}, 2000)
}else{
setTimeout(res => {
uni.hideLoading();
}, 300)
}
},
AiHandleData(){
let that = this;
for (let i = 0; i < this.carList1.length; i++) {
if (this.carList1[i].stockLogList1) {
if (this.carList.size == 0) { //当前页没有数据
let obj = {
purchasePrice: this.carList1[i].purchasePrice, //采购价
price: 0, //总价
discount: 10, //折扣
unitPrice: this.carList1[i].price || 0, //单价
discountAmount: this.carList1[i].unitPrice || 0, //折后价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].price, //零售价
productCount: this.carList1[i].productCount, //总数量
id: this.carList1[i].productId,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
productSn: this.carList1[i].productSn,
stockLogList: new Map(),
stockLogList1: [],
supplierName: this.carList1[i].supplierName //供应商
}
for (let m = 0; m < this.carList1[i].stockLogList1.length; m++) {
var data1 = {
productCount: this.carList1[i].stockLogList1[m].productCount,
name: this.carList1[i].stockLogList1[m].name,
productNum:this.carList1[i].stockLogList1[m].productNum
}
obj.stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1)
obj.productCount += this.carList1[i].stockLogList1[m].productCount
}
this.carList.set(this.carList1[i].productId, obj)
} else { //当前页有数据
if (this.carList.has(this.carList1[i].productId) == true) { //商品相同
for (let m = 0; m < this.carList1[i].stockLogList1.length; m++) {
if (this.carList.get(this.carList1[i].productId).stockLogList.has(this.carList1[i]
.stockLogList1[
m].attributeList) == true) { //规格相同
var data1 = {
productCount: this.carList.get(this.carList1[i].productId).stockLogList.get(this.carList1[i].stockLogList1[m].attributeList).productCount + this.carList1[i].stockLogList1[m].productCount,
name: this.carList1[i].stockLogList1[m].name
}
this.carList.get(this.carList1[i].productId).stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1)
} else { //规格不同
var data1 = {
productCount: this.carList1[i].stockLogList1[m].productCount,
name: this.carList1[i].stockLogList1[m].name
}
this.carList.get(this.carList1[i].productId).stockLogList.set(this.carList1[i].stockLogList1[
m].attributeList, data1)
}
this.carList.get(this.carList1[i].productId).productCount += this.carList1[i].stockLogList1[
m].productCount
}
} else { //商品不同
let obj = {
purchasePrice: this.carList1[i].purchasePrice, //采购价
price: 0, //总价
discount: 10, //折扣
unitPrice: this.carList1[i].price || 0, //单价
discountAmount: this.carList1[i].unitPrice || 0, //折后价
wholesalePrice: this.carList1[i].wholesalePrice, //批发价
lsprice: this.carList1[i].price, //零售价
productCount: this.carList1[i].productCount, //总数量
id: this.carList1[i].productId,
productName: this.carList1[i].productName,
productPicture: this.carList1[i].productPicture,
productSn: this.carList1[i].productSn,
stockLogList: new Map(),
stockLogList1: [],
supplierName: this.carList1[i].supplierName //供应商
}
for (let m = 0; m < this.carList1[i].stockLogList1.length; m++) {
// obj.stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, this.carList1[i]
// .stockLogList1[m].productCount)
// obj.productCount += this.carList1[i].stockLogList1[m].productCount
var data1 = {
productCount: this.carList1[i].stockLogList1[m].productCount,
name: this.carList1[i].stockLogList1[m].name,
productNum:this.carList1[i].stockLogList1[m].productNum
}
obj.stockLogList.set(this.carList1[i].stockLogList1[m].attributeList, data1)
obj.name = this.carList1[i].stockLogList1[m].name
obj.productCount += this.carList1[i].stockLogList1[m].productCount
}
this.carList.set(this.carList1[i].productId, obj)
}
}
}
}
this.carList1 = []
this.carList.forEach(function(value, key) {
if (that.priceType == '') {
// value.unitPrice = value.unitPrice
} else if (that.priceType == 0) { //零售
value.unitPrice = value.lsprice
} else if (that.priceType == 1) { //批发
value.unitPrice = value.wholesalePrice
}
if (that.discountType == 1) { //整体折扣
value.price = value.unitPrice * 10000 * value.productCount * that.discountNum / 10 / 10000
}
})
this.getAllPrice()
this.getAmountAndWho()
},
//保存已选
saveCheck() {
this.pageOldTemList = this.temporaryList
@ -992,13 +1114,9 @@
this.relPrice = e.target.value
this.noPay = this.relPrice - this.priceOk;
},
changePrice(e) {
console.log(e)
console.log(e.target.value)
console.log(this.relPrice)
changePrice(e) {
e.detail.value = e.detail.value > this.relPrice ? this.relPrice : e.detail.value
this.priceOk = e.detail.value
console.log(this.priceOk)
this.$forceUpdate()
this.noPay = this.relPrice - this.priceOk;
@ -1043,6 +1161,8 @@
if (res.code == 200) {
this.voiceText = ''
this.$refs.popup.close()
this.carList1 = res.result
this.AiHandleData()
} else {
this.tui.toast(res.message)
}
@ -1120,7 +1240,6 @@
title: '加载中...'
})
} else {
wx.vibrateShort()
this.initRecord();
this.voiceText = ' '
this.$refs.popup.open(type)
@ -1195,7 +1314,13 @@
that.noPay = this.relPrice - this.priceOk
}
},
AiAddSpec(value){
if(value.categoryId == ''){
this.tui.toast('请先选择商品分类')
return;
}
this.getById(value.productId);
},
//通过商品id查询商品详细信息
getById(id) {
let that = this;
@ -1243,8 +1368,6 @@
that.zNum = 0
that.$nextTick(() => {
that.carList.forEach(function(value, key) {
console.log('是否相同',value)
console.log(id)
if (value.productId == id) {
that.zNum = value.productCount
that.temporaryList = value.stockLogList1
@ -1448,7 +1571,7 @@
return
}
let companyType = this.radioType == 1 ? this.wlName.id : ''
console.log(this.khName)
uni.navigateTo({
url: '/pages/index/peopleList?popleType=' + popleType + '&companyType=' + companyType +
'&khName=' + JSON.stringify(this.khName)
@ -1508,7 +1631,8 @@
var data1 = {
productCount: carList1[i].saleDetailQueryDTO[m].productCount,
name: carList1[i].saleDetailQueryDTO[m].name
name: carList1[i].saleDetailQueryDTO[m].name,
productNum:carList1[i].saleDetailQueryDTO[m].productNum
}
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount
@ -1518,10 +1642,11 @@
carList1 = []
} else { //当前页有数据
console.log(carList1)
console.log(this.carList)
for (let i = 0; i < carList1.length; i++) {
this.carList.get(carList1[i].id).productCount = 0
if (this.carList.has(carList1[i].id) == true) { //商品相同
this.carList.get(carList1[i].id).productCount = 0
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
if (this.carList.get(carList1[i].id).stockLogList.has(carList1[i]
.saleDetailQueryDTO[
@ -1580,7 +1705,8 @@
for (let m = 0; m < carList1[i].saleDetailQueryDTO.length; m++) {
var data1 = {
productCount: carList1[i].saleDetailQueryDTO[m].productCount,
name: carList1[i].saleDetailQueryDTO[m].name
name: carList1[i].saleDetailQueryDTO[m].name,
productNum:carList1[i].saleDetailQueryDTO[m].productNum
}
obj.stockLogList.set(carList1[i].saleDetailQueryDTO[m].attributeList, data1)
obj.productCount += carList1[i].saleDetailQueryDTO[m].productCount
@ -1625,6 +1751,7 @@
//按住语音识别,开始
kaishi() {
this.recordState = true
uni.vibrateShort();
manager.start({
duration: 60000,
lang: "zh_CN"
@ -1681,7 +1808,6 @@
uni.showLoading({
title: '加载中...'
})
console.log(this.carList)
if (this.khName == '') {
this.tui.toast('请选择客户!')
return
@ -2067,8 +2193,7 @@
},
//删除商品下的某一个规格
delShopSpec(id, name) {
var that = this;
console.log(that.carList)
var that = this;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
@ -2099,19 +2224,14 @@
that.shouldPay = that.shouldPay + value.price
that.totalAmount = that.totalAmount + value.productCount
})
console.log(this.shouldPay)
this.relPrice = this.shouldPay
console.log(this.relPrice)
this.relPrice = this.shouldPay
this.$forceUpdate()
that.noPay = this.relPrice - (this.priceOk == '' ? 0 : this.priceOk)
},
//修改已选规格的数量
GoodsNumChange(e, index, index1) {
let that = this;
console.log(index[0])
console.log(index1)
console.log(this.carList)
let that = this;
this.carList.get(index[0]).stockLogList.get(index1).productCount = e
this.carList.get(index[0]).productCount = 0
this.carList.get(index[0]).stockLogList.forEach(function(value, key) {
@ -2716,6 +2836,7 @@
justify-content: center;
flex-flow: column;
position: fixed;
top:50%;
left: 50%;
background: rgba(0, 0, 0, 0.5);
border-radius: 20rpx;

2
pages/inventory/inventory.vue

@ -253,7 +253,7 @@
onGridClick(target) {
if (target == '0') {
uni.navigateTo({
url: '/pages/inventory/gategory'
url: '/package1/inventory/gategory'
})
} else if (target == '1') {
uni.navigateTo({

285
pages/inventory/inventoryConfirm.vue

@ -1,285 +0,0 @@
<template>
<view class="container">
<uni-card :title="(purchase.supplierName == null ?'暂无':purchase.supplierName)" thumbnail="/static/images/dingdan/dd0.png">
<!-- <view class="uni-body" v-if="supplier.province">{{supplier.province + supplier.area + supplier.city + supplier.address}} </view> -->
</uni-card>
<view class="tui-order-item boxbg">
<view class="shop-box" style="border-top:5px solid #eee;" v-for="(item,index) in purchaseDetails" :key="index">
<view class="shop-name">
<img class="img-radius" :src="item.productPicture" alt="" style="width: 140rpx;height: 140rpx;margin: 30rpx 0 0 30rpx;" v-if="item.productPicture">
<view class="noPic" v-else>暂无图片</view>
<view class="shop-productName">
<view style="color:#FF5809;">{{item.productName == null ?'暂无':item.productName}}</view>
<view>货号:{{item.productSn == null ?'暂无':item.productSn}}</view>
<view><text v-if="type==0">单价:{{item.purchasePrice == null ?'暂无':item.purchasePrice}} </text><text style="padding: 0 5rpx;">数量:{{item.productCount == null ?'暂无':item.productCount}} </text><text v-if="type==0">总价:{{item.price == null ?'暂无':item.price}}</text></view>
</view>
</view>
<view class="shop-type">
<view class="shop-collapse" v-for="(items,index) in item.stockLogList1" :key='index'>
<text>{{items.attributeList | sliceMsg}}</text>
<!-- <text style="color: red;">单价:¥{{item.price}}</text> -->
<text>数量:{{items.productCount == null ?'暂无':items.productCount}}</text>
</view>
</view>
</view>
<view class="tui-goods-info" style="width: 95%;margin: 0 auto;">
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">应付金额</view>
<view class="tui-goods-price">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ purchase.shouldPay == null ?'暂无':purchase.shouldPay }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">已付金额</view>
<view class="tui-goods-price">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ purchase.alreadyPay == null ?'暂无':purchase.alreadyPay }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">欠款</view>
<view class="tui-goods-price tui-primary-color">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ purchase.noPay == null ?'暂无':purchase.noPay}}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">其他费用</view>
<view class="tui-goods-price tui-primary-color">
<view class="tui-size-24">¥</view>
<view class="tui-price-large">{{ purchase.otherPay == null ?'暂无':purchase.otherPay}}</view>
</view>
</view>
<view class="tui-price-flex tui-size32">
<view class="tui-flex-shrink">备注</view>
<view class="tui-goods-price">
<uni-tooltip :content="purchase.remark == null ?'暂无':purchase.remark">
<view style="font-size: 13px;width: 200px;height: 40rpx;overflow: hidden;text-align: right;">{{ sales.remark == null ?'':sales.remark}}</view>
<text style="color: blue;">查看更多</text>
</uni-tooltip>
</view>
</view>
</view>
</view>
<view class="tui-tabbar">
<view class="tui-btn-mr" @click="batchPrint">批量打印</view>
<view class="tui-btn-mr" @click="inventorySubmit">确认提交</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
purchase:'',
purchaseDetails:'',
aiinventory:0
}
},
filters: {
sliceMsg(val) {
var name = ''
if (typeof(val) == 'string') {
let newObj = JSON.parse(val)
for (let as in newObj) {
name += newObj[as] + '/'
}
}
return name;
}
},
onLoad(option) {
this.purchaseDetails = JSON.parse(option.purchaseDetails)
this.purchase = JSON.parse(option.purchase)
this.aiinventory = option.aiinventory
console.log(this.purchaseDetails)
console.log(this.purchase)
},
methods: {
inventorySubmit() {
let url;
if(this.aiinventory == 1){
url = '/app/stock/putInPriceOfAi'
}else{
url = '/app/stock/putInOfProduct'
}
this.tui.request(url, "post", {
purchase: this.purchase,
purchaseDetails: this.purchaseDetails
}, false, false).then((res) => {
if (res.code == 200) {
uni.showToast({
title: "入库成功",
icon: 'none'
})
setTimeout(res => {
uni.switchTab({
url: '/pages/index/index'
});
}, 1000)
} else {
uni.showToast({
title: "入库失败",
icon: 'none'
})
}
})
},
batchPrint(){
uni.navigateTo({
url: "/package1/inventory/batchPrint?purchase=" + JSON.stringify(this.purchase) + '&purchaseDetails=' + JSON.stringify(this.purchaseDetails)
})
}
},
}
</script>
<style lang="scss">
.container {
padding-bottom: 118rpx;
.boxbg {
background-color: #fff;
margin: 30upx;
padding: 20upx;
border-radius: 10upx;
box-shadow: 0px 1px 10px 2px #e2e2e2;
}
.tui-order-item {
.u-collapse-content {
display: flex;
justify-content: space-between;
line-height: 30px;
}
.tui-goods-info {
width: 100%;
box-sizing: border-box;
background: #fff;
line-height: 26px;
border-top: 10px solid #eee;
.tui-price-flex {
display: flex;
align-items: center;
justify-content: space-between;
}
.tui-size32 {
font-size: 32rpx;
font-weight: 500;
}
.tui-size-24 {
font-size: 24rpx;
}
.tui-price-large {
font-size: 32rpx;
}
.tui-flex-shrink {
flex-shrink: 0;
}
.tui-goods-price {
width: 100%;
display: flex;
align-items: flex-end;
justify-content: flex-end;
font-size: 24rpx;
}
.tui-primary-color {
color: #EB0909;
}
}
}
}
.tui-tabbar {
width: 100%;
height: 98rpx;
background: #fff;
position: fixed;
left: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 26rpx;
box-shadow: 0 0 1px rgba(0, 0, 0, .3);
padding-bottom: env(safe-area-inset-bottom);
z-index: 996;
}
.tui-btn-mr {
width:130rpx;
height: 60rpx;
background: #088FEB;
color: #fff;
border-radius: 10px;
line-height: 60rpx;
text-align: center;
margin-right: 30rpx;
}
.shop-box {
width: 95%;
margin: 0 auto;
position: relative;
}
.shop-name {
width: 100%;
height: 200rpx;
line-height: 80rpx;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
font-size: 28rpx;
font-weight: bold;
display: flex;
.uni-icons {
color: #088FEB !important;
}
}
.shop-productName {
flex: 1;
display: flex;
flex-direction: column;
padding-left: 20rpx;
}
.shop-productName view {
height: 55rpx;
}
.shop-collapse {
display: flex;
height: 80rpx;
font-size: 26rpx;
line-height: 80rpx;
}
.shop-collapse text {
flex: 1;
text-align: center;
padding-right: 40rpx;
border-right: 1px solid #eee;
}
.noPic{
border-radius: 10px;
width: 140rpx;
height: 140rpx;
text-align: center;
line-height: 140rpx;
color: #777;
background: #eee;
}
.uni-tooltip {
display: flex !important;
}
</style>
Loading…
Cancel
Save