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.
995 lines
28 KiB
995 lines
28 KiB
<template>
|
|
<view class="page1">
|
|
<view style="position: fixed;top: 0;z-index: 99;height: 70px;width: 100%;display: flex;background: #fff;padding-top: 30px;">
|
|
<uni-icons type="left" size='10' @tap="backPage"></uni-icons>
|
|
<view class="top-btn" style="float: left;" @tap="clearSearch">
|
|
清空
|
|
</view>
|
|
<view class="top-btn" @tap="goKaiDan" v-if="inStorageStatus != 8">
|
|
新增入库
|
|
</view>
|
|
<view class="top-btn" @tap="goKaiDan('8')" v-else>
|
|
新增图片入库
|
|
</view>
|
|
<view style="display: flex;">
|
|
<view class="color-box">
|
|
<view class="color-piece" style="background:#777;"> </view> 已作废
|
|
<view class="color-piece" style="background:#87CEFA;"> </view> 已入库
|
|
</view>
|
|
</view>
|
|
<view v-if="inStorageStatus==8" style="color:red;line-height: 30px;margin-left: 20px;">
|
|
*下拉刷新列表
|
|
</view>
|
|
</view>
|
|
<view style="position: fixed;top: 70px;z-index: 99;width:100%;height: 40px;background: #fff;">
|
|
<view style="width: 40%;line-height: 40px;float: left;height: 40px;">
|
|
<uni-datetime-picker style="margin-bottom:10px;" v-model="range" type="daterange"
|
|
@change="searchList" />
|
|
</view>
|
|
<view style="width: 25%;display: flex;line-height: 40px;float: left;">
|
|
供应商:<uni-easyinput @input="sreachName($event)" @focus="inputFocus($event)" v-model="customName"
|
|
placeholder="按供应商搜索" @clear="clearSreach" style="border:1px solid #eee;height: 30px;margin-top: 5px;flex: 1;"></uni-easyinput>
|
|
</view>
|
|
<view style="width: 25%;display: flex;line-height: 40px;float: left;">
|
|
状态:<!-- <input type="text" style="border:1px solid #eee;height: 50px;width: 150px;"> -->
|
|
<uni-data-select class="uni-data-select" :localdata="statusList" v-model="listStatus"
|
|
placeholder="订单状态" @change="getCancelOrder">
|
|
</uni-data-select>
|
|
</view>
|
|
<view @tap="faBookShow = false" v-if="faBookShow"
|
|
style="z-index:98;position: fixed;top: 0;left: 0;width: 100%;height: 100%;">
|
|
<view class="book-mask" v-if="faBookShow">
|
|
<view v-if="customList.length == 0"
|
|
style="color: #777;width: 100%;height: 50px;line-height: 50px;text-align: center;">
|
|
暂无匹配项
|
|
</view>
|
|
<view v-for="(item,index) in customList" :key="index" @tap="checkName(item)" v-else
|
|
style="height: 50px;line-height: 50px;">
|
|
{{item.consigneeName}}
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="table" style="margin-top: 120px;overflow: scroll;">
|
|
<view class="table-content">
|
|
<view class="table-th">
|
|
<view style="width: 5%;">操作</view>
|
|
<view @tap.stop="changeSort" style="position: relative;width: 10%;">
|
|
入库时间
|
|
<uni-icons type="up" size="7" v-if="timeOrder == 1"
|
|
style="position: absolute;top: 0;right: 15px;"></uni-icons>
|
|
<uni-icons type="down" size="7" v-if="timeOrder == 0"
|
|
style="position: absolute;top: 0;right: 15px;"></uni-icons>
|
|
</view>
|
|
<view style="width: 15%;">供应商</view>
|
|
<view style="width: 10%;">订单状态</view>
|
|
<view style="width: 10%;">总数</view>
|
|
<view style="width: 15%;">总成本</view>
|
|
<view style="width: 15%;">欠款</view>
|
|
<view style="width: 10%;">操作人</view>
|
|
<view style="width: 10%;">操作时间</view>
|
|
</view>
|
|
<view class="table-tr" v-for="(item,index) in list" :key="index"
|
|
:style="{'background':item.delFlag == '1'?'#777':item.inStorageStatus == '1'?'#87CEFA':'#FFFFE0'}">
|
|
<view style="width: 5%;background: #fff;">
|
|
<uni-icons @tap.stop="changeShowBtn(index)" type="list" color="#777" size='7'></uni-icons>
|
|
<view v-if="item.isShowBtn" @tap="closeMask(index)" style="position: fixed;top:0;z-index: 98;width: 100%;height:100%;opacity: 1;"></view>
|
|
<view v-if="item.isShowBtn"
|
|
style="width: auto;height: 40px;background: #777;position: absolute;bottom: -40px;left: 20px;z-index: 99;border: 1px solid #eee;border-radius: 10px;padding-top: 5px;">
|
|
<view v-if="item.inStorageStatus!= 0 && inStorageStatus !=8 && item.delFlag != 1 && type==0 && storeFlag != 1" class="operate-btn"
|
|
@tap.stop="returnPrice(item,index)" style="background:#088FEB;">
|
|
撤销
|
|
</view>
|
|
<view v-if="item.inStorageStatus!= 0 && inStorageStatus !=8 && item.delFlag != 1 && type==0 && storeFlag != 1" class="operate-btn" @tap.stop="cancelOrder(item)"
|
|
style="background:#FF9797;">
|
|
撤销并复制
|
|
</view>
|
|
<view class="operate-btn" v-if="inStorageStatus != 8" @tap="goDetail(item.id,item.userId,index)"
|
|
style="background:#6A5ACD;">
|
|
查看详情
|
|
</view>
|
|
<view v-if="storeFlag == 1 && item.delFlag != 1" class="operate-btn"
|
|
@tap.stop="goConfirm(item)" style="background:#088FEB;">
|
|
去确认
|
|
</view>
|
|
<view v-if="item.inStorageStatus== 0 && type==0 && storeFlag != 1" class="operate-btn"
|
|
@tap.stop="goDetail(item)" style="background:#088FEB;">
|
|
更新
|
|
</view>
|
|
<view v-if="item.delFlag == 1 && type==0" class="operate-btn"
|
|
@tap.stop="goSaleGoods(item)" style="background:#088FEB;">
|
|
重新入库
|
|
</view>
|
|
<view v-if="inStorageStatus == 8" class="operate-btn"
|
|
@tap.stop="delItem(item.id)" style="background:#088FEB;">
|
|
删除
|
|
</view>
|
|
<view v-if="(item.inStorageStatus == 2 || item.inStorageStatus == 3 || item.inStorageStatus == 4) && item.delFlag != 1 && storeFlag != 1 && inStorageStatus != 8" class="operate-btn"
|
|
@tap.stop="goSaleGoods(item)" style="background:#088FEB;">
|
|
AI入库
|
|
</view>
|
|
<view v-if="inStorageStatus == 8" class="operate-btn"
|
|
@tap.stop="montageData(item.id)" style="background:#088FEB;">
|
|
去入库
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view style="overflow: hidden;width: 10%;" @tap.stop="showTime(item.createTime)">
|
|
{{item.createTime | sliceTime}}
|
|
</view>
|
|
<view style="width: 15%;overflow: hidden;">{{item.supplierName == null ?'暂无':item.supplierName}}</view>
|
|
<view style="width: 10%;">
|
|
{{item.delFlag == 1 ?'已撤销':item.inStorageStatus == 0 ?'未入库' :item.inStorageStatus == 1 ?'已入库':item.inStorageStatus == 2 ?'AI识别中...':item.inStorageStatus == 3 || (item.inStorageStatus == 4 && item.ocrCount > 0) ?'AI识别完成':item.ocrCount == 0 && item.inStorageStatus == 4?'AI识别失败':'暂无'}}
|
|
</view>
|
|
<view style="width: 10%;">{{item.totalAmount == null ?'暂无':item.totalAmount}}</view>
|
|
<view style="width: 15%;">{{item.shouldPay == null ?'暂无':item.shouldPay}}</view>
|
|
<view style="width: 15%;">{{item.noPay == null ?'暂无':item.noPay}}</view>
|
|
<view style="width: 10%;">{{item.createByName == null ?'暂无':item.createByName}}</view>
|
|
<view style="width: 10%;">{{item.purchaseTime == null ?'暂无':item.purchaseTime}}</view>
|
|
</view>
|
|
<u-loadmore :status="status" />
|
|
</view>
|
|
</view>
|
|
<!-- 弹出入库页弹窗 -->
|
|
<uni-popup ref="RKDialog" background-color="#fff" :is-mask-click="true">
|
|
<view class="type-popup"
|
|
style="width:100%;overflow: scroll;margin-bottom: 0;border-radius: 0;" :style="{'height': screenHeight+'px'}">
|
|
<inventory-page ref="childRef" :screenWidth='screenWidth' :screenHeight='screenHeight' :khName='khName' @update:khName="handleUpdateKhName"
|
|
:parentClosePage='parentClosePage' :noEarn="noEarn" :zhiqianqiankuan="zhiqianqiankuan"></inventory-page>
|
|
</view>
|
|
</uni-popup>
|
|
|
|
</view>
|
|
</template>
|
|
<script>
|
|
import inventoryPage from '@/package1/AI/voiceInventoryHeng.vue';
|
|
export default {
|
|
data() {
|
|
return {
|
|
screenWidth:0,
|
|
screenHeight:0,
|
|
lableIndex:0,
|
|
categoryList: {},
|
|
searchStr: '',
|
|
zhiqianqiankuan: 0,
|
|
list: [],
|
|
khName: [],
|
|
inStorageStatus: '',
|
|
supplierName: '',
|
|
startDate: '',
|
|
endDate: '',
|
|
noDaysort: false,
|
|
customId: '',
|
|
customName: '',
|
|
faBookShow: false,
|
|
type: '',
|
|
cancel: false,
|
|
pages: 1,
|
|
listStatus: '',
|
|
customList: [],
|
|
carList1:[],
|
|
statusList: [{
|
|
value: 1,
|
|
text: "作废"
|
|
}, {
|
|
value: 2,
|
|
text: "已入库"
|
|
}],
|
|
pageNum: 1,
|
|
status: 'loadmore',
|
|
range: [],
|
|
storeFlag: "",
|
|
purchaseDetails:[],
|
|
detailToDel:''
|
|
}
|
|
},
|
|
filters: {
|
|
sliceTime(val) {
|
|
var name = ''
|
|
if (typeof(val) == 'string') {
|
|
name = val.split(' ')[0];
|
|
}
|
|
return name;
|
|
}
|
|
},
|
|
components: {
|
|
inventoryPage
|
|
},
|
|
onLoad(option) {
|
|
this.inStorageStatus = option.inStorageStatus || ''
|
|
this.storeFlag = option.storeFlag || ""
|
|
this.type = uni.getStorageSync('type')
|
|
this.detailToDel = option.detailToDel
|
|
console.log(option.item)
|
|
console.log(JSON.parse(option.item))
|
|
if(option.detailToDel == 1){
|
|
this.cancelOrder(JSON.parse(option.item))
|
|
}
|
|
},
|
|
onShow() {
|
|
// 同步方式获取屏幕信息
|
|
const systemInfo = uni.getSystemInfoSync();
|
|
this.screenWidth = systemInfo.screenWidth
|
|
this.screenHeight = systemInfo.screenHeight
|
|
console.log('屏幕宽度:', systemInfo.screenWidth);
|
|
console.log('屏幕高度:', systemInfo.screenHeight);
|
|
console.log('可使用窗口宽度:', systemInfo.windowWidth);
|
|
console.log('可使用窗口高度:', systemInfo.windowHeight);
|
|
console.log('设备像素比:', systemInfo.pixelRatio);
|
|
this.carList1 = []
|
|
uni.authorize({
|
|
scope: 'scope.record',
|
|
success() {
|
|
|
|
},
|
|
fail() {
|
|
this.tui.toast("您未授权,语音功能可能会出现错误")
|
|
}
|
|
})
|
|
uni.authorize({
|
|
scope: 'scope.writePhotosAlbum',
|
|
success() {
|
|
|
|
},
|
|
fail() {
|
|
this.tui.toast("您未授权,图片上传功能可能会出现错误")
|
|
}
|
|
})
|
|
uni.showLoading({
|
|
title: '加载中...'
|
|
})
|
|
let that = this,
|
|
isTrue = false
|
|
|
|
if (uni.getStorageSync('khName') != '') {
|
|
this.khName = JSON.parse(uni.getStorageSync('khName'))
|
|
} else {
|
|
this.khName = JSON.parse(JSON.stringify(this.khName)) || ''
|
|
}
|
|
console.log('供应商', this.khName)
|
|
if (this.khName != '') {
|
|
if (this.khName.noEarn != null && this.zhiqianqiankuan != this.khName.noEarn) {
|
|
isTrue = true
|
|
}
|
|
if (this.khName.noEarn == null) {
|
|
this.zhiqianqiankuan = 0
|
|
} else {
|
|
this.zhiqianqiankuan = this.khName.noEarn
|
|
}
|
|
}
|
|
setTimeout(res => {
|
|
this.getByCondition()
|
|
}, 500);
|
|
this.$nextTick(() => {
|
|
uni.removeStorageSync('khName')
|
|
this.$forceUpdate()
|
|
})
|
|
if (uni.getStorageSync('noReload') == true) {
|
|
uni.removeStorageSync('noReload')
|
|
} else {
|
|
this.list = []
|
|
this.pageNum = 1
|
|
this.getList()
|
|
}
|
|
|
|
},
|
|
onReachBottom() {
|
|
if (this.inStorageStatus != 0) {
|
|
if (this.pageNum >= this.pages) return;
|
|
this.status = 'loading';
|
|
this.pageNum += 1;
|
|
|
|
if (this.cancel == true) {
|
|
this.getList("1");
|
|
} else {
|
|
this.getList();
|
|
}
|
|
}
|
|
},
|
|
onPullDownRefresh(){
|
|
this.pageNum = 1
|
|
this.list = []
|
|
this.getList()
|
|
},
|
|
methods: {
|
|
// 取消订单
|
|
cancelOrder(item) {
|
|
let that = this;
|
|
// await this.getReturnOrder(item.id)
|
|
if(this.detailToDel == 1){
|
|
that.cancelOk(item)
|
|
}else{
|
|
this.tui.modal("提示", "您确定要撤销此采购单吗?", true, (res) => {
|
|
if (res) {
|
|
that.cancelOk(item)
|
|
}
|
|
})
|
|
}
|
|
|
|
},
|
|
// 取消订单
|
|
cancelOk(item) {
|
|
let that = this;
|
|
that.tui.request('/app/purchase/cancelPurchase', "POST", {
|
|
id: item.id
|
|
}, true, true).then((res1) => {
|
|
if (res1.code == 200) {
|
|
that.goSaleGoods(item)
|
|
} else {
|
|
that.tui.toast(res.message)
|
|
}
|
|
}).catch((res1) => {})
|
|
},
|
|
sliceMsg(val) {
|
|
var name = ''
|
|
if (typeof(val) == 'string') {
|
|
let newObj = JSON.parse(val)
|
|
for (let as in newObj) {
|
|
name += newObj[as] + '/'
|
|
}
|
|
}
|
|
return name;
|
|
},
|
|
handleUpdateKhName(newKhName) {
|
|
this.khName = []; // 父组件更新数据
|
|
this.zhiqianqiankuan = 0
|
|
},
|
|
getCancelOrder(type) {
|
|
console.log('啊啊啊啊啊啊', type)
|
|
this.pageNum = 1
|
|
this.list = []
|
|
if (type == "1") {
|
|
this.cancel = true
|
|
} else {
|
|
this.cancel = false
|
|
}
|
|
this.getList(type)
|
|
},
|
|
//删除单条入库单
|
|
delItem(id){
|
|
let that = this;
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "确定要删除此条AI识别记录吗?",
|
|
success: function(res2) {
|
|
if (res2.confirm) {
|
|
that.tui.request("/app/purchase/delById", "POST", {
|
|
id:id
|
|
}, false, true).then((res) => {
|
|
if(res.code == 500 && res.message == '删除成功!'){
|
|
that.pageNum = 1
|
|
that.aiList = []
|
|
that.getList()
|
|
setTimeout(res => {
|
|
that.tui.toast("删除成功")
|
|
}, 500)
|
|
}else{
|
|
that.tui.toast(res.message)
|
|
}
|
|
}).catch((res) => {
|
|
that.tui.toast(res.message)
|
|
})
|
|
}
|
|
}
|
|
})
|
|
},
|
|
async montageData(id){
|
|
await this.tui.request("/app/purchase/getPurchaseAllDataOfAi?id=" + id, "POST", {}, false, false)
|
|
.then((res) => {
|
|
this.purchaseDetails = res.result.purchaseDetails
|
|
uni.setStorageSync('AiInventoryId', res.result.purchase.id)
|
|
for(let i=0;i<this.purchaseDetails.length;i++){
|
|
let data = {
|
|
id: this.purchaseDetails[i].id,
|
|
price: this.purchaseDetails[i].price,
|
|
productCount: 0,
|
|
categoryId:this.purchaseDetails[i].categoryId || this.categoryList.categoryId,
|
|
categoryName:this.purchaseDetails[i].categoryName || this.categoryList.categoryName,
|
|
wholesalePrice: this.purchaseDetails[i].wholesalePrice,
|
|
purchasePrice:this.purchaseDetails[i].purchasePrice,
|
|
isNew: this.purchaseDetails[i].productId==null?true:false,
|
|
productId:this.purchaseDetails[i].productId,
|
|
productName: this.purchaseDetails[i].productName,
|
|
productSn: this.purchaseDetails[i].productSn,
|
|
productPicture: this.purchaseDetails[i].productPicture,
|
|
supplierName: this.purchaseDetails[i].supplierName,
|
|
saleDetailQueryDTO: []
|
|
}
|
|
for(let m=0;m<this.purchaseDetails[i].stockLogList1.length;m++){
|
|
let list = {
|
|
attributeList: this.getAttribute(this.purchaseDetails[i].stockLogList1[m].attributeList),
|
|
productCount:this.purchaseDetails[i].stockLogList1[m].productCount || this.purchaseDetails[i].stockLogList1[m].productCounts,
|
|
productNum:'',
|
|
name: this.sliceMsg(this.getAttribute(this.purchaseDetails[i].stockLogList1[m].attributeList)),
|
|
price: this.purchaseDetails[i].stockLogList1[m].purchasePrice
|
|
}
|
|
data.productCount += this.purchaseDetails[i].stockLogList1[m].productCount
|
|
data.saleDetailQueryDTO.push(list)
|
|
}
|
|
this.carList1.push(data)
|
|
|
|
}
|
|
}).catch((res) => {})
|
|
|
|
await setTimeout(res => {
|
|
uni.setStorageSync('carList1', JSON.stringify(this.carList1))
|
|
uni.setStorageSync('thisInStorageStatus',this.inStorageStatus)
|
|
this.$refs.RKDialog.open('bottom')
|
|
this.$refs.childRef.chushihua();
|
|
this.carList1 = []
|
|
}, 1000)
|
|
|
|
},
|
|
|
|
getAttribute(str){
|
|
str = str.replace(/"色"(?![^{]*": *"色")/g, '"均色"');
|
|
str = str.replace(/"码"(?![^{]*": *"码")/g, '"均码"');
|
|
return str
|
|
},
|
|
//带参数跳转到入库页
|
|
async goSaleGoods(item) {
|
|
let dataList = []
|
|
this.khName = []
|
|
this.zhiqianqiankuan = 0
|
|
await this.tui.request('/app/purchase/getPurchaseAllData', "POST", {
|
|
id: item.id
|
|
}, false, true).then((res1) => {
|
|
if (res1.code == 200) {
|
|
if (!res1.result.purchaseDetails) {
|
|
res1.result.purchaseDetails = []
|
|
}
|
|
if (res1.result.purchaseDetails) {
|
|
for (let i = 0; i < res1.result.purchaseDetails.length; i++) {
|
|
|
|
let obj = {}
|
|
let attrMap = new Map()
|
|
let newSaleDetailDTOList = []
|
|
let num = 0
|
|
|
|
for (let m = 0; m < res1.result.purchaseDetails[i].stockLogList1.length; m++) {
|
|
if (attrMap.has(res1.result.purchaseDetails[i].stockLogList1[m]
|
|
.attributeList) == true) {
|
|
let hasCount = attrMap.get(res1.result.purchaseDetails[i]
|
|
.stockLogList1[m].attributeList)
|
|
newSaleDetailDTOList[hasCount].productCount = Number(
|
|
newSaleDetailDTOList[hasCount]
|
|
.productCount) + Number(res1.result.purchaseDetails[i]
|
|
.stockLogList1[m].productCount)
|
|
} else {
|
|
res1.result.purchaseDetails[i].stockLogList1[m].name = this.sliceMsg(
|
|
res1.result.purchaseDetails[i]
|
|
.stockLogList1[m].attributeList)
|
|
newSaleDetailDTOList.push(res1.result.purchaseDetails[i].stockLogList1[
|
|
m])
|
|
attrMap.set(res1.result.purchaseDetails[i].stockLogList1[m]
|
|
.attributeList, num)
|
|
num++
|
|
}
|
|
|
|
}
|
|
obj.saleDetailQueryDTO = newSaleDetailDTOList
|
|
obj.num = 0
|
|
obj.attrId = res1.result.purchaseDetails[i].attrId
|
|
obj.id = res1.result.purchaseDetails[i].productId
|
|
obj.isNew = res1.result.purchaseDetails[i].productId==null?true:false,
|
|
obj.customerCategoryRule = res1.result.purchaseDetails[i]
|
|
.customerCategoryRule != null ? JSON.parse(res1.result.purchaseDetails[i]
|
|
.customerCategoryRule) : null
|
|
obj.purchasePrice = res1.result.purchaseDetails[i].stockLogList1[0]
|
|
.purchasePrice
|
|
obj.price = res1.result.purchaseDetails[i].price
|
|
obj.categoryId = res1.result.purchaseDetails[i].categoryId
|
|
obj.productName = res1.result.purchaseDetails[i].productName
|
|
obj.productPicture = res1.result.purchaseDetails[i].productPicture
|
|
obj.productSn = res1.result.purchaseDetails[i].productSn
|
|
obj.productId = res1.result.purchaseDetails[i].productId
|
|
obj.wholesalePrice = res1.result.purchaseDetails[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('AiInventoryId', "")
|
|
}
|
|
}).catch((res1) => {})
|
|
console.log('dataList', dataList)
|
|
await this.tui.request("/app/debt/selectByUserId", "post", {
|
|
shopId: uni.getStorageSync('shopId'),
|
|
userId: item.supplierId
|
|
}, false, true).then((res) => {
|
|
if (res.code == 200) {
|
|
console.log('khName', res.result)
|
|
res.result.noEarn = res.result.amountOwed
|
|
res.result.consigneeName = res.result.userName
|
|
res.result.id = res.result.userId
|
|
uni.setStorageSync('khName', JSON.stringify(res.result))
|
|
uni.setStorageSync('carList1', JSON.stringify(dataList))
|
|
uni.setStorageSync('hangOrder', true)
|
|
this.khName = res.result
|
|
this.zhiqianqiankuan = this.khName.noEarn
|
|
this.pages = 1
|
|
this.list = []
|
|
this.getList();
|
|
this.$forceUpdate()
|
|
uni.setStorageSync('thisInStorageStatus',this.inStorageStatus)
|
|
this.$refs.RKDialog.open('bottom')
|
|
//this.$refs.childRef.chushihua();
|
|
}
|
|
})
|
|
},
|
|
searchTime(res) {
|
|
console.log(res)
|
|
if (res == '') {
|
|
this.range = []
|
|
}
|
|
this.pages = 1;
|
|
this.pageNum = 1;
|
|
this.list = [];
|
|
if (this.cancel == true) {
|
|
this.getList("1");
|
|
} else {
|
|
this.getList();
|
|
}
|
|
},
|
|
getByCondition() {
|
|
this.tui.request("/app/supplier/getByCondition", "post", {
|
|
searchStr: this.khName.consigneeName,
|
|
pageNumber: 1,
|
|
pageSize: 10
|
|
}, false, true).then((res) => {
|
|
if (res.code == 200) {
|
|
for (let i = 0; i < res.result.content.length; i++) {
|
|
if (res.result.content[i].id == this.khName.id) {
|
|
|
|
this.khName.noEarn = res.result.content[i].noEarn
|
|
this.zhiqianqiankuan = res.result.content[i].noEarn
|
|
}
|
|
}
|
|
|
|
} else {
|
|
uni.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
})
|
|
}
|
|
}).catch((res) => {})
|
|
},
|
|
sreachName(e) {
|
|
this.faBookShow = true
|
|
this.customName = e.detail.value
|
|
this.getSupplierList(e.detail.value)
|
|
},
|
|
inputFocus(e) {
|
|
this.getSupplierList(e.target.value)
|
|
|
|
this.customId = ''
|
|
this.faBookShow = true
|
|
},
|
|
getSupplierList(name){
|
|
console.log('搜索',name)
|
|
this.tui.request("/app/supplier/getByCondition", "post", {
|
|
searchStr:name,
|
|
pageNumber: 1,
|
|
pageSize: 1000
|
|
}, false, true).then((res) => {
|
|
if (res.code == 200) {
|
|
this.customList = res.result.content
|
|
}else{
|
|
this.tui.toast(res.message)
|
|
}
|
|
})
|
|
},
|
|
checkName(item) {
|
|
this.customName = item.consigneeName
|
|
this.faBookShow = false
|
|
this.searchList()
|
|
this.$forceUpdate()
|
|
},
|
|
searchList(res) {
|
|
this.pages = 1;
|
|
this.pageNum = 1;
|
|
this.list = [];
|
|
this.getList();
|
|
},
|
|
|
|
clearSreach(){
|
|
this.inStorageStatus = 1
|
|
this.customName = ""
|
|
this.getList()
|
|
},
|
|
getList(type) {
|
|
var url, data;
|
|
console.log('状态是什么',this.inStorageStatus)
|
|
if (this.inStorageStatus == 0) {
|
|
this.tui.request("/app/purchase/list", "POST", {
|
|
inStorageStatus: this.inStorageStatus
|
|
}, false, false).then((res) => {
|
|
this.status = 'nomore';
|
|
if (res.code == 200) {
|
|
this.pages = res.result.pages
|
|
if (this.pages == 1) {
|
|
this.list = res.result.records
|
|
} else {
|
|
this.list = [...this.list, ...res.result.records]
|
|
}
|
|
this.searchStr = ""
|
|
this.noDaysort = false
|
|
} else {
|
|
this.tui.toast(res.message)
|
|
}
|
|
})
|
|
} else if(this.inStorageStatus == 8){
|
|
this.tui.request("/app/purchase/getPurchaseList", "POST", {
|
|
pageNum: this.pageNum,
|
|
pageSize: 30,
|
|
isAiList: 1,
|
|
fromWhere:0
|
|
}, false, false).then((res) => {
|
|
this.status = 'nomore';
|
|
if (this.pages == 1) {
|
|
this.list = res.result.records
|
|
} else {
|
|
this.list = [...this.list, ...res.result.records]
|
|
}
|
|
this.pages = res.result.pages
|
|
}).catch((res) => {})
|
|
setTimeout(function () {
|
|
uni.stopPullDownRefresh();
|
|
}, 500);
|
|
} else {
|
|
let data = {
|
|
inStorageStatus: this.inStorageStatus,
|
|
searchStr: this.customName,
|
|
startDate: this.range[0],
|
|
endDate: this.range[1],
|
|
pageNum: this.pageNum,
|
|
pageSize: 30,
|
|
storeFlag: this.storeFlag
|
|
}
|
|
if (this.listStatus == 0) {
|
|
data.delFlag = ""
|
|
} else if (this.listStatus == 1) {
|
|
data.delFlag = 1
|
|
}
|
|
|
|
this.tui.request("/app/purchase/getPurchaseList", "POST", data, false, false).then((res) => {
|
|
this.status = 'nomore';
|
|
if (res.code == 200) {
|
|
// this.list = []
|
|
this.pages = res.result.pages
|
|
if (this.pages == 1) {
|
|
this.list = res.result.records
|
|
} else {
|
|
this.list = [...this.list, ...res.result.records]
|
|
}
|
|
// this.searchStr = ""
|
|
this.noDaysort = false
|
|
} else {
|
|
this.tui.toast(res.message)
|
|
}
|
|
})
|
|
}
|
|
},
|
|
changeSort(type) {
|
|
this.nahuoDay = false
|
|
this.noDaysort = !this.noDaysort
|
|
},
|
|
backPage(){
|
|
uni.switchTab({
|
|
url: '/pages/index/index'
|
|
});
|
|
},
|
|
showTime(time) {
|
|
uni.showToast({
|
|
title: "订单时间:" + time,
|
|
icon: 'none'
|
|
})
|
|
},
|
|
paixuChange(text) {
|
|
this.sort = text
|
|
this.popleList = []
|
|
this.pages = 1
|
|
this.searchName = ""
|
|
this.noDaysort = false
|
|
this.khOrGysList()
|
|
},
|
|
goDetail(id) {
|
|
// uni.setStorageSync('noReload',true)
|
|
uni.navigateTo({
|
|
url: '/package1/index/waitStorageDetail?id=' + id
|
|
})
|
|
},
|
|
//跳转入库页
|
|
goKaiDan(type) {
|
|
if(type == '8'){
|
|
uni.navigateTo({
|
|
url: '/package1/AI/AIPicture'
|
|
})
|
|
}else{
|
|
uni.setStorageSync('thisInStorageStatus',this.inStorageStatus)
|
|
this.$refs.RKDialog.open('bottom')
|
|
this.$refs.childRef.chushihua();
|
|
}
|
|
|
|
},
|
|
parentClosePage() {
|
|
this.$parent.$parent.$refs.RKDialog.close()
|
|
},
|
|
closeMask(index){
|
|
this.list[index].isShowBtn = false;
|
|
this.$forceUpdate()
|
|
},
|
|
changeShowBtn(index) {
|
|
if(this.lableIndex != index){
|
|
this.list[this.lableIndex].isShowBtn = false
|
|
this.lableIndex = index
|
|
}
|
|
|
|
if (this.list[index].isShowBtn == undefined || this.list[index].isShowBtn == false) {
|
|
this.list[index].isShowBtn = true
|
|
} else {
|
|
this.list[index].isShowBtn = false
|
|
}
|
|
this.$forceUpdate()
|
|
},
|
|
goConfirm(item) {
|
|
uni.navigateTo({
|
|
url: '/package1/index/waitStorageDetail?id=' + item.id + '&storeFlag=1'
|
|
})
|
|
},
|
|
returnPrice(item, index) {
|
|
let that = this;
|
|
if (item.inStorageStatus == 2 || item.inStorageStatus == 3 || item.inStorageStatus == 4) {
|
|
uni.navigateTo({
|
|
url: '/package1/AI/AIInventoryList'
|
|
})
|
|
} else if (item.inStorageStatus == 1) {
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "确定撤销该采购单吗?",
|
|
success: function(res) {
|
|
uni.showLoading({
|
|
title: '加载中...'
|
|
})
|
|
if (res.confirm) {
|
|
that.list[index].faBookShow = false
|
|
that.tui.request("/app/purchase/cancelPurchase", "POST", {
|
|
id: item.id,
|
|
}, false, true).then((res) => {
|
|
if (res.code == 200) {
|
|
that.list[index].delFlag = 1
|
|
that.$forceUpdate()
|
|
that.tui.toast("撤销成功!")
|
|
} else {
|
|
that.tui.toast(res.message)
|
|
}
|
|
})
|
|
}
|
|
setTimeout(res => {
|
|
uni.hideLoading();
|
|
}, 500)
|
|
}
|
|
})
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
page,.page1 {
|
|
width: 100%;
|
|
font-size: 14px;
|
|
background: #fff;
|
|
}
|
|
|
|
.top-btn {
|
|
background: #088feb;
|
|
border-radius: 10px;
|
|
color: #fff;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
margin: 0 10px;
|
|
padding: 0 10px;
|
|
}
|
|
|
|
.table {
|
|
display: flex;
|
|
height: auto;
|
|
overflow-x: scroll;
|
|
width: 100%;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.table-content {
|
|
width:100%;
|
|
flex: 0 0 auto;
|
|
overflow-x: scroll;
|
|
padding-bottom: 20px;
|
|
}
|
|
|
|
.table-th {
|
|
width: 100%;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
background: #088FEB;
|
|
color: #fff;
|
|
|
|
view {
|
|
width: 80px;
|
|
float: left;
|
|
text-align: center;
|
|
border-right: 1px solid #fff;
|
|
}
|
|
}
|
|
|
|
.table-tr {
|
|
flex: 0 0 auto;
|
|
width: 100%;
|
|
height: 30px;
|
|
position: relative;
|
|
line-height: 30px;
|
|
color: #000;
|
|
|
|
view {
|
|
width: 80px;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
float: left;
|
|
text-align: center;
|
|
border-bottom: 1px solid #000;
|
|
border-right: 1px solid #000;
|
|
}
|
|
}
|
|
|
|
.book-mask {
|
|
z-index: 99;
|
|
position: absolute;
|
|
top: 108px;
|
|
left: 45%;
|
|
width: 200px;
|
|
max-height: 200px;
|
|
overflow: scroll;
|
|
background: #fff;
|
|
padding: 10rpx;
|
|
border-radius: 5px;
|
|
border: 1px solid #e5e5e5;
|
|
}
|
|
|
|
.sign-popup {
|
|
width: 250px;
|
|
height: auto;
|
|
max-height: 450px;
|
|
overflow: scroll;
|
|
background: #fff;
|
|
border-radius: 10px;
|
|
position: relative;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.uni-data-select {
|
|
width: 75%;
|
|
text-align: center;
|
|
}
|
|
|
|
.uni-stat__select {
|
|
height: 30px;
|
|
margin-top: 5px;
|
|
border: 1px solid #eee;
|
|
}
|
|
|
|
.uni-select__selector-empty,
|
|
.uni-select__selector-item {
|
|
display: flex;
|
|
cursor: pointer;
|
|
height: 50px;
|
|
line-height: 50px !important;
|
|
font-size: 18px !important;
|
|
text-align: center;
|
|
padding: 0px 10px;
|
|
}
|
|
|
|
.uni-select {
|
|
border: none !important;
|
|
border-radius: 0 !important;
|
|
height: 40px !important;
|
|
padding-left: 0 !important;
|
|
}
|
|
|
|
.uni-select__input-placeholder {
|
|
color: #6a6a6a;
|
|
font-size: 18px !important;
|
|
width: 400rpx;
|
|
}
|
|
|
|
.uni-select__input-text {
|
|
font-size: 18px !important;
|
|
}
|
|
.uni-date__x-input {
|
|
height: 28px !important;
|
|
line-height: 28px !important;
|
|
font-size: 14px !important;
|
|
}
|
|
|
|
.uni-date-x .range-separator {
|
|
height: 40px !important;
|
|
line-height: 40px !important;
|
|
font-size: 18px !important;
|
|
}
|
|
|
|
.empty-text,
|
|
.kk-btn-wrap view,
|
|
.kk-devices-item view {
|
|
font-size: 18px !important;
|
|
}
|
|
|
|
.kk-modal {
|
|
width: 400px !important;
|
|
height: 500px !important;
|
|
padding: 20px !important;
|
|
}
|
|
|
|
.operate-btn {
|
|
padding: 0 5px;
|
|
color: #fff;
|
|
border-radius: 5px;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
margin: 0 0 0 10px;
|
|
display: inline-block;
|
|
}
|
|
|
|
.uni-calendar__weeks-day-text {
|
|
font-size: 18px;
|
|
}
|
|
|
|
.color-box {
|
|
display: flex;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
}
|
|
|
|
.color-piece {
|
|
height: 30px;
|
|
width: 30px;
|
|
}
|
|
|
|
.uni-calendar-item__weeks-box-text,
|
|
.uni-calendar__weeks-day-text,
|
|
.uni-calendar__header-text {
|
|
font-size: 18px !important;
|
|
}
|
|
|
|
.uni-calendar-item__weeks-box-item,
|
|
.uni-calendar__header-btn-box {
|
|
width: 40px !important;
|
|
height: 40px !important;
|
|
}
|
|
|
|
.uni-calendar__weeks-day {
|
|
height: 40px !important;
|
|
}
|
|
.uni-calendar__header-btn {
|
|
width: 10rpx !important;
|
|
height: 10rpx !important;
|
|
}
|
|
.uni-calendar__header {
|
|
height: 30rpx !important;
|
|
}
|
|
.uni-easyinput__content-input,.uni-easyinput__content {
|
|
line-height: 30px !important;
|
|
height: 30px !important;
|
|
}
|
|
</style>
|