wangfukang 2 years ago
parent
commit
3a6ecaa09f
  1. 12
      package1/AI/AIHangOrderList.vue
  2. 113
      package1/AI/addAiList.vue
  3. 812
      package1/AI/voiceInventory.vue
  4. 2
      package1/index/order.vue
  5. 677
      package1/index/orderDetail.vue
  6. 38
      package1/index/peopleList.vue
  7. 233
      package1/inventory/addGoods.vue
  8. 37
      package1/inventory/inventoryConfirm.vue

12
package1/AI/AIHangOrderList.vue

@ -919,7 +919,8 @@
this.returnList.forEach(function(value, key) {
item.saleDetailDTOList.push(value)
})
if (item.saleDetailDTOList) {
if (item.saleDetailDTOList.length>0) {
for (let i = 0; i < item.saleDetailDTOList.length; i++) {
let obj = {}
@ -941,6 +942,7 @@
}
}
obj.attrId = item.saleDetailDTOList[i].attrId
obj.saleDetailQueryDTO = newSaleDetailDTOList
obj.num = 0
obj.id = item.saleDetailDTOList[i].productId
@ -954,7 +956,7 @@
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].discountAmount || item.saleDetailDTOList[i].wholesalePrice
obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
obj.returnPrice = item.saleDetailDTOList[i].returnPrice
obj.saleId = item.id
obj.remark = item.remark
@ -972,7 +974,7 @@
obj.createByName = item.createByName
dataList.push(obj)
}
this.$nextTick(()=>{
setTimeout(res11=>{
this.tui.request("/app/customer/list", "post", {
notBuyDays: "",
pageNum: 1,
@ -982,6 +984,7 @@
}, false, false).then((res) => {
if (res.code == 200) {
this.returnList = new Map()
console.log('dataList',dataList)
uni.setStorageSync('khName', JSON.stringify(res.result.records[0]))
uni.setStorageSync('carList1', JSON.stringify(dataList))
uni.setStorageSync('hangOrder', true)
@ -990,7 +993,8 @@
})
}
})
})
},500)
},
//点击切换折叠状态
clickCollapse(item,index) {

113
package1/AI/addAiList.vue

@ -2,7 +2,7 @@
<template>
<view class="page1" style="overflow: scroll;padding-bottom: 150rpx;">
<view class="box">
<view style="display: flex;height: 80rpx;line-height: 80rpx;">
<view @tap="getData" style="display: flex;height: 80rpx;line-height: 80rpx;">
<view class="circle">
寄
</view>
@ -186,6 +186,7 @@
<view class="voice-text">语音识别中...</view>
</view>
<view class="mask-model" v-if="isVoice">貌似没有检测到您上次的语音录入信息,正在反复识别中</view>
<canvas canvas-id="myCanvas" style="width: 1700px; height: 2200px;"></canvas>
</view>
</template>
@ -200,7 +201,10 @@
voiceData: {},
recordState: false,
productPicture: [],
messages:['消息1', '消息2', '消息3']
canvas: null,
tempFilePath: '',
messages: ['消息1', '消息2', '消息3'],
base64:''
}
},
onShow() {
@ -215,8 +219,113 @@
})
},
onLoad(option) {
this.getUserData()
},
methods: {
getUserData(){
console.log(__wxConfig.envVersion)
uni.request({
url: 'https://api.weixin.qq.com/cgi-bin/token',
data: {
grant_type: 'client_credential',
appid: 'wx6d7d4fb58d1502db',
secret: '3a2c8cd00926764bbd12fd7361e01f1d'
},
method: 'GET',
dataType: 'json',
success: (res) => {
console.log('access_token',res.data.access_token)
uni.request({
url: 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=' + res.data
.access_token,
data: {
page: 'package1/index/downStearmList',
scene:'khid=1833763951914127361',
env_version: "develop",
},
responseType: 'arraybuffer',
method: 'POST',
dataType: 'json',
success: (res1) => {
let base64 = wx.arrayBufferToBase64(res1.data)
console.log('base64',base64)
const time = new Date().getTime();
const imgPath = wx.env.USER_DATA_PATH + "/poster" + time + "share" + ".png";
const file = wx.getFileSystemManager();
file.writeFileSync(imgPath, base64, "base64");
this.base64 = imgPath
},
fail: (res) => {
this.tui.toast("网络不给力,请稍后再试~")
}
})
},
fail: (res) => {
this.tui.toast("网络不给力,请稍后再试~")
}
})
},
getData() {
let that = this
uni.showLoading({
title:'生成中...'
})
const ctx = uni.createCanvasContext('myCanvas', this);
//背景图
let imgA = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/0f96ca9700b741d486dd23bbe4e0f970.jpg';
uni.downloadFile({
url: imgA,
success: (res2) => {
if (res2.statusCode === 200) {
// // 绘制第一张图片
ctx.drawImage(res2.tempFilePath, 0, 0, 1700, 2200);
ctx.draw()
// 绘制第二张图片
ctx.drawImage(that.base64, 650, 850, 400, 400);
ctx.draw(true);
// 设置字体样式
ctx.font = 'bold 200px SimSun';
// 设置文字颜色
ctx.fillStyle = '#088FEB';
var text = '天逸的店';
var textWidth = ctx.measureText(text).width;
console.log(textWidth)
// 计算居中位置
var x = (1700 - textWidth) / 2;
// 绘制文字
ctx.fillText(text, x, 700);
ctx.draw(true)
setTimeout(ress=>{
uni.canvasToTempFilePath({
x: 0,
y: 0,
width: 1700,
height: 2200,
destWidth: 1701,
destHeight: 2200,
canvasId: 'myCanvas',
success: (res3) => {
uni.previewImage({
urls: [res3.tempFilePath]
})
uni.hideLoading()
// uni.saveImageToPhotosAlbum({
// filePath: res3.tempFilePath,
// success: function () {
// console.log('save success');
// }
// });
}
});
},500)
}
}
});
},
//按住语音识别,开始
kaishi() {
if (this.isVoice == false) {

812
package1/AI/voiceInventory.vue

File diff suppressed because it is too large

2
package1/index/order.vue

@ -306,7 +306,7 @@
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].discountAmount?item.saleDetailDTOList[i].discountAmount:item.saleDetailDTOList[i].wholesalePrice
obj.wholesalePrice = item.saleDetailDTOList[i].wholesalePrice
obj.returnPrice = item.saleDetailDTOList[i].returnPrice
obj.saleId = item.id
obj.remark = item.remark

677
package1/index/orderDetail.vue

File diff suppressed because it is too large

38
package1/index/peopleList.vue

@ -11,11 +11,11 @@
</view>
<view class="title-box" v-if="popleType=='wlName' || popleType=='dbName' || popleType=='fcName'">
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入名称或发货地查询" cancelButton="none"
@confirm="search" />
@confirm="search" @clear="clearSearch" />
</view>
<view class="title-box" v-else>
<uni-search-bar class="uni-mt-10" radius="5" placeholder="请输入名称查询" cancelButton="none"
@confirm="search" />
@confirm="search" @clear="clearSearch" />
</view>
<view v-if="popleType=='khName'">
<view class="shaixuan-box">
@ -61,11 +61,16 @@
</view>
</view>
</view>
<view style="overflow:scroll;" :style="{'margin-top':popleType == 'khName'? '350rpx':popleType == 'gysName'?'260rpx' :'110rpx'}">
<view style="overflow:scroll;" :style="{'margin-top':popleType == 'khName'? '350rpx':popleType == 'gysName'?'274rpx' :'110rpx'}">
<view v-if="popleType== 'khName' || popleType== 'gysName'" style="overflow:scroll;">
<view style="display: flex;width: 100%;line-height: 100rpx;text-align: center;background: #C6E2FF;color: #777;">
<view style="width: 50%;">欠款人数:<text style="color:red">{{allData.personCount?allData.personCount:0}}</text></view>
<view style="width: 50%;">欠款总金额:<text style="color:red">{{allData.amountOwed?allData.amountOwed:0}}</text></view>
<view v-if="popleType== 'gysName'" style="display: flex;width: 100%;line-height: 50rpx;text-align: center;background: #C6E2FF;color: #777;">
<view style="width: 33%;display: flex;flex-direction: column;"><text style="color:red">{{allData.personCount?allData.personCount:0}}</text><text>欠款人数</text></view>
<view style="width: 33%;display: flex;flex-direction: column;"><text style="color:red">{{allData.amountOwed?allData.amountOwed:0}}</text><text>欠款总额</text></view>
<view style="width: 33%;display: flex;flex-direction: column;"><text style="color:red">{{allData.purchasingCount?allData.purchasingCount:0}}</text><text>今日入库件数</text></view>
</view>
<view v-if="popleType== 'khName'" style="display: flex;width: 100%;line-height: 100rpx;text-align: center;background: #C6E2FF;color: #777;">
<view style="width: 50%;">欠款人数:<text style="color:red">{{allData.personCount?allData.personCount:0}}</text></view>
<view style="width: 50%;">欠款总额:<text style="color:red">{{allData.amountOwed?allData.amountOwed:0}}</text></view>
</view>
<!-- 供应商、客户走这一套 -->
<view class="list-1" v-for="item in popleList" :key="item" @tap="clickList(item)" :style="{'min-height': item.name == '散客' || item.consigneeName == '默认供应商' ?'80rpx':'240rpx'}"
@ -75,8 +80,13 @@
<text>{{item.consigneeMobile != 'undefined' &&item.consigneeMobile != null &&item.consigneeMobile != undefined ?item.consigneeMobile:'-'}}</text>
</view>
<view class="name-tel" style="width: 100%;" v-else>
<text style="line-height: 75rpx;">{{item.name}}<text v-if="item.notBuyDays!=null && item.name != '散客'">({{item.notBuyDays+'天未拿货'}})</text> </text>
<text v-if="item.name != '散客'">{{item.phone}}</text>
<text style="line-height: 75rpx;">
{{item.name}}
<text v-if="item.categoryName != null">({{item.categoryName}})</text>
</text>
<text v-if="item.name != '散客'">
{{item.phone}}
</text>
</view>
<view class="name-tel" style="width: 100%;display: flex;flex-direction: column;height:auto;font-size: 30rpx;">
<text>{{(item.name == '散客' || item.consigneeName == '默认供应商') && item.city != null && item.city != undefined?'-':item.province + item.city + item.area}}</text>
@ -94,6 +104,9 @@
<view v-if="popleType== 'gysName' && item.noEarn < 0 && userType == 0" style="color: red;position: absolute;top: 20rpx;right: 180rpx;font-size: 28rpx;">
余额:{{item.noEarn?Math.abs(item.noEarn) :0}}
</view>
<view v-if="item.notBuyDays!=null && item.name != '散客'" style="position: absolute;top: 70rpx;right: 180rpx;font-size: 28rpx;">
{{item.notBuyDays+'天未拿货'}}
</view>
<view class="name-edit" @tap.stop="toggle('huikuan',item)" style="top: 27rpx;">
充值
</view>
@ -572,6 +585,12 @@
this.popleList = []
this.getPeopleType()
},
clearSearch(){
this.pages = 1
this.searchName = ""
this.popleList = []
this.getPeopleType()
},
//查询拉包工和快递人员的列表
kdyOrlbgList() {
this.status = 'loading';
@ -616,6 +635,7 @@
this.pages = 1
this.popleList = []
this.khOrGysList()
this.getAllPeople()
this.tui.toast('充值成功')
this.keyboardNum = ''
this.$refs.inputDialog.close()
@ -639,7 +659,7 @@
},
goDetail(data){
uni.navigateTo({
url: "/pages/index/customAndSupplierProductDetail?popleType="+this.popleType+'&id='+data.id
url: "/package1/index/customAndSupplierProductDetail?popleType="+this.popleType+'&id='+data.id
})
},
//打开弹出层

233
package1/inventory/addGoods.vue

@ -10,39 +10,58 @@
<view v-if="formData.productPicture !=''">
<img :src="formData.productPicture" alt="" class="upload-img">
</view>
<u-upload :fileList="formData.productPicture" @afterRead="afterRead" @delete="deletePic" name="1" multiple
:maxCount="1"></u-upload>
<u-upload :fileList="formData.productPicture" @afterRead="afterRead" @delete="deletePic" name="1"
multiple :maxCount="1"></u-upload>
</uni-forms-item>
<uni-forms-item label="货号" name="productSn" required>
<uni-easyinput :clearable='false' type="text" v-model="formData.productSn" @blur="getSnIsRepeat" placeholder="请输入货号" trim="all" />
<uni-easyinput :clearable='false' type="text" v-model="formData.productSn" @blur="getSnIsRepeat"
placeholder="请输入货号" trim="all" />
<uni-icons type="refresh" color="#777" size='36' @tap="$refs.SNDialog.open('center')"></uni-icons>
</uni-forms-item>
<uni-forms-item label="采购价" name="price">
<input type="digit" class="content-input" v-model="formData.purchasePrice" @focus="obtainPrice($event,'purchasePrice')" @blur="changessPrice($event,'purchasePrice')" placeholder="请输入采购价">
<input type="digit" class="content-input" v-model="formData.purchasePrice"
@focus="obtainPrice($event,'purchasePrice')" @blur="changessPrice($event,'purchasePrice')"
placeholder="请输入采购价">
</uni-forms-item>
<uni-forms-item label="批发价" name="wholesalePrice">
<!-- <uni-easyinput type="digit" v-model="formData.wholesalePrice" placeholder="请输入批发价" trim="all" /> -->
<input type="digit" class="content-input" v-model="formData.wholesalePrice" @focus="obtainPrice($event,'wholesalePrice')" @blur="changessPrice($event,'wholesalePrice')" placeholder="请输入批发价">
<input type="digit" class="content-input" v-model="formData.wholesalePrice"
@focus="obtainPrice($event,'wholesalePrice')" @blur="changessPrice($event,'wholesalePrice')"
placeholder="请输入批发价">
</uni-forms-item>
<uni-forms-item label="分类" name="categoryId">
<!-- <uni-data-select class="uni-data-select" :localdata="categoryList" v-model="formData.categoryId"
placeholder="请选择分类" @change="categoryChange(formData.categoryId)"></uni-data-select> -->
<uni-forms-item label="商品分类" name="categoryId">
<view class="content-list">
<view class="list-val">
<input type="text" placeholder="请选择分类" disabled :value="typeItem.categoryName"
style="border-bottom: 1px solid #fff;text-align: center;"
@tap="goGategoryLow">
<input type="text" placeholder="请选择商品分类" disabled :value="typeItem.categoryName"
style="border-bottom: 1px solid #fff;text-align: center;" @tap="goGategoryLow">
<uni-icons type="right" size="16"
style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons>
</view>
</view>
</uni-forms-item>
<!-- <uni-forms-item label="客户价格" name="categoryId" v-if="customerCategoryList != null">
<view class="content-list">
<view class="list-val">
<input type="text" placeholder="根据客户分类自定义价格" disabled :value="formData.userCategoryName"
style="border-bottom: 1px solid #fff;text-align: center;" @tap="addCustomPrice">
<uni-icons type="right" size="16"
style="margin-left: 40rpx;line-height: 70rpx;"></uni-icons>
</view>
</view>
</uni-forms-item>
<view style="display: flex;" v-if="customerCategoryList != null">
<view class="" style="width: 28%;"></view>
<view class="" style="width: 72%;min-height: 80rpx;padding: 0 10px 20rpx 0;">
<view v-for="(item,index) in customerCategoryList" :key="index">
{{item.categoryName}}:{{item.categoryPrice}}
</view>
</view>
</view> -->
<uni-forms-item label="添加规格" name="categoryId">
<view class="content-list">
<view class="list-val">
<input type="text" placeholder="点击选择规格" disabled
style="border-bottom: 1px solid #fff;text-align: center;"
@tap="ejectRuleSelect">
style="border-bottom: 1px solid #fff;text-align: center;" @tap="ejectRuleSelect">
</view>
</view>
</uni-forms-item>
@ -51,7 +70,8 @@
{{item.attributeName}}
</view>
<view class="" style="width: 72%;min-height: 80rpx;padding: 0 10px 20rpx 0;">
<view v-for="(item1,index1) in item.productAttributeValueVoList" :key="index1" style="float: left;padding-right: 20rpx;">
<view v-for="(item1,index1) in item.productAttributeValueVoList" :key="index1"
style="float: left;padding-right: 20rpx;">
{{item1.value}}
</view>
</view>
@ -61,11 +81,13 @@
<u-icon name="camera" size="36" @tap.stop='scanCodeAdd'></u-icon>
</uni-forms-item>
<uni-forms-item label="多图上传" name="productPicture">
<view class="upload-img" @tap="pictureAdd" style="background: #eee;text-align: center;line-height: 160rpx;">
<view class="upload-img" @tap="pictureAdd"
style="background: #eee;text-align: center;line-height: 160rpx;">
<uni-icons type="camera" size="28" color="#777"></uni-icons>
</view>
<view style="overflow-x: scroll;display: flex;width: 350rpx;">
<view v-if="formData.productPictures !=''" v-for="(item,index) in formData.productPictures" :key="index" style="width: 160rpx;height: 160rpx;margin-left: 20rpx;">
<view v-if="formData.productPictures !=''" v-for="(item,index) in formData.productPictures"
:key="index" style="width: 160rpx;height: 160rpx;margin-left: 20rpx;">
<img :src="item.productPicture" alt="" class="upload-img">
</view>
</view>
@ -73,7 +95,8 @@
</uni-forms-item>
<uni-forms-item label="市场价" name="price">
<!-- <uni-easyinput type="digit" v-model="formData.price" placeholder="请输入零售价" trim="all" /> -->
<input type="digit" class="content-input" v-model="formData.price" @focus="obtainPrice($event,'price')" @blur="changessPrice($event,'price')" placeholder="请输入零售价">
<input type="digit" class="content-input" v-model="formData.price"
@focus="obtainPrice($event,'price')" @blur="changessPrice($event,'price')" placeholder="请输入零售价">
</uni-forms-item>
<uni-forms-item label="尾货预警" name="salesWeek">
<!-- <uni-easyinput type="digit" v-model="formData.salesWeek" placeholder="请输入零售价" trim="all" /> -->
@ -98,7 +121,8 @@
点击选择已有规则
</view>
<view style="width: 90%;margin: 0 auto;">
<view v-for="(item,index) in snList" @tap="generateSn(item.value)" :key="index" style="height: 80rpx;line-height: 80rpx;font-size: 28rpx;border-bottom: 1px solid #eee;display: flex;">
<view v-for="(item,index) in snList" @tap="generateSn(item.value)" :key="index"
style="height: 80rpx;line-height: 80rpx;font-size: 28rpx;border-bottom: 1px solid #eee;display: flex;">
<view style="width: 90%;">{{index + 1}} 、 {{item.text}}</view>
<uni-icons type="right" size="16" style="width: 10%;text-align: center;"></uni-icons>
</view>
@ -106,7 +130,8 @@
<view style="height: 80rpx;font-size: 36rpx;font-weight: bold;line-height: 80rpx;text-align: center;">
生成新规则
</view>
<view style="height: 80rpx;font-size: 22rpx;font-weight: bold;line-height: 80rpx;color:red;text-align: center;">
<view
style="height: 80rpx;font-size: 22rpx;font-weight: bold;line-height: 80rpx;color:red;text-align: center;">
*如生成新的货号规则,可在下方输入框新增
</view>
<view class="sn-content-list">
@ -145,11 +170,11 @@
<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>
<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"
<view class="content-low" :class="item1.checked?'checked':''"
v-for="(item1,index1) in item.list" :key="index1"
@tap.stop="isCheckPrec(item,item1.value,index1)">{{item1.value}}</view>
</view>
</li>
@ -202,12 +227,32 @@
</view>
</view>
</uni-popup>
<!-- 维护客户价格弹出层 -->
<uni-popup ref="customPopup" background-color="#fff">
<view class="popup-content" style="height: auto;max-height: 600rpx;margin-bottom: 0;">
<view v-for="(item,index) in customerCategoryList" :key="index">
<view style="height: 60rpx;line-height: 60rpx;">
{{item.categoryName}}
</view>
<input type="number" v-model='item.categoryPrice' placeholder="请输入客户价格" style="height: 60rpx;padding-left: 20rpx;border: 1px solid #eee;border-radius: 10rpx;">
</view>
<view @tap="updateCate" style="text-align:center;margin-top:20rpx;width: 100%;height: 60rpx;line-height: 60rpx;background: #088FEB;color: #fff;">
确认
</view>
</view>
</uni-popup>
<!-- 给供应商回款的弹层 -->
<uni-popup ref="warnPopup" background-color="#fff">
<view class="popup-content" style="width: 500rpx;height: 300rpx;">
<view class="popup-content" style="width: 500rpx;height: 510rpx;">
<view style="font-size: 36rpx;font-weight: bold;text-align: center;">提示</view>
<view style="width:100%;font-weight:bold;text-align: center;font-size: 28rpx;margin: 20rpx 0;">
您维护采购价后,现在有{{(guigeNum * differencePurchasePrice).toFixed(2)}}的差额,是否自动给供应商“{{dataList.supplierName}}”回款?
<view
style="width:100%;font-weight:bold;font-size: 28rpx;line-height: 40rpx;margin: 20rpx 0;display: flex;flex-direction: column;">
<text>历次入库总数量:{{guigeNum}}</text>
<text style="margin: 20rpx 0;">差价:{{guigeNum}} * ({{oldPurchasePrice}} - {{formData.purchasePrice}})
= {{zPrice}}</text>
<view>是否使用此<input type="text" v-model="zPrice"
style="width: 150rpx;border-bottom:1px solid #000;color:red;text-align:center;display: inline-block;">
(金额可修改)金额,给供应商“{{dataList.supplierName}}”回款?</view>
</view>
<view class="popup-bottom" style="position: absolute;">
<view class="popup-bottom-left">
@ -240,7 +285,7 @@
productName: '',
price: 0,
productSn: '',
purchasePrice:'',
purchasePrice: 0,
wholesalePrice: 0,
productPicture: '',
productIntro: '',
@ -385,12 +430,15 @@
guigeNum: 0, //总共有多少件库存
differencePurchasePrice: 0, //旧采购价和新维护采购价的差额差额
oldPurchasePrice: 0,
userType: '',
typeItem: {},
arrtChange: [],
categoryId: '',
dataList: [],
zPrice: 0,
type: 'add',
customerCategoryList:[],
multipleList: [],
rules: {
categoryId: {
@ -474,7 +522,8 @@
}, false, true).then((res) => {
if (res.code == 200) {
this.type = 'edit'
this.customerCategoryList = JSON.parse(res.result.customerCategoryRule)
console.log('customerCategoryList',this.customerCategoryList)
this.formData.attrId = res.result.attrId
this.formData.productName = res.result.productName
this.formData.barcode = res.result.barcode
@ -494,8 +543,11 @@
this.tui.toast(res.message)
}
}).catch((res) => {})
}else{
this.getCustomerCategoryList()
}
this.userType = uni.getStorageSync('type')
this.getGategoryList()
this.getSnList()
},
@ -551,7 +603,7 @@
supplierCollection() {
this.tui.request('/app/debt/recharge', "post", {
userId: this.dataList.supplierId,
amountOwed:(this.guigeNum * this.differencePurchasePrice).toFixed(2),
amountOwed: this.zPrice,
userType: '1'
}, false, false).then((res) => {
if (res.code == 200) {
@ -563,6 +615,31 @@
}
})
},
//获取客户分类
getCustomerCategoryList(){
this.tui.request("/app/customerCategory/getCustomerCategoryListByShopId", "POST", {
shopId:uni.getStorageSync('shopId')
}, false, true).then((res) => {
if (res.code == 200) {
if(res.result.length > 0){
this.customerCategoryList = res.result
for(let i=0;i<this.customerCategoryList.length;i++){
let data = {
categoryName:this.customerCategoryList[i].categoryName,
categoryId:this.customerCategoryList[i].id,
categoryPrice:""
}
this.customerCategoryList[i] = data
}
}else{
this.customerCategoryList = null
}
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
//进入页面,查询货号列表
getSnList() {
// snList
@ -593,9 +670,19 @@
}, false, true).then((res) => {
if (res.code == 200) {
if (res.result.length > 0) {
console.log(this.formData.categoryId)
if(this.formData.categoryId != '' && this.formData.categoryId != undefined){
for(let i=0;i<res.result.length;i++){
if(res.result[i].id == this.formData.categoryId){
this.typeItem = res.result[i]
}
}
}else{
this.typeItem = res.result[0]
this.formData.categoryId = this.typeItem.id
}
}
} else {
this.tui.toast(res.message)
}
@ -643,6 +730,7 @@
})
for (let i = 0; i < lists.length; i++) {
console.log(lists[i].url)
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
@ -663,19 +751,37 @@
this.formData.purchasePrice = ''
}
},
addCustomPrice(){
this.$refs.customPopup.open()
},
generateSn(value) {
this.tui.request("/app/productSn/getNewProductSn", "POST", {
snPre: value
}, false, true).then((res1) => {
if (res1.code == 200) {
this.tui.request('/app/product/getByProductSn', "post", {
productSn: res1.result
}, false, true).then((res) => {
if (res.code == 200) {
this.formData.productSn = res.result
if (res.result != '') {
this.generateSn(value)
} else {
this.formData.productSn = res1.result
this.$forceUpdate()
}
}
})
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
this.$refs.SNDialog.close()
},
updateCate(){
this.$refs.customPopup.close()
this.$forceUpdate()
},
async startGetSn() {
var that = this;
if (this.prefixRule == '') {
@ -698,7 +804,8 @@
content: "货号已经被删除,是否重新启用?",
success: function(res) {
if (res.confirm) {
that.tui.request("/app/productSn/useAgainProductSn", "POST", {
that.tui.request("/app/productSn/useAgainProductSn",
"POST", {
id: res1.result.id
}, false, true).then((res2) => {
if (res2.code == 200) {
@ -706,7 +813,8 @@
setTimeout(res => {
that.$refs.SNDialog.close()
that.getSnList()
that.generateSn(this.prefixRule)
that.generateSn(this
.prefixRule)
}, 1000)
} else {
that.tui.toast(res2.message)
@ -832,6 +940,12 @@
if (e.target.value == '') {
this.formData.purchasePrice = this.linshiPrice
} else {
this.formData.purchasePrice = e.target.value
console.log('改变', this.formData)
if (this.dataList == '') {
uni.hideLoading()
return
}
this.differencePurchasePrice = Number(this.oldPurchasePrice) - Number(e.target.value)
this.tui.request("/app/purchase/getPurchaseListByProductId", "post", {
productId: this.dataList.id,
@ -843,19 +957,24 @@
for (let i = 0; i < res.result.records.length; i++) {
this.guigeNum += Number(res.result.records[i].purchase.totalAmount)
}
setTimeout(res => {
this.zPrice = this.guigeNum * this.differencePurchasePrice
if (this.zPrice != 0) {
this.$refs.warnPopup.open()
}
uni.hideLoading()
},1000)
}, 300)
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
this.formData.purchasePrice = e.target.value
}
}
}
uni.hideLoading()
}
},
toggle(index) {
@ -865,9 +984,14 @@
uploadFilePromise(url) {
let that = this;
return new Promise((resolve, reject) => {
uni.compressImage({
src: url,
quality: 50,
success: res => {
let a = uni.uploadFile({
url: that.tui.interfaceUrl() + '/upload/file',
filePath: url,
filePath: res.tempFilePath,
name: 'file',
header: {
"content-type": "multipart/form-data",
@ -881,6 +1005,9 @@
this.formData.productPicture = path.result
}
});
}
})
})
},
categoryChange(e) {
@ -906,7 +1033,8 @@
for (let m = 0; m < this.multipleList[0].productAttributeValueVoList.length; m++) {
let isTrue = true
for (let i = 0; i < this.defaultList[0].list.length; i++) {
if(this.defaultList[0].list[i].value == this.multipleList[0].productAttributeValueVoList[m].value){
if (this.defaultList[0].list[i].value == this.multipleList[0].productAttributeValueVoList[m]
.value) {
isTrue = false
this.defaultList[0].list[i].checked = true
} else {
@ -921,7 +1049,8 @@
for (let m = 0; m < this.multipleList[1].productAttributeValueVoList.length; m++) {
let isTrue = true
for (let i = 0; i < this.defaultList[1].list.length; i++) {
if(this.defaultList[1].list[i].value == this.multipleList[1].productAttributeValueVoList[m].value){
if (this.defaultList[1].list[i].value == this.multipleList[1].productAttributeValueVoList[m]
.value) {
isTrue = false
this.defaultList[1].list[i].checked = true
} else {
@ -950,7 +1079,6 @@
url = '/app/product/edit'
this.formData.id = that.dataList.id
this.formData.stockCount = that.dataList.stockCount
this.formData.purchasePrice = that.dataList.purchasePrice
this.formData.supplierId = that.dataList.supplierId
this.formData.supplierName = that.dataList.supplierName
this.formData.delFlag = that.dataList.delFlag
@ -958,13 +1086,14 @@
url = '/app/product/save'
if (this.userType == 1) {
this.formData.purchasePrice = ''
}else{
this.formData.purchasePrice = 0
}
}
if (res.productPicture == '') {
res.productPicture = ''
}
if(this.customerCategoryList != null){
this.formData.customerCategoryRule = JSON.stringify(this.customerCategoryList)
}
this.formData.productCategoryVo = {
productAttributeOfAddVos: this.multipleList.length > 0 ? this.multipleList : [{
attributeName: '颜色',
@ -980,6 +1109,7 @@
}]
}]
}
console.log('purchasePrice', this.formData)
that.tui.request(url, "post", this.formData, false, false).then((res1) => {
if (res1.code == 200) {
if (that.dataList != '') { //编辑商品
@ -1082,7 +1212,8 @@
}, false, true).then((res1) => {
if (res1.code == 200) {
if (res1.result != '') {
that.tui.toast('当前条码已被商品:“'+res1.result[0].productName+'”占用,请重新输入')
that.tui.toast('当前条码已被商品:“' + res1.result[0].productName +
'”占用,请重新输入')
} else {
that.formData.barcode = res.result;
}
@ -1129,7 +1260,8 @@
for (var i = 0; i < this.multipleList.length; i++) {
if (this.multipleList[i].attributeName == item.name) { //同种分类
for (var m = 0; m < this.multipleList[i].productAttributeValueVoList.length; m++) {
if(this.multipleList[i].productAttributeValueVoList[m].value == item.list[index].value){ //规格相同
if (this.multipleList[i].productAttributeValueVoList[m].value == item.list[index]
.value) { //规格相同
this.multipleList[i].productAttributeValueVoList.splice(m, 1)
return;
} else { //规格不同
@ -1194,6 +1326,7 @@
float: left;
font-size: 25rpx;
}
.formBox {
margin: 20rpx;
padding: 20rpx 26rpx;
@ -1221,19 +1354,23 @@
}
}
}
.upload-img {
width: 160rpx;
height: 160rpx;
}
.checked {
background: #60F3FF !important;
color: #fff !important;
border-radius: 5px !important;
}
.content-list {
height: 70rpx;
border: 1px solid #eee;
}
.sn-content-list {
width: 95%;
margin: 0 auto;
@ -1246,6 +1383,7 @@
border-bottom: none;
height: auto;
}
.sn-list-name {
width: 200rpx;
text-align: left;
@ -1259,6 +1397,7 @@
height: 80rpx;
line-height: 80rpx;
}
.sn-list-val input {
width: 400rpx;
height: 60rpx;
@ -1269,6 +1408,7 @@
padding-left: 20rpx;
border-bottom: 1px solid #088FEB;
}
button {
height: 90rpx;
line-height: 90rpx;
@ -1277,6 +1417,7 @@
background: #5fd9ee;
border-radius: 10px;
}
.content-input {
width: auto;
position: relative;
@ -1289,6 +1430,7 @@
padding-left: 20rpx;
border-radius: 5px;
}
.add-popup-content {
align-items: center;
justify-content: center;
@ -1323,11 +1465,13 @@
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%;
@ -1336,6 +1480,7 @@
line-height: 70rpx;
}
}
.content-fur {
padding-bottom: 25rpx;
}
@ -1352,6 +1497,7 @@
margin: 20rpx 0 0 20rpx;
border-radius: 5px;
}
.type-popup {
width: 500rpx;
height: auto;
@ -1360,6 +1506,7 @@
position: relative;
margin-bottom: 40rpx;
}
.popup-content {
align-items: center;
justify-content: center;
@ -1375,6 +1522,7 @@
background: #fff;
height: 50rpx;
}
.popup-bottom {
width: 95%;
height: 100rpx;
@ -1395,6 +1543,7 @@
width: 50%;
line-height: 100rpx;
}
.bottom-btn {
width: 70%;
line-height: 35px;

37
package1/inventory/inventoryConfirm.vue

@ -30,56 +30,63 @@
<view class="tui-price-large">{{zhiqianqiankuan == null ?'暂无':Math.abs(zhiqianqiankuan) }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" v-if="userType == 0&&zhiqianqiankuan < 0" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-price-flex tui-size32" v-if="userType == 0&&zhiqianqiankuan < 0 && aiinventory != 2" 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">{{zhiqianqiankuan == null ?'暂无':Math.abs(zhiqianqiankuan) }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" v-if="userType == 0" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-price-flex tui-size32" v-if="userType == 0 && aiinventory != 2" 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" v-if="userType == 0" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-price-flex tui-size32" v-if="userType == 0 && aiinventory != 2" 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" v-if="yuedikou != 0 && userType == 0" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-price-flex tui-size32" v-if="userType == 0 && aiinventory == 2" 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" v-if="yuedikou != 0 && userType == 0 && aiinventory != 2" 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">{{yuedikou == null ?'暂无':yuedikou }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" v-if="leijiqiankuan > 0 && userType == 0" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-price-flex tui-size32" v-if="leijiqiankuan > 0 && userType == 0 && aiinventory != 2" 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">{{leijiqiankuan == null ?'暂无':leijiqiankuan }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" v-if="leijiqiankuan < 0 && userType == 0" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-price-flex tui-size32" v-if="leijiqiankuan < 0 && userType == 0 && aiinventory != 2" 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">{{leijiqiankuan == null ?'暂无':Math.abs(leijiqiankuan) }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" v-if="purchase.noPay >= 0 && userType == 0" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-price-flex tui-size32" v-if="purchase.noPay >= 0 && userType == 0 && aiinventory != 2" 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.noPay == null ?'暂无':purchase.noPay }}</view>
</view>
</view>
<view class="tui-price-flex tui-size32" v-if="purchase.noPay < 0 && userType == 0" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-price-flex tui-size32" v-if="purchase.noPay < 0 && userType == 0 && aiinventory != 2" style="height: 80rpx;line-height: 80rpx;">
<view class="tui-flex-shrink">本次余额</view>
<view class="tui-goods-price">
<view class="tui-size-24">¥</view>
@ -97,7 +104,7 @@
<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>
<view style="font-size: 13px;width: 200px;height: 40rpx;overflow: hidden;text-align: right;">{{ purchase.remark == null ?'':purchase.remark}}</view>
<text style="color: blue;">查看更多</text>
</uni-tooltip>
</view>
@ -115,7 +122,7 @@
export default {
data() {
return {
purchase:'',
purchase:{},
purchaseDetails:'',
aiinventory:0, //1是AI入库 0是普通入库 2采购退货
userType:1,
@ -137,7 +144,15 @@
}
},
onLoad(option) {
this.aiinventory = option.aiinventory
if(option.aiinventory == 2){
uni.setNavigationBarTitle({
title:'采购退货确认'
});
}
this.purchaseDetails = JSON.parse(option.purchaseDetails)
console.log('purchase',option.purchase)
console.log('purchaseDetails',this.purchaseDetails)
if(this.purchaseDetails != '' && uni.getStorageSync('type') == 0){
for(let i=0;i<this.purchaseDetails.length;i++){
@ -155,7 +170,7 @@
}
}
this.purchase = JSON.parse(option.purchase)
this.aiinventory = option.aiinventory
this.userType = uni.getStorageSync('type')
this.yuedikou = option.yuedikou

Loading…
Cancel
Save