平板端快衣店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

1309 lines
35 KiB

<!-- 新增挂单 -->
<template>
<view class="">
<view>
<button size="default" type="default" :value="value" @tap="inputDialogToggle('add')"
hover-class="is-hover">新增挂单</button>
</view>
<view class="order-list" v-for="(item, index) in regList" :key="index" @tap="clickCollapse(item)">
<ul>
<li>
<view class="name">
<view class="sale-name">{{item.saleName}}</view>
<view class="btn-list">
<view class="bj-btn" @tap.stop="inputDialogToggle('edit', item)">编辑</view>
<view class="bj-btn" @tap.stop="toggle('center',item)">语音备注</view>
<view class="bj-btn" @tap.stop="scanCodeAdd(item)">扫码选货</view>
<view class="bj-btn" @tap.stop="goSaleGoods(item)">开单</view>
</view>
</view>
<view class="name-date">
<text style="padding-left: 20rpx;">{{item.createByName}}</text>
<text style="padding-left:40rpx;">{{item.createTime}}</text>
</view>
<uni-icons type="bottom" size="25" style="position: absolute;bottom:0;right:30rpx;"></uni-icons>
</li>
</ul>
<view class="order-collapse-item" v-if="item.isCollapse">
<view class="collapse-1">
<view class="order-notes">
<text style="color: red;">备注:</text>
{{item.remark==null?'暂无':item.remark}}
</view>
<view class="shop-list" v-for="(items,index1) in item.saleDetailDTOList" :key="index1">
<view class="order-name">
<text style="float: left;">{{items.productName}}({{items.productSn}})单价:{{items.discountAmount}}</text>
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6b5ab32ff93a4c51b90e562e0b22e850.png" @tap.stop="largeImg(items.productPicture)" alt="">
</view>
<view class="specs-name" v-for="(itemss,index2) in items.stockLogList1" :key="index2">
<view style="margin-right:5%;" @tap="delGoodsPrecs(item,index1,index2)">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
{{itemss.attributeList | sliceMsg}} * {{itemss.productCount}}
</view>
<view class="del-icon" @tap.stop="delGoods(item,items.productId)">
<uni-icons color="red" type="trash" size="26"></uni-icons>
</view>
</view>
</view>
</view>
</view>
<!-- 语音识别弹出层 -->
<view>
<uni-popup ref="popup" background-color="#fff">
<view class="popup-content">
<view class="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="popup-container">
<textarea name="" id="" style="width:100%;border:1px solid #eee;" v-model="voiceText"
placeholder="等待语音识别中..."></textarea>
<view>
<text style="color:red;font-size:22rpx;">*长按“语音”按钮录入,系统将自动识别</text>
</view>
<view class="popup-bottom">
<view class="popup-btn" @tap="clearText">清空</view>
<view class="popup-btn" @tap="setDetail">确认</view>
</view>
</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>
<view class="voice-model" v-if="recordState == true">
<img src="/static/images/maikefeng.png" alt="">
<view class="voice-text">语音识别中...</view>
</view>
<!-- 弹出层 -->
<view>
<uni-popup ref="shopPopup" background-color="#fff">
<view class="shop-popup-content">
<view class="shop-popup-title">
<view class="shop-popup-title-left">
<img class="img-radius" :src="goodsDetail.productPicture" alt="" v-if="goodsDetail.productPicture">
<view class="noPic" v-else>暂无图片</view>
</view>
<view class="shop-popup-title-right">
<view class="shop-popup-title-right-box" style="color: #088FEB;">{{goodsDetail.productName}}
</view>
<view class="shop-popup-title-right-box">{{goodsDetail.productSn}}</view>
<view class="popup-title-right-box" style="color: darkorange;"
@tap="inputDialogToggle('payDialog')">
<text style="margin-right:20rpx;">修改价格</text>
</view>
</view>
</view>
<view class="shop-popup-container" style="position: relative;">
<view class="shop-purchase-price" v-if="storageType == 0">
<view style="margin-right: 20rpx;">实际价格</view>
<uni-easyinput type="text" v-model="purchasePrice" @blur="checkPay(purchasePrice)" placeholder="请输入实际价格" />
</view>
<view @tap="saveCheck"
style="position: absolute;top: 120rpx;right: 20rpx;color: #088FEB;text-decoration: underline;">
保存已选
</view>
<ul style="border-top:20rpx;">
<li v-for="(items,index) in goodsDetail.attributeList" :key="index">
<view class="shop-title-fur">
<view class="shop-name">{{items.name}}</view>
</view>
<view class="shop-attrs">
<uni-data-checkbox v-model="value" :localdata="range"
></uni-data-checkbox>
<text v-for="(itemTag, index1) in items.value" :key="index1"
@tap.stop="attrNameChange(index,itemTag.value,index1) "
:class="itemTag.isChecked ? 'checkedText' : '' "> {{itemTag.value}}</text>
</view>
</li>
</ul>
<view style="padding-bottom: 100rpx;">
<view class="shop-checkList" v-if="temporaryList != ''">
<view class="shop-checkList-box" style="width:67%;">
<text style="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>
<uni-number-box max='1000000' @minus='minusNum' @plus="plusNum" v-model="allChangeNum" @blur="allChange" />
</view>
<view class="shop-checkList" v-for="(item,index) in temporaryList" :key="index">
<view @tap.stop="delCarData(index)" style="margin-right: 20rpx">
<uni-icons color="red" type="minus" size="26"></uni-icons>
</view>
<view class="shop-checkList-box">
<text style="width: 300rpx;display: inline-block;">{{item.name}}</text> <text style="color:#777;font-size: 12px;">库存:{{item.productNum}}</text>
</view>
<uni-number-box max='1000000' v-model="item.productCount" @change="temporaryChange" />
</view>
</view>
</view>
</view>
<view class="shop-popup-bottom" v-for="(item,index) in temporaryList" :key="index">
<view class="shop-popup-bottom-left">
<text>{{zNum}} 件</text>
<text>¥{{zPrice}}</text>
</view>
<view class="shop-popup-bottom-right">
<view class="bottom-btn" @tap="temporaryCheck">选好了</view>
</view>
</view>
</uni-popup>
</view>
<!-- 弹出输入框 -->
<uni-popup ref="payDialog" background-color="#fff">
<view class="popup-pay-content">
<view class="popup-pay-title">
<text>选择商品价格</text>
</view>
<view class="popup-pay-container" @tap="checkPay(goodsDetail.price)">
<text style="display: inline-block">零售价:¥{{goodsDetail.price}}</text>
</view>
<view class="popup-pay-container" @tap="checkPay(goodsDetail.wholesalePrice)">
<text style="display: inline-block">批发价:¥{{goodsDetail.wholesalePrice}}</text>
</view>
</view>
</uni-popup>
<!-- 新增挂单输入框 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="挂单名称" placeholder="请输入挂单名称"
@confirm="addReg"></uni-popup-dialog>
</uni-popup>
<!-- 编辑挂单 -->
<uni-popup ref="setDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" :title="dialogTit" :value="value"
placeholder="请输入挂单名称" cancelText="删除" @confirm="setDetail" @close="dialogDel">
</uni-popup-dialog>
</uni-popup>
<u-modal :show="show" :title="'删除'" :content="'是否确认删除此条挂单?'" showCancelButton="true" @cancel="show = false" @confirm="delItemModal"></u-modal>
<!-- 查看大图弹出层 -->
<uni-popup ref="imgPopup" background-color="#fff">
<view class="img-popup-content">
<img class="img-radius" :src="bigImg" alt="" style="width: 100%;height: 100%;">
</view>
</uni-popup>
</view>
</template>
<script>
var plugin = requirePlugin("WechatSI")
let manager = plugin.getRecordRecognitionManager()
export default {
data() {
return {
voiceText: ' ',
recordState: false,
pageNumber: 1,
regList: [],
show: false,
list: [],
value: '',
indexList: [],
pageNum: 1, //分页的页码
shopList: [],
info: 0,
dialogTit:'挂单名称',
categoryId: '', //分类id
searchName: '', //搜索框输入值
shopId: '', //店铺id,
checkbox: [], //需要分享的商品id
temporaryNum: 0,
goodsDetail: [],
attrNameList: [],
temporaryList: [],
carList: [],
columns: [],
keyList: [],
specsList: [],
evalue: [],
attributeList: [],
purchasePrice: 0,
zPrice: 0,
zNum: 0,
storageType: 0,
hangId: '',
bigImg: '',
productId:'',
productNum:0,
pageOldTemList: [],
oldTemList: [],
goodsList: [],
newTemList: [],
pecsList: [],
dataObj: new Map(),
allChangeNum: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() {
this.getRegList();
this.initRecord();
},
methods: {
//挂单列表
getRegList() {
let obj = {
status: "7",
pageVo: {
pageNumber: this.pageNumber,
pageSize: 10
}
}
this.tui.request("/app/sale/listPages", "POST", obj, false, false).then((res) => {
if (res.code == 200) {
for (let i = 0; i < res.result.records.length; i++) {
res.result.records[i].isCollapse = false
}
this.regList = res.result.records;
} else {
this.tui.toast(res.message)
}
}).catch((res) => {
this.tui.toast(res)
})
},
//点击切换折叠状态
clickCollapse(item) {
item.isCollapse = !item.isCollapse
},
//关闭弹出层
close() {
this.$refs.popup.close()
},
//按住语音识别,开始
kaishi() {
this.recordState = true
manager.start({
duration: 60000,
lang: "zh_CN"
});
},
//松开语音识别,结束
jieshu() {
this.recordState = false
manager.stop()
},
//语音内容为空
showRecordEmptyTip() {
uni.showToast({
title: "请重新说一遍",
icon: 'error'
})
},
//语音识别功能初始化
initRecord() {
let that = this;
manager.stop()
// 识别结束事件
manager.onStop = (res) => {
if (res.result == '') {
that.showRecordEmptyTip()
return
}
if(that.voiceText == ''){
that.voiceText = res.result
}else if(that.voiceText == null){
that.voiceText = res.result
}else{
res.result = ' ' + res.result
that.voiceText += res.result
}
}
// 识别错误事件
manager.onError = (res) => {
if (res.retcode == '-40001') {
uni.showToast({
title: '使用次数超限制,请联系管理员!',
icon: 'none'
})
}
}
},
//扫一扫功能
scanCodeAdd(item) {
let that = this;
uni.scanCode({
success: (res) => {
that.hangId = item.id
if(res.scanType == "QR_CODE"){ //二维码
let shopId = res.result.split(',')[1]
if(shopId == uni.getStorageSync('shopId')){
that.productId = res.result.split(',')[0]
that.toggle('bottom', res.result.split(',')[0]);
if (item.saleDetailDTOList) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
that.carList.push(item.saleDetailDTOList[i])
}
}
}else{
that.tui.toast('您的店铺中暂无该商品!')
}
}else{
that.tui.request("/app/product/getByBarcode", "POST", {
barcode:res.result
}, false, true).then((res1) => {
if (res1.code == 200) {
that.productId = res1.result[0].id
if(res1.result == ''){
that.tui.toast('您的店铺中暂无该商品!')
}else{
that.toggle('bottom', res1.result[0].id);
if (item.saleDetailDTOList) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
that.carList.push(item.saleDetailDTOList[i])
}
}
}
} else {
that.tui.toast(res.message)
}
}).catch((res) => {
that.tui.toast(res)
})
}
},
fail: (res) => {
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
},
//点击规格选择后,下方出现所选规格和库存数
attrNameChange(index, data1,index1) {
this.goodsDetail.attributeList[index].isChecked = !this.goodsDetail.attributeList[index].isChecked;
this.goodsDetail.attributeList[index].value[index1].isChecked = !this.goodsDetail.attributeList[index]
.value[index1].isChecked;
if (this.goodsList[index].specs.indexOf(data1) != -1) {
this.goodsList[index].specs.splice(this.goodsList[index].specs.indexOf(data1), 1)
} else {
this.goodsList[index].specs.push(data1)
}
let jishuqi = 0
for (var i = 0; i < this.goodsList.length; i++) {
if (this.goodsList[i].specs.length > 0) {
jishuqi++
}
}
var resultList = []
if (jishuqi == this.goodsList.length) {
resultList = this.combination(this.goodsList);
}
var evalue = []
var value = []
for (var m = 0; m < resultList.length; m++) {
var name = ''
let value1 = "{"
for (var j = 0; j < resultList[m].length; j++) {
if (j != resultList[m].length - 1) {
name += resultList[m][j] + '/'
value1 += '"' + this.dataObj.get(resultList[m][j]) + '":"' + resultList[m][j] + '",'
} else {
name += resultList[m][j]
value1 += '"' + this.dataObj.get(resultList[m][j]) + '":"' + resultList[m][j] + '"'
}
}
value1 += "}"
value.push(value1)
evalue.push(name)
}
// if (jishuqi == 0) {
// this.oldTemList = []
// }
if (this.temporaryList.length == 0) {
if (jishuqi == this.goodsList.length) {
for (var i = 0; i < value.length; i++) {
this.attributeList = {
attributeList: value[i],
productCount: this.temporaryNum,
productNum: this.productNum,
name: evalue[i],
price: this.purchasePrice
}
this.temporaryList.push(this.attributeList);
}
}
} else {
let newProductCount = 0;
for (var i = 0; i < value.length; i++) {
for (var m = 0; m < this.temporaryList.length; m++) {
if (this.temporaryList[m].attributeList == value[i]) {
newProductCount = this.temporaryList[m].productCount
}
}
this.attributeList = {
attributeList: value[i],
productCount: newProductCount,
productNum: this.productNum,
name: evalue[i],
price: this.purchasePrice
}
this.newTemList.push(this.attributeList);
newProductCount = 0;
}
for (var i = 0; i < this.oldTemList.length; i++) {
let oldAttributeList = '';
let oldProductCount = '';
let notChcek = true;
for (var m = 0; m < this.newTemList.length; m++) {
if (this.oldTemList[i].attributeList == this.newTemList[m].attributeList) {
this.newTemList[m].productCount = this.oldTemList[i].productCount
notChcek = false;
}
}
if (this.newTemList.length > 0 && notChcek) {
this.newTemList.push(this.oldTemList[i]);
}
}
for (var i = 0; i < this.pageOldTemList.length; i++) {
let oldAttributeList = '';
let oldProductCount = '';
let notChcek = true;
for (var m = 0; m < this.newTemList.length; m++) {
if (this.pageOldTemList[i].attributeList == this.newTemList[m].attributeList) {
this.newTemList[m].productCount = this.pageOldTemList[i].productCount
notChcek = false;
}
}
if (this.newTemList.length > 0 && notChcek) {
this.newTemList.push(this.pageOldTemList[i]);
}
}
}
this.$nextTick(() => {
for (var i = 0; i < this.temporaryList.length; i++) {
for (var m = 0; m < this.pecsList.length; m++) {
if (this.temporaryList[i].attributeList == this.pecsList[m].attributeList) {
this.temporaryList[i].productNum = this.pecsList[m].stockCount
}
}
}
})
if (jishuqi != this.goodsList.length) {
if (this.oldTemList.length == 0 && this.pageOldTemList.length == 0) {
this.newTemList = []
this.temporaryList = []
}
}
if (this.newTemList.length != 0 && jishuqi == this.goodsList.length) {
this.temporaryList = this.newTemList;
this.oldTemList = []
this.newTemList = []
}
},
temporaryChange(val) {
this.zNum = 0
for (var i = 0; i < this.temporaryList.length; i++) {
this.zNum += this.temporaryList[i].productCount
}
this.zPrice = this.zNum * this.purchasePrice
},
//弹窗选择规格后,点击弹窗中选好了按钮
temporaryCheck() {
if (this.storageType == 0 && this.purchasePrice == 0) {
uni.showToast({
title: "请输入实际价格!",
icon: 'none'
})
} else {
for (var i = 0; i < this.temporaryList.length; i++) {
if(this.temporaryList[i].productCount <= 0){
this.tui.toast("商品数量不能为零!")
}
}
let data = {
discount: 10,
productId: this.goodsDetail.id,
realPrice: this.zPrice,
productCount: this.zNum,
discountAmount: this.purchasePrice,
unitPrice:this.purchasePrice,
productName: this.goodsDetail.productName,
productSn: this.goodsDetail.productSn,
productPicture: this.goodsDetail.productPicture,
supplierName: this.goodsDetail.supplierName,
stockLogList1: this.temporaryList
}
this.carList.push(data)
this.purchasePrice = ''
this.temporaryList = []
this.zPrice = ''
this.zNum = ''
for (let i = 0; i < this.goodsDetail.attributeList.length; i++) {
this.goodsDetail.attributeList[i].isChecked = false;
for (let m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) {
this.goodsDetail.attributeList[i].value[m].isChecked = false
}
}
this.setSaleDetail()
this.$refs.shopPopup.close()
}
},
//保存扫码选择的商品、删除整条商品数据都用这个方法
setSaleDetail() {
this.tui.request("/app/sale/setSaleDetail", "post", {
saleDetailList: this.carList,
saleId: this.hangId
}, false, false).then((res) => {
if (res.code == 200) {
this.getRegList()
this.carList = []
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//弹出商品规格选择
toggle(type, id) {
this.type = type
if (type == 'bottom') {
this.getById(id);
} else {
wx.vibrateShort()
this.initRecord();
this.voiceText = id.remark
this.list = id
this.$refs.popup.open(type)
}
},
//新增挂单弹窗
inputDialogToggle(type, list) {
this.value = ''
if (type == "add") {
this.$refs.inputDialog.open()
} else if (type == 'edit') {
this.list = list;
this.value = list.saleName
this.$refs.setDialog.open()
} else {
this.$refs.payDialog.open()
}
},
//通过商品id查询商品详细信息
getById(id) {
this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then((res) => {
if (res.code == 200) {
if(res.result.delFlag ==0 || res.result.purchasePrice==null || res.result.inStorageStatus == 0){
this.tui.toast("请将商品上架或入库后再操作!")
return
}
this.goodsDetail = res.result;
this.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
categoryId: this.goodsDetail.categoryId
}, false, true).then((res1) => {
if (res1.code == 200) {
this.$refs.shopPopup.open('bottom')
if (typeof(res1.result) == 'string') {
let newObj = JSON.parse(res1.result)
let newArr = []
for (let val in newObj) {
let valueObj = [];
for (var i = 0; i < newObj[val].length; i++) {
valueObj.push({
value: newObj[val][i],
isChecked: false
})
}
newArr.push({
name: val,
value: valueObj
})
}
this.goodsDetail.attributeList = newArr;
this.goodsDetail.attributeList.forEach((item, index) => {
this.columns[index] = item.value;
this.keyList[index] = item.name;
let specs1 = {
specs: []
}
this.goodsList.push(specs1)
})
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
this.getKCList(id);
},
//库存商品详情
getKCList(id) {
this.tui.request("/app/stock/productCount", "GET", {
productId: id
}, false, true).then((res) => {
if (res.code == 200) {
this.pecsList = res.result
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//保存已选
saveCheck() {
this.pageOldTemList = this.temporaryList
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
this.goodsList[i].specs = []
for (var m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) {
this.goodsDetail.attributeList[i].value[m].isChecked = false
}
}
},
combination(arr) {
let result = [
[]
]
arr.map(x => {
var res = []
result.map(y => {
x.specs.map(z => {
res.push([...y, z])
})
})
result = res
})
return result;
},
allChange(e){
//监听到输入框改变,给所有的都赋值
if(this.isPlusAndMinus == false){
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount = Number(e.detail.value)
}
}
this.isPlusAndMinus == false
this.temporaryChange()
},
plusNum(){
this.isPlusAndMinus == true
//监听到点击+的操作,给所有的都+1
for(var i=0;i<this.temporaryList.length;i++){
if(this.temporaryList[i].productCount == undefined){
this.temporaryList[i].productCount = 1
}else{
this.temporaryList[i].productCount++
}
}
this.temporaryChange()
},
minusNum(){
this.isPlusAndMinus == true
//监听到点击-的操作,给所有的都-1
for(var i=0;i<this.temporaryList.length;i++){
this.temporaryList[i].productCount--
}
this.temporaryChange()
},
//清空语音输入的文字
clearText(){
this.voiceText = ''
},
//查看大图
largeImg(img) {
this.bigImg = img
this.$refs.imgPopup.open()
},
//新增挂单
addReg(e) {
this.tui.request("/app/sale/saveOrder", "POST", {
saleName: e,
status: 7
}, false, false).then((res) => {
if (res.code == 200) {
this.tui.toast("新增成功")
this.getRegList();
} else {
this.tui.toast(res.message)
}
}).catch((res) => {
this.tui.toast(res)
})
},
//带删除按钮的弹窗
dialogDel(){
this.delItem(this.list, 'del')
},
delItem(item, type) {
this.delType = type;
this.delItems = item;
this.show = true;
},
delItemModal() {
this.show = false;
if(this.delType == 'del') {
this.tui.request("/app/sale/delById", "post", {
id: this.delItems.id,
}, false, true).then((res) => {
if (res.code == 200) {
this.getRegList()
uni.showToast({
title:"删除成功",
icon: 'none'
})
} else {
uni.showToast({
title:"删除失败",
icon: 'none'
})
}
}).catch((res) => {})
}
},
//删除整条挂单
delHangOrder() {
let that = this;
uni.showModal({
title: "提示",
content: "确定删除此条挂单记录吗?",
success: function(res) {
if (res.confirm) {
that.tui.request("/app/sale/delById", "POST", {
id: id
}, false, false).then((res) => {
if (res.code == 200) {
that.tui.toast("删除成功")
that.getRegList();
} else {
that.tui.toast(res.message)
}
}).catch((res) => {
that.tui.toast(res)
})
}
}
})
},
//删除整条商品
delGoods(item, productId) {
let that = this;
this.hangId = item.id;
uni.showModal({
title: "提示",
content: "确定删除此条商品吗?",
success: function(res) {
if (res.confirm) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
if (item.saleDetailDTOList[i].productId == productId) {
item.saleDetailDTOList.splice(item.saleDetailDTOList[i], 1)
}
}
that.carList = item.saleDetailDTOList
that.setSaleDetail();
}
}
})
},
//选商品的时候能删除规格
delCarData(index) {
this.temporaryList.splice(index, 1);
this.temporaryChange()
// uni.showModal({
// title: "提示",
// content: "确定删除此条商品吗?",
// success: function(res) {
// if(res.confirm){
// that.carList.get(id).productCount -= that.carList.get(id).stockLogList.get(name);
// that.carList.get(id).stockLogList.delete(name)
// that.carList.get(id).price = that.carList.get(id).productCount * that.carList.get(id).purchasePrice
// if(that.carList.get(id).stockLogList.size == 0){
// that.carList.delete(id)
// }
// that.getAllPrice()
// }
// that.$forceUpdate()
// }
// })
},
//删除商品下的单条规格
delGoodsPrecs(item, index, index1) {
let that = this;
this.hangId = item.id;
uni.showModal({
title: "提示",
content: "确定删除此条规格吗?",
success: function(res) {
if (res.confirm) {
item.saleDetailDTOList[index].stockLogList1.splice(item.saleDetailDTOList[index]
.stockLogList1[index1], 1)
that.carList = item.saleDetailDTOList
that.setSaleDetail();
}
}
})
},
//编辑挂单信息
setDetail(e) {
this.tui.request("/app/sale/updateOrder", "POST", {
saleName: e.detail?'':e,
id: this.list.id,
remark: this.voiceText
}, false, false).then((res) => {
if (res.code == 200) {
this.value = ''
this.voiceText = ''
this.tui.toast("编辑成功")
this.getRegList();
this.$refs.popup.close()
} else {
this.tui.toast(res.message)
}
}).catch((res) => {
this.tui.toast(res)
})
},
//选择是零售价还是批发价
checkPay(price) {
this.purchasePrice = price;
this.$refs.payDialog.close()
this.temporaryChange()
},
//带参数跳转到开单页
goSaleGoods(item) {
let dataList = []
if(item.saleDetailDTOList){
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
let obj = {}
obj.saleDetailQueryDTO = item.saleDetailDTOList[i].stockLogList1
obj.num = 0
obj.id = item.saleDetailDTOList[i].productId
obj.price = 0
obj.lsprice = item.saleDetailDTOList[i].price
obj.zPrice = item.saleDetailDTOList[i].discountAmount
obj.unitPrice = item.saleDetailDTOList[i].discountAmount
obj.productName = item.saleDetailDTOList[i].productName
obj.productPicture = item.saleDetailDTOList[i].productPicture+'?time='+new Date().getTime()
obj.productSn = item.saleDetailDTOList[i].productSn
obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
obj.saleId = item.id
obj.remark = item.remark
obj.xsyId = item.createBy
obj.createByName = item.createByName
dataList.push(obj)
}
}else{
let obj = {}
obj.num = 0
obj.price = 0
obj.saleId = item.id
obj.remark = item.remark
obj.xsyId = item.createBy
obj.createByName = item.createByName
dataList.push(obj)
}
uni.setStorageSync('carList1', JSON.stringify(dataList))
uni.setStorageSync('khName', '')
uni.switchTab({
url: '/pages/inventory/goodsList1'
})
}
}
}
</script>
<style lang="scss" scoped>
button {
color: #ffffff;
background: linear-gradient(90deg, #60F3FF, #088FEB);
width: 90%;
margin-top: 20upx;
}
.order-list {
width: 95%;
border-radius: 10upx;
height: auto;
margin: 20upx auto;
}
.order-list ul {
background: #fff;
}
.order-list li {
width: 100%;
height: 160rpx;
line-height: 80rpx;
font-size: 37rpx;
border-bottom: 0.5px solid #eee;
margin: 0 auto;
position: relative;
background: #ECF5FF;
}
.name {
width: 100%;
display: flex;
float: left;
}
.del-icon {
position: absolute;
top: 10rpx;
right: 10rpx;
}
.shop-list {
margin: 10rpx 0;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
position: relative;
}
.shop-list:last-child {
border-bottom: none;
}
.name-date {
width: 100%;
font-size: 28rpx;
}
.bj-btn {
width: auto;
/* height: 60rpx; */
font-size: 26rpx;
background: #ECF5FF;
margin: 0;
float: left;
padding-right: 20rpx;
color: blue;
text-decoration: underline;
}
.save-btn {
width: 95%;
height: 80rpx;
text-align: center;
line-height: 80rpx;
margin: 0 auto;
background: #088FEB;
color: #fff;
}
.order-collapse-item {
background: #fff;
height: auto;
margin: 0 auto;
padding: 20rpx;
}
.specs-name {
display: flex;
padding-bottom: 20rpx;
height: 60rpx;
line-height: 60rpx;
}
.order-name {
height: 80rpx;
font-size: 32rpx;
font-weight: bold;
line-height: 80rpx;
img {
height: 32rpx;
width: 32rpx;
float: left;
margin: 24rpx;
}
}
.img-popup-content {
width: 500rpx;
height: 500rpx;
}
.order-notes {
height: 100rpx;
line-height: 50rpx;
text-overflow: ellipsis;
overflow: hidden;
white-space: pre-wrap;
text-overflow: -o-ellipsis-lastline;
display: -webkit-box; //特别显示模式
-webkit-line-clamp: 2; //行数
line-clamp: 2;
-webkit-box-orient: vertical; //盒子中内容竖直排列
}
.popup-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 500rpx;
height: 600rpx;
background-color: #fff;
}
.popup-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-container {
margin-top: 20rpx;
}
.popup-bottom {
display: flex;
height: 80rpx;
color: #fff;
line-height: 80rpx;
margin-top: 50rpx;
}
.popup-btn {
flex: 1;
text-align: center;
background: linear-gradient(90deg, #FF9797, #FFC1E0);
}
.popup-btn:last-child {
background: linear-gradient(90deg, #60F3FF, #088FEB);
}
.voice-model {
width: 300rpx;
height: 300rpx;
display: flex;
justify-content: center;
flex-flow: column;
position: fixed;
left: 50%;
background: rgba(0, 0, 0, 0.5);
border-radius: 20rpx;
color: #fff;
text-align: center;
margin-left: -150rpx;
z-index: 999;
}
.voice-model img {
width: 200rpx;
height: 200rpx;
margin: 0 auto;
}
.sale-name {
width: 300rpx;
height: 80rpx;
padding: 0 20rpx;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.shop-popup-content {
align-items: center;
justify-content: center;
padding: 15px;
height: 1200rpx;
background-color: #fff;
margin-bottom: 30rpx;
overflow: scroll;
}
.shop-popup-title {
display: flex;
height: 180rpx;
border-bottom: 1px solid #eee;
margin-top: 20rpx;
}
.shop-popup-title-left {
width: 150rpx;
height: 150rpx;
}
.shop-popup-title-right {
width: 400rpx;
margin-left: 30rpx;
}
.shop-popup-title-right-box {
height: 50rpx;
line-height: 50rpx;
}
.shop-checkList {
display: flex;
height: 50rpx;
font-size: 28rpx;
line-height: 50rpx;
margin: 20rpx 0;
}
.shop-checkList-box {
height: 50rpx;
width: 60%;
}
.shop-popup-bottom {
width: 95%;
height: 100rpx;
position: fixed;
bottom: 0;
left: 2.5%;
display: flex;
z-index: 99;
background: #fff;
}
.shop-popup-bottom-left {
width: 50%;
line-height: 80rpx;
}
.shop-popup-bottom-right {
width: 50%;
line-height: 100rpx;
.bottom-btn {
width: 70%;
line-height: 35px;
height: 70rpx;
text-align: center;
color: #fff;
font-size: 28rpx;
margin: 0 auto;
background: linear-gradient(90deg, #60F3FF, #088FEB);
border-radius: 70rpx;
}
}
.shop-popup-container {
width: 100%;
background: #fff;
height: 50rpx;
}
.shop-purchase-price {
display: flex;
line-height: 40px;
height: 80rpx;
width: 95%;
margin: 20rpx auto;
}
.shop-title-fur {
width: 95%;
height: 70rpx;
margin: 0 auto;
}
.shop-name {
font-size: 30rpx;
width: 50%;
float: left;
height: 70rpx;
line-height: 70rpx;
}
.shop-attrs {
text {
display: inline-block;
border: 1px solid #5fd9ee;
margin: 20rpx;
background-color: #fff;
color: #5fd9ee;
width: 100rpx;
line-height: 70rpx;
height: 70rpx;
text-align: center;
}
.checkedText {
background-color: $u-primary;
color: #fff;
}
}
.shop-popup-title-left img {
width: 150rpx;
height: 150rpx;
}
.popup-pay-content {
align-items: center;
justify-content: center;
padding: 15px;
width: 500rpx;
height: auto;
background-color: #fff;
}
.popup-pay-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
.popup-pay-container {
margin-top: 20rpx;
height: 100rpx;
border-radius: 10px;
background: #088FEB;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
border-top: 1px solid #eee;
color: #fff;
}
.voice-btn{
position: absolute;
bottom: -300rpx;
left: 30%;
width: 200rpx;
height: 200rpx;
background: #eee;
border-radius: 50%;
}
.noPic{
border-radius: 10px;
width: 150rpx;
height: 150rpx;
// margin: 30rpx 0 0 30rpx;
text-align: center;
line-height: 140rpx;
color: #777;
background: #eee;
}
</style>