vue-cli init
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/*!
|
||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||
* @author aidex
|
||||
* @version 2020-9-1
|
||||
*/
|
||||
|
||||
.toolbar {
|
||||
|
||||
background-color: #fff;
|
||||
}
|
||||
.wrap .box .item{
|
||||
margin: 0 0 0px;
|
||||
border-radius: 0;
|
||||
.title {
|
||||
padding-left:0;
|
||||
.text {
|
||||
font-size: 30rpx;
|
||||
font-weight:500;
|
||||
margin: 0;
|
||||
color: #202328;
|
||||
}
|
||||
}
|
||||
}
|
||||
.grid {
|
||||
|
||||
.grid-icon {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.grid-text {
|
||||
font-size: 24rpx;
|
||||
padding: 15rpx;
|
||||
color: #202328;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<view>
|
||||
<button type="primary" @click="onShowDatePicker('range')">单据日期 {{range[0]}} - {{range[1]}}</button>
|
||||
|
||||
<view class="u-demo-block">
|
||||
<view class="u-page__tag-item">
|
||||
<u-search v-model="searchBillNo" :show-action="false"
|
||||
@custom="onTabChange" @search="onTabChange"
|
||||
placeholder="请输入单号或往来单位">
|
||||
</u-search>
|
||||
</view>
|
||||
</view>
|
||||
<u-sticky>
|
||||
<div style="height: 43px; border-bottom: 1rpx solid #eeeeee; background-color: #FFFFFF;">
|
||||
<u-tabs :list="tabList" name="title" active-color="red" :is-scroll="false"
|
||||
:current="activeTabIndex" @change="onTabChange"></u-tabs>
|
||||
</div>
|
||||
</u-sticky>
|
||||
<dataNull v-if="ItemDataList.length == 0" src="/static/img/chahua/gjNull.png" title="暂无相关出仓资料" title1="请添加或者更换搜索添加">
|
||||
</dataNull>
|
||||
<scroll-view v-else scroll-y="true" :style="{height: scrollHeight}"
|
||||
refresher-enabled :refresher-threshold="200" :refresher-triggered="triggered" refresher-background="gray">
|
||||
<view v-for="(item, index) in ItemDataList" :key="index" @click="cardClickFun(item, index)">
|
||||
<GoodsBusinessOutItem :item="item" :isSelect="isSelect" :index="index"></GoodsBusinessOutItem>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<addBtn url="./storeGoodsBusinessOutAdd"></addBtn>
|
||||
<mx-date-picker :show="showPicker" :type="BillDatetype" :value="BillDatevalue"
|
||||
:show-tips="true" :begin-text="'开始'" :end-text="'结束'"
|
||||
:show-seconds="false" @confirm="BillDateConfirm" @cancel="BillDateConfirm" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let that = '';
|
||||
import addBtn from '@/components/addBtn/addBtn.vue'
|
||||
import GoodsBusinessOutItem from '@/components/card/storeGoodsBusinessOutItem.vue';
|
||||
import util from '../../common/util';
|
||||
import MxDatePicker from "@/components/mx-datepicker/mx-datepicker.vue";
|
||||
export default {
|
||||
components: {
|
||||
GoodsBusinessOutItem,
|
||||
MxDatePicker
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabList: [
|
||||
{title: '未审核', status: '0'},
|
||||
{title: '已审核', status: '1'},
|
||||
],
|
||||
activeTabIndex: 0,
|
||||
ItemDataList: [],
|
||||
pageIndex: 1,
|
||||
isMore: true,
|
||||
scrollHeight: '667px',
|
||||
triggered: false,
|
||||
isSelect: false,
|
||||
searchBillNo: '',
|
||||
showPicker: false,
|
||||
BillBeginDate: new Date(new Date()-24*60*60*1000).toLocaleDateString(),
|
||||
BillEndDate: new Date().toLocaleDateString(),
|
||||
range: [new Date(new Date()-24*60*60*1000).toLocaleDateString(), new Date().toLocaleDateString()],
|
||||
BillDatetype: 'range',
|
||||
BillDatevalue: ''
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
that = this;
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
that.scrollHeight = res.windowHeight - 40 + 'px';
|
||||
}
|
||||
})
|
||||
that.StoreGoodsBusinessOutData();
|
||||
},
|
||||
watch: {
|
||||
activeTabIndex: {
|
||||
deep: true, // 深度监听
|
||||
handler(newVal, oldVal) {
|
||||
console.log("activeTabIndex参数改变,即将刷新...", `新值:${newVal}`, `旧值:${oldVal}`);
|
||||
this.onTabChange(newVal);
|
||||
}
|
||||
}
|
||||
},
|
||||
// 上拉加载
|
||||
onReachBottom: function () {
|
||||
console.log("activeTabIndex参数改变,即将刷新..." + this.activeTabIndex);
|
||||
/*
|
||||
if (this.pagination.hasNextPage) {
|
||||
this.doInfinite()
|
||||
}
|
||||
*/
|
||||
},
|
||||
onBackPress() {
|
||||
/*uni.$off('deleteCardFun', that.deleteCardFun);
|
||||
uni.$off('updateBjdListByIndex', that.updateBjdListByIndex)
|
||||
uni.$off('addBjdItemInListFun', that.addBjdItemInListFun);*/
|
||||
},
|
||||
methods: {
|
||||
onTabChange(index) {
|
||||
const _self = this;
|
||||
this.activeTabIndex = index;
|
||||
if (this.activeTabIndex == 0) {
|
||||
console.log("---->>未审核<<----");
|
||||
this.StoreGoodsBusinessOutData();
|
||||
} else {
|
||||
console.log("---->>已审核<<----");
|
||||
this.StoreGoodsBusinessOutDataCommit();
|
||||
}
|
||||
},
|
||||
|
||||
onShowDatePicker(type){//显示
|
||||
this.BillDatetype = type;
|
||||
this.showPicker = true;
|
||||
this.BillDatevalue = this[type];
|
||||
},
|
||||
|
||||
BillDateConfirm(e) {//选择
|
||||
this.showPicker = false;
|
||||
if(e) {
|
||||
this[this.BillDatetype] = e.value;
|
||||
this.BillBeginDate = e.value[0];
|
||||
this.BillEndDate = e.value[1];
|
||||
}
|
||||
},
|
||||
|
||||
StoreGoodsBusinessOutData: function() {
|
||||
that.ItemDataList = [];
|
||||
let aCommitStatus = 0;
|
||||
if (this.activeTabIndex == 0) {
|
||||
aCommitStatus = 0
|
||||
}
|
||||
else if (this.activeTabIndex == 1) {
|
||||
aCommitStatus = 1
|
||||
};
|
||||
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.GetStoreGoodsBusinessOutDataSQL',
|
||||
params: [{
|
||||
name: 'CommitStatus',
|
||||
value: aCommitStatus
|
||||
}, {
|
||||
name: 'BillNo',
|
||||
value: '%' + this.searchBillNo + '%'
|
||||
}, {
|
||||
name: 'LOGINID',
|
||||
value: getApp().globalData.LoginID
|
||||
}, {
|
||||
name: 'PLANLOGINID',
|
||||
value: getApp().globalData.LoginID
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
this.triggered = false;
|
||||
let data = res.data.data;
|
||||
console.log("---->" + JSON.stringify(res.data));
|
||||
that.ItemDataList = [];
|
||||
that.ItemDataList = that.ItemDataList.concat(data);
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
StoreGoodsBusinessOutDataCommit: function() {
|
||||
that.ItemDataList = [];
|
||||
let aCommitStatus = 0;
|
||||
if (this.activeTabIndex == 0) {
|
||||
aCommitStatus = 0
|
||||
}
|
||||
else if (this.activeTabIndex == 1) {
|
||||
aCommitStatus = 1
|
||||
};
|
||||
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.GetStoreGoodsBusinessOutDataCommitSQL',
|
||||
params: [{
|
||||
name: 'CommitStatus',
|
||||
value: '1'
|
||||
},{
|
||||
name: 'BeginDate',
|
||||
value: this.BillBeginDate
|
||||
},{
|
||||
name: 'EndDate',
|
||||
value: this.BillEndDate
|
||||
},{
|
||||
name: 'BillNo',
|
||||
value: '%'+this.searchBillNo+'%'
|
||||
},{
|
||||
name: 'LOGINID',
|
||||
value: getApp().globalData.LoginID
|
||||
},{
|
||||
name: 'PLANLOGINID',
|
||||
value: getApp().globalData.LoginID
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
this.triggered = false;
|
||||
let data = res.data.data;
|
||||
that.ItemDataList = [];
|
||||
console.log("---->" + JSON.stringify(res.data));
|
||||
that.ItemDataList = that.ItemDataList.concat(data);
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
// 卡片点击方法
|
||||
cardClickFun: function(item, index) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/storegoods/storeGoodsBusinessOutDetail?billid=' + item.BillMasterID
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F8F8F8;
|
||||
}
|
||||
button{
|
||||
margin: 20upx;
|
||||
font-size: 28upx;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,580 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-form ref="uForm">
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">单号:{{GoodsOutBillNo}}</text>
|
||||
<text class="title" style="width:200px;">日期:{{GoodsOutBillDate}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">单据类型:{{BillTypeName}}</text>
|
||||
<text class="title" style="width:200px;">营销部门:{{PlanDepartmentName}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">仓库名称:{{StoreName}}</text>
|
||||
<text class="title" style="width:200px;">调至仓库:{{ToStoreName}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">往来单位:{{CustomerName}}</text>
|
||||
<text class="title" style="width:200px;">销 售 员:{{SaleUserName}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="150" label="条码资料:">
|
||||
<input type="text" v-model="QRBarCode" maxlength="-1" :focus="testFocus1" style="width:150px;" @confirm="GoodsOutBillDetailScan" />
|
||||
<checkbox-group @change="AllCrockNoCheckChange">
|
||||
<checkbox ref="checkBoxRef" :checked="AllCrockNoScanStatus">整缸</checkbox>
|
||||
</checkbox-group>
|
||||
<checkbox-group @change="BarCodeDelChange">
|
||||
<checkbox ref="checkBoxRef" :checked="BarCodeDelStatus">删除</checkbox>
|
||||
</checkbox-group>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title">{{BillDataMessage}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">成品编号:{{FabricGoodsNo}}</text>
|
||||
<text class="title" style="width:200px;">成品重量:{{GoodsQty}}KG</text>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">成品色号:{{GoodsCodeNo}}</text>
|
||||
<text class="title" style="width:200px;">成品颜色:{{GoodsCodeName}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">成品缸号:{{CrockNo}}</text>
|
||||
<text class="title" style="width:200px;">缸号卷号:{{GoodsBillNo}}</text>
|
||||
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">本单条数:{{BillSumRoll}}条</text>
|
||||
<text class="title" style="width:200px;">本单重量:{{BillSumQty}}KG</text>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">本色条数:{{GoodsCodeSumRoll}}条</text>
|
||||
<text class="title" style="width:200px;">本色重量:{{GoodsCodeSumQty}}KG</text>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">本缸条数:{{CrockNoSumRoll}}条</text>
|
||||
<text class="title" style="width:200px;">本缸重量:{{CrockNoSumQty}}KG</text>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<view class="u-demo-area">
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<wyb-table ref="table" :headers="headersMaster" :contents="GoodsDetailList"/>
|
||||
<!-- <wyb-table ref="table" :headers="headersDetail" :contents="GoodsCrockNoDataList" height="600rpx" /> !-->
|
||||
</view>
|
||||
<!-- <u-action-sheet :list="InDetailList" v-model="actionSheetShow" @click="actionSheetCallback"></u-action-sheet> -->
|
||||
|
||||
<view class="submitView">
|
||||
<u-button type="primary" style="width:100px;" class="commitBtn"
|
||||
:ripple="true" ripple-bg-color="#909399" @click="commitBtnFun">
|
||||
{{CommitType ? '消审' : '审核'}}
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import util, {
|
||||
parFabricGoodsBarCode2D,
|
||||
parYarnGoodsBarCode2D,
|
||||
playSuccessAudio,
|
||||
playErrorAudio
|
||||
} from '../../common/util';
|
||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||
let that = '';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
borderColor: '#e4e7ed',
|
||||
align: 'center',
|
||||
index: 0,
|
||||
actionSheetShow: false,
|
||||
CommitType: '',
|
||||
CommitProcName: '',
|
||||
QRBarCode: '',
|
||||
AllCrockNoScanStatus: false,
|
||||
BarCodeDelStatus: false,
|
||||
GoodsOutBillID: 0,
|
||||
GoodsOutBillNo: '',
|
||||
GoodsOutBillDate: '',
|
||||
GoodsOutBillMasterNo: '',
|
||||
BillTypeName: '',
|
||||
StoreNameID: '',
|
||||
StoreName: '',
|
||||
ToStoreNameID: '',
|
||||
ToStoreName: '',
|
||||
CustomerID: '',
|
||||
CustomerName: '',
|
||||
PlanDepartmentID: '',
|
||||
PlanDepartmentName: '',
|
||||
SaleUserID: '',
|
||||
SaleUserName: '',
|
||||
FabricGoodsNo: '',
|
||||
FabricGoodsName: '',
|
||||
GoodsCodeNo: '',
|
||||
GoodsCodeName: '',
|
||||
CrockNo: '',
|
||||
GoodsBillNo: '',
|
||||
GoodsQty: 0,
|
||||
testFocus0: false,
|
||||
testFocus1: true,
|
||||
BillSumRoll: 0,
|
||||
BillSumQty: 0,
|
||||
GoodsCodeSumRoll: 0,
|
||||
GoodsCodeSumQty: 0,
|
||||
CrockNoSumRoll: 0,
|
||||
CrockNoSumQty: 0,
|
||||
BarCodeDelStatus: false,
|
||||
GoodsDetailList: [],
|
||||
BillDataMessage: '',
|
||||
headersMaster: [{
|
||||
label: '成品编号',
|
||||
key: 'FabricGoodsNo'
|
||||
}, {
|
||||
label: '成品色号',
|
||||
key: 'GoodsCodeNo'
|
||||
}, {
|
||||
label: '成品颜色',
|
||||
key: 'GoodsCodeName'
|
||||
}, {
|
||||
label: '成品缸号',
|
||||
key: 'CrockNo'
|
||||
}, {
|
||||
label: '条数',
|
||||
key: 'Roll'
|
||||
}, {
|
||||
label: '重量',
|
||||
key: 'Qty'
|
||||
}],
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(e) {
|
||||
that = this;
|
||||
if (e.billid) {
|
||||
that.GoodsOutBillID = e.billid;
|
||||
}
|
||||
this.GoodsOutBillDetailData();
|
||||
},
|
||||
|
||||
methods: {
|
||||
playSuccess() {
|
||||
util.playSuccessAudio();
|
||||
},
|
||||
playError() {
|
||||
util.playErrorAudio();
|
||||
},
|
||||
|
||||
AllCrockNoCheckChange:function () {
|
||||
this.AllCrockNoScanStatus = !this.AllCrockNoScanStatus;
|
||||
},
|
||||
|
||||
BarCodeDelChange:function () {
|
||||
this.BarCodeDelStatus = !this.BarCodeDelStatus;
|
||||
},
|
||||
|
||||
GetStoreStationName: function() {
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.GetStoreStationName',
|
||||
params: [{
|
||||
name: 'No',
|
||||
value: this.StoreStationNo
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
this.playSuccess();
|
||||
var aResultData = res.data.data;
|
||||
for (var i = 0; i < aResultData.length; i++) {
|
||||
this.StoreStationName = aResultData[i].StoreStationName;
|
||||
};
|
||||
this.testFocus1 = false;
|
||||
this.$nextTick(() => {
|
||||
this.testFocus1 = true;
|
||||
});
|
||||
} else {
|
||||
this.playError();
|
||||
this.StoreStationName = "",
|
||||
this.testFocus0 = false;
|
||||
this.$nextTick(() => {
|
||||
//this.testFocus1 = false;
|
||||
this.testFocus0 = true;
|
||||
});
|
||||
this.StoreNameID = 0,
|
||||
this.BillDataMessage = '不存在当前的仓位资料,请确认!';
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
this.playError();
|
||||
this.BillDataMessage = '连接服务器出错,请检查后台服务是否启动!' + res.data.msg;
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
GoodsOutBillDetailScan() {
|
||||
if (this.StoreNameID == 0 && this.GoodsOutBillNo == '') {
|
||||
this.playError();
|
||||
this.BillDataMessage = '请先新增单据';
|
||||
return;
|
||||
}
|
||||
console.log("this.QRBarCode ---->>" + this.QRBarCode);
|
||||
|
||||
let aBarCodeDelStatus = 0;
|
||||
if (this.BarCodeDelStatus){
|
||||
aBarCodeDelStatus = '1';
|
||||
};
|
||||
|
||||
let aAllCrockNoScanStatus = 0;
|
||||
if (this.AllCrockNoScanStatus){
|
||||
aAllCrockNoScanStatus = '1';
|
||||
};
|
||||
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/storedproc',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
proc_name: 'Usp_APP_StoreGoodsBusinessOutBillDetail',
|
||||
method: 'open_proc',
|
||||
params: [{
|
||||
name: '@BillMasterID',
|
||||
value: this.GoodsOutBillID
|
||||
},
|
||||
{
|
||||
name: '@QRBarCode',
|
||||
value: this.QRBarCode
|
||||
},
|
||||
{
|
||||
name: '@BarCodeDelStatus',
|
||||
value: aBarCodeDelStatus
|
||||
},
|
||||
{
|
||||
name: '@AllCrockNoScanStatus',
|
||||
value: aAllCrockNoScanStatus
|
||||
},
|
||||
{
|
||||
name: '@StoreStationName',
|
||||
value: this.StoreStationName
|
||||
},
|
||||
{
|
||||
name: '@UserName',
|
||||
value: getApp().globalData.UserName
|
||||
}
|
||||
]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0) {
|
||||
console.log(res.data.data.toString());
|
||||
var aResultData = JSON.parse(res.data.data);
|
||||
if (aResultData.BillDataStatus == '0' && aResultData.BillDataMessage == 'SUCCESS') {
|
||||
this.playSuccess();
|
||||
this.FabricGoodsNo = aResultData.FabricGoodsNo;
|
||||
this.FabricGoodsName = aResultData.FabricGoodsName;
|
||||
this.GoodsCodeNo = aResultData.GoodsCodeNo;
|
||||
this.GoodsCodeName = aResultData.GoodsCodeName;
|
||||
this.CrockNo = aResultData.CrockNo;
|
||||
this.GoodsBillNo = aResultData.GoodsBillNo;
|
||||
this.GoodsQty = aResultData.GoodsQty;
|
||||
this.BillSumRoll = parseFloat(aResultData.BillSumRoll);
|
||||
this.BillSumQty = parseFloat(aResultData.BillSumQty);
|
||||
this.GoodsCodeSumRoll = parseFloat(aResultData.GoodsCodeSumRoll);
|
||||
this.GoodsCodeSumQty = parseFloat(aResultData.GoodsCodeSumQty);
|
||||
this.CrockNoSumRoll = parseFloat(aResultData.CrockNoSumRoll);
|
||||
this.CrockNoSumQty = parseFloat(aResultData.CrockNoSumQty);
|
||||
this.QRBarCode = '';
|
||||
this.BillDataMessage = '扫描成功!';
|
||||
this.GoodsOutBillDetailData();
|
||||
this.testFocus1 = false;
|
||||
this.$nextTick(() => {
|
||||
this.testFocus1 = true;
|
||||
});
|
||||
} else {
|
||||
this.playError();
|
||||
this.BillDataMessage = '盘点扫描出错,' + aResultData.BillDataMessage;
|
||||
this.QRBarCode = '';
|
||||
this.testFocus1 = false;
|
||||
this.$nextTick(() => {
|
||||
this.testFocus1 = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
this.playError();
|
||||
this.QRBarCode = '';
|
||||
this.BillDataMessage = '盘点扫描出错,' + res.data.msg;
|
||||
this.testFocus1 = false;
|
||||
this.$nextTick(() => {
|
||||
this.testFocus1 = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
this.playError();
|
||||
this.QRBarCode = '';
|
||||
this.testFocus1 = false;
|
||||
this.$nextTick(() => {
|
||||
this.testFocus1 = true;
|
||||
this.testFocus0 = false;
|
||||
});
|
||||
this.BillDataMessage = '盘点扫描出错,' + res.data.msg;
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '连接服务器出错,请检查后台服务是否启动!' + res.data.msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
GoodsOutBillDetailData: function() {
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.GetStoreGoodsBusinessOutDetailDataSQL',
|
||||
params: [{
|
||||
name: 'BillID',
|
||||
value: this.GoodsOutBillID
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
this.triggered = false;
|
||||
let data = res.data.data;
|
||||
console.log("--AAAA-->" + JSON.stringify(res.data));
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
var aResultData = res.data.data;
|
||||
this.GoodsDetailList = res.data.data;
|
||||
this.GoodsOutBillID = aResultData[0].BillMasterID;
|
||||
this.GoodsOutBillNo = aResultData[0].BillNo;
|
||||
this.GoodsOutBillDate = aResultData[0].BillDate;
|
||||
this.BillTypeName = aResultData[0].BillTypeName;
|
||||
this.CommitType = aResultData[0].CommitType;
|
||||
this.CommitProcName = aResultData[0].CommitProcName;
|
||||
this.PlanDepartmentName = aResultData[0].PlanDepartmentName;
|
||||
this.StoreName = aResultData[0].StoreName;
|
||||
this.ToStoreName = aResultData[0].ToStoreName;
|
||||
this.CustomerName = aResultData[0].CustomerName;
|
||||
this.SaleUserName = aResultData[0].SaleUserName;
|
||||
this.BillSumRoll = 0;
|
||||
this.BillSumQty = 0;
|
||||
for (var i = 0; i < aResultData.length; i++) {
|
||||
if (parseFloat(aResultData[i].Roll) > 0) {
|
||||
this.BillSumRoll = this.BillSumRoll + aResultData[i].Roll;
|
||||
}
|
||||
|
||||
if (parseFloat(aResultData[i].Qty) > 0) {
|
||||
this.BillSumQty = this.BillSumQty + aResultData[i].Qty;
|
||||
}
|
||||
};
|
||||
this.BillSumRoll = this.BillSumRoll.toFixed(2);
|
||||
this.BillSumQty = this.BillSumQty.toFixed(2);
|
||||
|
||||
} else if (res.data.status == 0 && res.data.count <= 0) {
|
||||
this.GoodsDetailList = [];
|
||||
} else {
|
||||
this.GoodsDetailList = [];
|
||||
}
|
||||
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
// 审核按钮方法
|
||||
commitBtnFun: function() {
|
||||
if (this.BillMasterID <= 0) {
|
||||
this.playError();
|
||||
this.BillDataMessage = '当前单据未提交,不能审核或消审!';
|
||||
return;
|
||||
}
|
||||
|
||||
var aCommitRecallName = '审核';
|
||||
if (this.CommitType == ''){
|
||||
aCommitRecallName = '审核';
|
||||
} else {
|
||||
aCommitRecallName = '消审';
|
||||
}
|
||||
|
||||
if (this.CommitProcName == ''){
|
||||
this.playError();
|
||||
this.BillDataMessage = '当前'+ aCommitRecallName +'操作配置有误,不能审核!';
|
||||
return;
|
||||
}
|
||||
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/storedproc',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
proc_name: this.CommitProcName,
|
||||
method: 'open_proc',
|
||||
params: [{
|
||||
name: '@BillID',
|
||||
value: this.GoodsOutBillID
|
||||
}, {
|
||||
name: '@BillNo',
|
||||
value: this.GoodsOutBillNo
|
||||
}, {
|
||||
name: '@UserName',
|
||||
value: getApp().globalData.UserName
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0) {
|
||||
var aResultData = JSON.parse(res.data.data);
|
||||
if (aResultData.BillDataStatus == '0' && aResultData.BillDataMessage == 'SUCCESS') {
|
||||
this.playSuccess();
|
||||
this.BillDataMessage = aCommitRecallName + "成功!";
|
||||
|
||||
if (aCommitRecallName == '审核'){
|
||||
this.CommitType = '已审核'
|
||||
} else {
|
||||
this.CommitType = ''
|
||||
}
|
||||
} else {
|
||||
this.playError();
|
||||
this.BillDataMessage = aCommitRecallName + '出错!' + aResultData.BillDataMessage;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this.playError();
|
||||
this.BillDataMessage = aCommitRecallName + '出错,' + res.data.msg
|
||||
return;
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
this.playError();
|
||||
this.BillDataMessage = '连接服务器出错,请检查后台服务是否启动!' + res.data.msg;
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F8F8F8;
|
||||
padding-bottom: 260rpx;
|
||||
}
|
||||
|
||||
.u-radio {
|
||||
width: 200rpx !important;
|
||||
}
|
||||
|
||||
.submitView {
|
||||
width: 100%;
|
||||
padding: 16rpx 0 26rpx;
|
||||
background-color: #FFFFFF;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-top: 1rpx solid #f1f1f1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.submitBtn {
|
||||
width: 666rpx;
|
||||
}
|
||||
|
||||
.productBox {
|
||||
background-color: #FFFFFF;
|
||||
margin-top: 32rpx;
|
||||
padding: 26rpx 0;
|
||||
}
|
||||
|
||||
.tjcpName {
|
||||
width: 686rpx;
|
||||
height: 40rpx;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
border-left: 6rpx solid #007AFF;
|
||||
padding-left: 12rpx;
|
||||
margin-left: 26rpx;
|
||||
margin-top: 26rpx;
|
||||
}
|
||||
|
||||
.cpInput {
|
||||
width: 150rpx !important;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.cpInput>input {
|
||||
box-sizing: border-box;
|
||||
border: 1rpx solid #DDDDDD;
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
|
||||
.cpInput1 {
|
||||
width: 200rpx !important;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.cpInput1>input {
|
||||
box-sizing: border-box;
|
||||
border: 1rpx solid #DDDDDD;
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
|
||||
.clearIcon {
|
||||
position: absolute;
|
||||
right: 6rpx;
|
||||
top: 6rpx;
|
||||
}
|
||||
|
||||
.greenPrice {
|
||||
font-size: 16px;
|
||||
color: #19BE6B !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.disFlex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.inputName {
|
||||
color: #ADADAD;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.addHKQS {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 26rpx;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,324 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-sticky>
|
||||
<div style="height: 43px; border-bottom: 1rpx solid #eeeeee; background-color: #FFFFFF;">
|
||||
<u-tabs :list="tabList" name="title" active-color="red" :is-scroll="false"
|
||||
:current="activeTabIndex" @change="onTabChange"></u-tabs>
|
||||
</div>
|
||||
</u-sticky>
|
||||
<dataNull v-if="list.length == 0" src="/static/img/chahua/gjNull.png" title="暂无相关胚布进仓单" title1="请添加或者更换搜索添加">
|
||||
</dataNull>
|
||||
<scroll-view v-else scroll-y="true" :style="{height: scrollHeight}"
|
||||
refresher-enabled :refresher-threshold="200" :refresher-triggered="triggered"
|
||||
refresher-background="gray" @refresherrefresh="onRefresh" @refresherrestore="onRestore">
|
||||
<view v-for="(item, index) in list" :key="index" @click="cardClickFun(item, index)">
|
||||
<storefabricinbill :item="item" :isSelect="isSelect" :index="index"></storefabricinbill>
|
||||
</view>
|
||||
<getMore :isMore="isMore"></getMore>
|
||||
</scroll-view>
|
||||
<addBtn url="./storefabricInBilladd"></addBtn>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let that = '';
|
||||
import {tyDropDown,dropDownByUser,bjdDatePxData,bjdSxDropDownData} from '../../static/utils/dropdown.js'
|
||||
import {getDayFun,getDayByNumFun} from '@/static/utils/date.js'
|
||||
import dataNull from '@/components/dataNull/dataNull.vue'
|
||||
import addBtn from '@/components/addBtn/addBtn.vue'
|
||||
import storefabricinbill from '@/components/card/storefabricinbill.vue'
|
||||
import getMore from '@/components/getMore/getMore.vue'
|
||||
import topDropdown from '../../components/topDropdown/topDropdown.vue'
|
||||
import util, {playSuccessAudio,playErrorAudio} from '../../common/util';
|
||||
import {TbOrderCouponService} from "@/dev/services/tb-order-coupon.service";
|
||||
export default {
|
||||
components: {
|
||||
dataNull,
|
||||
addBtn,
|
||||
getMore,
|
||||
storefabricinbill,
|
||||
topDropdown
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tbOrderCouponList: [],
|
||||
tabList: [
|
||||
{title: '未审核', status: null},
|
||||
{title: '已审核', status: '1'},
|
||||
],
|
||||
activeTabIndex: 0,
|
||||
dropdown1: '全部',
|
||||
options1: [],
|
||||
optionsPx: bjdDatePxData,
|
||||
sxList: [],
|
||||
list: [],
|
||||
pageIndex: 1,
|
||||
isMore: true,
|
||||
scrollHeight: '667px',
|
||||
triggered: false,
|
||||
isSelect: false,
|
||||
pageType: '',
|
||||
sortObj: {
|
||||
update_date: -1
|
||||
},
|
||||
optionsReq: {}, // 第一个下拉框请求参数
|
||||
dateReq: [], // 日期相关请求参数
|
||||
sxReq: JSON.stringify({}), // 筛选想请求参数
|
||||
matchObj: {},
|
||||
searchValue: '',
|
||||
clientIdArr: [],
|
||||
tabNoEqualArr: [], //标签页不等于数据
|
||||
depId: undefined
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
that.scrollHeight = res.windowHeight - 40 + 'px';
|
||||
}
|
||||
})
|
||||
that.selectDataFun();
|
||||
},
|
||||
watch: {
|
||||
activeTabIndex: {
|
||||
deep: true, // 深度监听
|
||||
handler(newVal, oldVal) {
|
||||
that.selectDataFun(newVal);
|
||||
}
|
||||
}
|
||||
},
|
||||
// 上拉加载
|
||||
onReachBottom: function () {
|
||||
/*
|
||||
if (this.pagination.hasNextPage) {
|
||||
this.doInfinite()
|
||||
}
|
||||
*/
|
||||
},
|
||||
onBackPress() {
|
||||
uni.$off('deleteCardFun', that.deleteCardFun);
|
||||
uni.$off('updateBjdListByIndex', that.updateBjdListByIndex)
|
||||
uni.$off('addBjdItemInListFun', that.addBjdItemInListFun);
|
||||
},
|
||||
methods: {
|
||||
onTabChange(index) {
|
||||
const _self = this;
|
||||
this.activeTabIndex = index;
|
||||
},
|
||||
/**
|
||||
* 加载更多数据中
|
||||
* @param infiniteScroll
|
||||
*/
|
||||
doInfinite(infiniteScroll) {
|
||||
const _self = this;
|
||||
new TbOrderCouponService().findTableTbOrderCouponList({
|
||||
pagination: _self.pagination,
|
||||
data: {
|
||||
communityId: _self.globalVariable.userInfo.tbCommunity.id,
|
||||
userId: _self.globalVariable.userInfo.id,
|
||||
status: _self.tabList[_self.activeTabIndex].status,
|
||||
orderBy: 'create_time desc',
|
||||
},
|
||||
}).then(result => {
|
||||
_self.pagination.refreshPage(result);
|
||||
_self.tbOrderCouponList = [..._self.tbOrderCouponList, ...result.list];
|
||||
});
|
||||
},
|
||||
|
||||
// 查询报价单
|
||||
selectDataFun: function() {
|
||||
/*
|
||||
if (!that.isMore) {
|
||||
return
|
||||
}
|
||||
|
||||
uni.showLoading({
|
||||
title: '加载中...',
|
||||
mask: true
|
||||
})*/
|
||||
let aStatusName = "";
|
||||
console.log("---->" +this.activeTabIndex + "<<<----" );
|
||||
if (this.activeTabIndex == 0) {
|
||||
aStatusName = "未审核"
|
||||
}
|
||||
else if (this.activeTabIndex == 1) {
|
||||
aStatusName = "已审核"
|
||||
};
|
||||
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.SaleShip.GetSaleAllocatedMaster',
|
||||
params: [{
|
||||
name: 'StatusName',
|
||||
value: '%'+aStatusName+'%'
|
||||
}, {
|
||||
name: 'SUID',
|
||||
value: getApp().globalData.EmployeeID
|
||||
}, {
|
||||
name: 'MUID',
|
||||
value: getApp().globalData.EmployeeID
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
this.triggered = false;
|
||||
let data = res.data.data;
|
||||
if (that.pageIndex == 1) {
|
||||
that.list = [];
|
||||
}
|
||||
if (res.data == 20) {
|
||||
that.pageIndex += 1;
|
||||
that.isMore = true;
|
||||
} else {
|
||||
that.isMore = false;
|
||||
}
|
||||
that.list = that.list.concat(data);
|
||||
},
|
||||
})
|
||||
},
|
||||
// 卡片点击方法
|
||||
cardClickFun: function(item, index) {
|
||||
if (that.pageType == 'genjin') {
|
||||
uni.$emit('gjOrderBindFun', item)
|
||||
uni.navigateBack()
|
||||
} else if (that.pageType != '') {
|
||||
uni.$emit('baoJiaDanBindFun', item)
|
||||
uni.navigateBack()
|
||||
}
|
||||
},
|
||||
// 下拉框回调函数
|
||||
dropDownFun1: function(e) {
|
||||
let optionsReq = {};
|
||||
let tabNoEqualArr = [];
|
||||
let userInfo = uni.$userInfo;
|
||||
that.depId = undefined;
|
||||
if (e.label == '全部') {
|
||||
that.depId = userInfo.depManager_Id;
|
||||
} else if (e.label == '我负责的') {
|
||||
optionsReq.fuZeRenId = userInfo._id;
|
||||
} else if (e.label == '我创建的') {
|
||||
optionsReq.cjRenId = userInfo._id;
|
||||
} else if (e.label == '下属负责') {
|
||||
that.depId = userInfo.depManager_Id;
|
||||
tabNoEqualArr = [{
|
||||
field: 'fuZeRenId',
|
||||
value: userInfo._id
|
||||
}]
|
||||
optionsReq.department = userInfo.departmentId;
|
||||
} else if (e.label == '下属创建') {
|
||||
that.depId = userInfo.depManager_Id;
|
||||
tabNoEqualArr = [{
|
||||
field: 'cjRenId',
|
||||
value: userInfo._id
|
||||
}]
|
||||
}
|
||||
that.tabNoEqualArr = tabNoEqualArr;
|
||||
that.optionsReq = JSON.stringify(optionsReq);
|
||||
that.matchObj = Object.assign(optionsReq, JSON.parse(that.sxReq));
|
||||
that.cxGetDataFun();
|
||||
},
|
||||
// 筛选框回调函数
|
||||
optionSxFun: function(e) {
|
||||
let arr = e.arr;
|
||||
that.clientIdArr = e.selectKhList;
|
||||
console.log(that.clientIdArr)
|
||||
let matchReq = [];
|
||||
let dateReq = [];
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if (arr[i].current !== '' && !arr[i].isDate) {
|
||||
matchReq.push({
|
||||
field: arr[i].field,
|
||||
value: arr[i].arr[arr[i].current]
|
||||
})
|
||||
} else if (arr[i].current !== '' && arr[i].isDate) {
|
||||
dateReq.push({
|
||||
field: arr[i].field,
|
||||
sTime: arr[i].sTime,
|
||||
eTime: arr[i].eTime
|
||||
})
|
||||
}
|
||||
}
|
||||
let reqObj = {};
|
||||
// 动态生成请求对象
|
||||
for (var i = 0; i < matchReq.length; i++) {
|
||||
reqObj[matchReq[i].field] = matchReq[i].value
|
||||
}
|
||||
that.dateReq = dateReq;
|
||||
that.sxReq = JSON.stringify(reqObj);
|
||||
// 合并对象
|
||||
that.matchObj = Object.assign(reqObj, JSON.parse(that.optionsReq));
|
||||
that.cxGetDataFun();
|
||||
},
|
||||
// 排序筛选框回调函数
|
||||
optionPxFun: function(arr) {
|
||||
let sortObj = {
|
||||
update_date: -1
|
||||
}
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if (arr[i].current !== '') {
|
||||
sortObj = {}
|
||||
if (arr[i].field == 'create_date') {
|
||||
sortObj.create_date = arr[i].current == 1 ? 1 : -1
|
||||
}
|
||||
if (arr[i].field == 'update_date') {
|
||||
sortObj.update_date = arr[i].current == 1 ? 1 : -1
|
||||
}
|
||||
if (arr[i].field == 'chengJiao_date') {
|
||||
sortObj.chengJiao_date = arr[i].current == 1 ? 1 : -1
|
||||
}
|
||||
if (arr[i].field == 'bjPrice') {
|
||||
sortObj.bjPrice = arr[i].current == 1 ? 1 : -1
|
||||
}
|
||||
that.sortObj = sortObj;
|
||||
break;
|
||||
}
|
||||
}
|
||||
that.cxGetDataFun();
|
||||
},
|
||||
// 搜索框回调方法
|
||||
searchBoxEmitFun: function(e) {
|
||||
that.searchValue = e.searchValue1;
|
||||
that.cxGetDataFun()
|
||||
},
|
||||
// 下拉刷新
|
||||
onRefresh: function() {
|
||||
if (that.triggered) return
|
||||
that.triggered = true;
|
||||
that.cxGetDataFun();
|
||||
},
|
||||
onRestore: function(e) {
|
||||
that.triggered = false; // 需要重置
|
||||
},
|
||||
// 重新获取数据
|
||||
cxGetDataFun: function() {
|
||||
that.pageIndex = 1;
|
||||
that.isMore = true;
|
||||
that.selectDataFun();
|
||||
},
|
||||
deleteCardFun: function(e) {
|
||||
let arr = that.list;
|
||||
arr.splice(e.index, 1);
|
||||
that.list = arr;
|
||||
},
|
||||
// add页面新增数据
|
||||
addBjdItemInListFun: function(e) {
|
||||
that.cxGetDataFun()
|
||||
},
|
||||
// 通过下标更新list数据
|
||||
updateBjdListByIndex: function(e) {
|
||||
that.$set(that.list, parseInt(e.index), e.obj)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F8F8F8;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,784 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="flex-white-plr26 ptb10 mt32 bdb_f5">
|
||||
<text class="mr26">进仓单号</text>
|
||||
<u-input disabled placeholder="自动生成" v-model="InStoreBillNo" />
|
||||
<text class="mr26">进仓日期</text> {{$u.timeFormat(InStoreBillDate, 'yyyy-mm-dd')}}
|
||||
</view>
|
||||
<view @click="pickerSelectFun('仓库名称')" class="flex-white-plr26 ptb20 bdb_f5">
|
||||
<text class="mr26">仓库名称<text class="redXingh">*</text></text>
|
||||
<view :class="StoreName ? '' : 'cBlack'"> {{StoreName ? StoreName : '请选择'}}
|
||||
<u-icon class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="pickerSelectFun('搬运工')" class="flex-white-plr26 ptb20 bdb_f5">
|
||||
<text class="mr26">搬运工<text class="redXingh">*</text></text>
|
||||
<view :class="StoreName ? '' : 'cBlack'"> {{StoreName ? StoreName : '请选择'}}
|
||||
<u-icon class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-white-plr26 ptb20 bdb_f5" @click="selectShangJiFun">
|
||||
<text class="mr26">销 售 员<text class="redXingh">*</text></text>
|
||||
<view :class="SaleUserName ? '' : 'cBlack'">
|
||||
{{SaleUserName ? SaleUserName : '请选择'}}
|
||||
<u-icon class="ml26" name="arrow-right" size="40" color="#888888"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
||||
<text class="mr26">物流公司<text class="redXingh">*</text></text>
|
||||
<u-input v-model="ShipCompanyName" />
|
||||
</view>
|
||||
<view class="flex-white-plr26 ptb10 bdb_f5">
|
||||
<text class="mr26">收货地址<text class="redXingh">*</text></text>
|
||||
<u-input v-model="SaleCustomerAddress" />
|
||||
</view>
|
||||
<view class="flex-white-plr26-column ptb20 mt32">
|
||||
<view style="margin-bottom: 8rpx;">
|
||||
<text>内部备注</text>
|
||||
</view>
|
||||
<u-input v-model="Remark" type="textarea" :border="true" :height="100" :auto-height="true" />
|
||||
</view>
|
||||
<view class="flex-white-plr26-column ptb20 mt32">
|
||||
<view style="margin-bottom: 8rpx;">
|
||||
<text>出货备注</text>
|
||||
</view>
|
||||
<u-input v-model="SaleOutRemark" type="textarea" :border="true" :height="100" :auto-height="true" />
|
||||
</view>
|
||||
<!--添加产品-->
|
||||
<view class="tjcpName">
|
||||
<text>添加产品</text>
|
||||
</view>
|
||||
<view class="productBox">
|
||||
<view class="myCard" v-if="cpList.length > 0">
|
||||
<view class="cardRow">
|
||||
<view>总数量:</view>
|
||||
<view>{{cpHzObj.totalNum}}</view>
|
||||
</view>
|
||||
<view class="cardRow">
|
||||
<view>价格合计:</view>
|
||||
<view>{{cpHzObj.price}}元</view>
|
||||
</view>
|
||||
<view class="cardRow">
|
||||
<view>总折扣%:</view>
|
||||
<view class="cpInput1">
|
||||
<u-input v-model="cpHzObj.discount" type="number" height="50" :border="true" :clearable="false" placeholder="请输入" @input="cpzzkXgFun"/>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="cardRow">
|
||||
<view>最终价格:</view>
|
||||
<view class="cpInput1">
|
||||
<u-input v-model="cpHzObj.sumPrice" type="number" height="50" :border="true" :clearable="false" placeholder="请输入" @input="cpzzPriceXgFun"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="myCard" v-for="(item, index) in cpList" :key="index">
|
||||
<u-icon name="close-circle-fill" size="50" class="clearIcon" color="#ff0000" @click="deleteCpFun(index)"></u-icon>
|
||||
<view class="cardTopName">产品名称:{{item.pName}}</view>
|
||||
<view class="cardRow">
|
||||
<view>产品价格:</view>
|
||||
<view>{{item.price}}元/{{item.unit}}</view>
|
||||
</view>
|
||||
<view class="disFlex">
|
||||
<view class="inputName">售价 (元):</view>
|
||||
<view class="cpInput">
|
||||
<u-input v-model="item.sellingPrice" type="number" height="50" :border="true" :clearable="false" placeholder="请输入" @input="cpPriceUpdateFun(index, item)"/>
|
||||
</view>
|
||||
<view class="inputName">折扣 (%):</view>
|
||||
<view class="cpInput">
|
||||
<u-input v-model="item.discount" type="number" height="50" :border="true" :clearable="false" placeholder="请输入" @input="cpDiscountUpdateFun(index, item)"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cardRow">
|
||||
<view>产品数量:</view>
|
||||
<view>
|
||||
<u-number-box v-model="item.num" :index="index" @change="cpCalcFun" :input-width="128" :input-height="60" :min="1" :max="100000"></u-number-box>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cardRow">
|
||||
<view>价格合计:</view>
|
||||
<view class="greenPrice">¥{{item.totalPrice}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addHKQS" @click="addChanPinFun">
|
||||
<text>点击添加相关产品</text>
|
||||
<u-icon name="plus-circle-fill" color="#007aff" size="56"
|
||||
style="margin-left: 16rpx;">
|
||||
</u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<!--提交按钮-->
|
||||
<view class="submitView">
|
||||
<u-button type="primary" class="submitBtn" :ripple="true" ripple-bg-color="#909399" @click="submitBtnFun">{{pageType ? '保存' : '提交'}}</u-button>
|
||||
</view>
|
||||
<!--组件-->
|
||||
|
||||
<u-select v-model="selectShow" :list="selectList" @confirm="selectConfirmFun"></u-select>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let that = '';
|
||||
import { getNowDate, getDayFun } from '../../static/utils/date.js'
|
||||
import { crmBaoJiaDanApi, crmShangJiApi } from '../../static/utils/api.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectShow: false,
|
||||
selectList: [],
|
||||
selectType: '',
|
||||
PaymentTypeNameList: [{text: '现款'},{text: '帐期'}],
|
||||
AllocatedBillNo: '',
|
||||
AllocatedDate:'',
|
||||
CustomerID: '',
|
||||
CustomerName: '',
|
||||
PlanDepartmentID: '',
|
||||
PlanDepartmentName: '',
|
||||
SaleUserID: '',
|
||||
SaleUserName: '',
|
||||
PaymentTypeName: '',
|
||||
ShipCompanyName: '',
|
||||
SaleCustomerAddress: '',
|
||||
Remark: '',
|
||||
SaleOutRemark: '',
|
||||
sjLaiYuan: '',
|
||||
describe: '',
|
||||
bjdDate: '',
|
||||
bjdDateTime: '',
|
||||
cpList: [],
|
||||
cpHzObj: {
|
||||
totalNum: 0,
|
||||
price: 0,
|
||||
discount: 0,
|
||||
sumPrice: 0
|
||||
},
|
||||
isTjcp: false,
|
||||
isGlsj: false,
|
||||
fuZeRenId: getApp().globalData.EmployeeID,
|
||||
fuZeRen: getApp().globalData.UserName,
|
||||
pageType: '',
|
||||
xgInfoObj: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cpList: function(val, old) {
|
||||
that.cpCalcFun();
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
that = this;
|
||||
if(e.type == 'update') {
|
||||
that.setDataFun();
|
||||
that.pageType = 'update';
|
||||
that.navbarTitle = '修改报价单信息';
|
||||
}
|
||||
if(e.clientName) {
|
||||
that.clientName = e.clientName;
|
||||
}
|
||||
if(e.clientId) {
|
||||
that.clientId = e.clientId;
|
||||
}
|
||||
uni.$on('bjdKehuBindFun', that.bjdKehuBindFun)
|
||||
uni.$on('chanpinBindFun', that.chanpinBindFun)
|
||||
uni.$on('bjdLxrBindFun', that.bjdLxrBindFun)
|
||||
uni.$on('shangjiBindFun', that.shangjiBindFun)
|
||||
},
|
||||
|
||||
onBackPress() {
|
||||
uni.$off('bjdKehuBindFun', that.bjdKehuBindFun)
|
||||
uni.$off('chanpinBindFun', that.chanpinBindFun)
|
||||
uni.$off('bjdLxrBindFun', that.bjdLxrBindFun)
|
||||
uni.$off('shangjiBindFun', that.shangjiBindFun)
|
||||
},
|
||||
methods: {
|
||||
// 日期修改
|
||||
bindDateChange: function(e) {
|
||||
that.bjdDate = e.detail.value;
|
||||
that.bjdDateTime = new Date(e.detail.value + ' 00:00:00').getTime()
|
||||
},
|
||||
// 展示相应数据选择框
|
||||
pickerSelectFun: function(str) {
|
||||
if(str == '结算方式') {
|
||||
that.selectList = [
|
||||
{ value: 0, label: '现款'},
|
||||
{ value: 1, label: '账期'}
|
||||
]
|
||||
}
|
||||
that.selectShow = true;
|
||||
that.selectType = str;
|
||||
},
|
||||
// 选择框选中事件
|
||||
selectConfirmFun: function(e) {
|
||||
if(that.selectType == '结算方式') {
|
||||
that.PaymentTypeName = e[0].label;
|
||||
}
|
||||
},
|
||||
|
||||
scanFun: function () {
|
||||
uni.scanCode({
|
||||
success(res) {
|
||||
that.code = res.result;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选择所属客户
|
||||
selectCustomer: function() {
|
||||
uni.navigateTo({
|
||||
url: '../basedata/customer/customer?type=saleallocated'
|
||||
})
|
||||
},
|
||||
// 绑定客户
|
||||
bjdKehuBindFun: function(e) {
|
||||
that.CustomerID = e.CustomerID;
|
||||
that.CustomerName = e.CustomerName;
|
||||
that.PlanDepartmentID = e.PlanDepartmentID;
|
||||
that.PlanDepartmentName = e.PlanDepartmentName;
|
||||
that.SaleUserID = e.SaleUserID;
|
||||
that.SaleUserName = e.SaleUserName;
|
||||
that.SaleCustomerAddress = e.CustomerAddress+' '+e.CustomerPhone+' '+e.CustomerLinkName;
|
||||
/*
|
||||
that.clientId = e.clientId;
|
||||
that.clientName = e.clientName;
|
||||
*/
|
||||
},
|
||||
// 选择客户联系人
|
||||
selectLxrFun: function() {
|
||||
if(!that.clientId) {
|
||||
uni.$myModalFun('请先关联客户!')
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '../lianxiren/lianxiren?type=bjd&clientId=' + that.clientId
|
||||
})
|
||||
},
|
||||
// 绑定联系人
|
||||
bjdLxrBindFun: function(e) {
|
||||
that.clientLxrId = e.lxrId;
|
||||
that.clientLxr = e.lxrName;
|
||||
},
|
||||
// 选择商机
|
||||
selectShangJiFun: function() {
|
||||
if(!that.clientId) {
|
||||
uni.$myModalFun('请先关联客户!')
|
||||
return
|
||||
}
|
||||
that.isGlsj = true;
|
||||
uni.navigateTo({
|
||||
url: '../shangji/shangji?type=bjd&clientId=' + that.clientId
|
||||
})
|
||||
},
|
||||
// 绑定商机
|
||||
shangjiBindFun: function(e) {
|
||||
that.sjId = e._id;
|
||||
that.sjName = e.sjName;
|
||||
that.clientId = e.clientId;
|
||||
that.clientName = e.clientName;
|
||||
that.clientLxrId = e.clientLxrId;
|
||||
that.clientLxr = e.clientLxr;
|
||||
if(that.isGlsj) {
|
||||
setTimeout(()=> {
|
||||
if(e.cpNum) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '该商机下有' + e.cpNum + '种产品信息,是否关联或替换至该报价单中?',
|
||||
success(res) {
|
||||
if(res.confirm) {
|
||||
that.getCpBysjIdFun(e._id)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}, 8)
|
||||
that.isGlsj = false;
|
||||
}
|
||||
},
|
||||
// 添加相关产品
|
||||
addChanPinFun: function() {
|
||||
if (that.CustomerName == "")
|
||||
{
|
||||
uni.showToast({
|
||||
title: '客户名称不能为空,请先选择!',
|
||||
duration: 2000
|
||||
});
|
||||
return
|
||||
}
|
||||
console.log("--->>" + that.CustomerID +'<<<<');
|
||||
uni.navigateTo({
|
||||
url: '../../chanpin/view/shop?customerid=' + that.CustomerID
|
||||
//url: '../../chanpin/view/shop?type=baojiadan'
|
||||
})
|
||||
that.isTjcp = true;
|
||||
},
|
||||
// 绑定产品
|
||||
|
||||
|
||||
chanpinBindFun: function(e) {
|
||||
let obj = {
|
||||
pName: e.pName,
|
||||
price: e.price,
|
||||
unit: e.unit,
|
||||
cpId: e._id,
|
||||
sellingPrice: e.price,
|
||||
discount: 100,
|
||||
num: 1,
|
||||
totalPrice: e.price
|
||||
}
|
||||
if(that.isTjcp) {
|
||||
let arr = that.cpList;
|
||||
let isSave = false;
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
if(arr[i].cpId == obj.cpId) {
|
||||
isSave = true;
|
||||
}
|
||||
}
|
||||
if(!isSave) {
|
||||
arr = arr.concat(obj);
|
||||
that.cpList = arr;
|
||||
setTimeout(() => {
|
||||
uni.pageScrollTo({
|
||||
duration: 100,
|
||||
scrollTop: 100000
|
||||
})
|
||||
}, 88)
|
||||
} else {
|
||||
setTimeout(()=> {
|
||||
uni.showToast({
|
||||
title: '该产品已存在!',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
}, 88)
|
||||
}
|
||||
that.isTjcp = false;
|
||||
}
|
||||
},
|
||||
// 删除产品
|
||||
deleteCpFun: function(iii) {
|
||||
let item = that.cpList[iii];
|
||||
if(item._id) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确认要删除该产品?',
|
||||
success(res) {
|
||||
if(res.confirm) {
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
let reqData = {
|
||||
action: 'deleteCp',
|
||||
params: {
|
||||
_id: item._id
|
||||
}
|
||||
}
|
||||
crmBaoJiaDanApi(reqData)
|
||||
.then(res => {
|
||||
that.cpList.splice(iii, 1)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.cpList.splice(iii, 1)
|
||||
}
|
||||
},
|
||||
// 售价修改
|
||||
cpPriceUpdateFun: function(iii, item) {
|
||||
let arr = that.cpList;
|
||||
let sellingPrice = item.sellingPrice;
|
||||
item.discount = ((item.sellingPrice / item.price) * 100).toFixed(2);
|
||||
that.$set(that.cpList, iii, item);
|
||||
that.cpCalcFun();
|
||||
},
|
||||
// 折扣修改
|
||||
cpDiscountUpdateFun: function (iii, item) {
|
||||
let arr = that.cpList;
|
||||
let discount = item.discount;
|
||||
item.sellingPrice = (item.price * discount / 100).toFixed(2);
|
||||
that.$set(that.cpList, iii, item);
|
||||
that.cpCalcFun();
|
||||
},
|
||||
// 产品总折扣修改
|
||||
cpzzkXgFun: function () {
|
||||
that.cpHzObj.sumPrice = (that.cpHzObj.discount * that.cpHzObj.price / 100).toFixed(2);
|
||||
that.bjPrice = that.cpHzObj.sumPrice;
|
||||
},
|
||||
// 产品最终价格修改
|
||||
cpzzPriceXgFun: function() {
|
||||
that.cpHzObj.discount = (that.cpHzObj.sumPrice / that.cpHzObj.price * 100).toFixed(2);
|
||||
that.bjPrice = that.cpHzObj.sumPrice;
|
||||
},
|
||||
// 订单价格修改
|
||||
orderPriceXgFun: function() {
|
||||
if(that.cpList.length > 0) {
|
||||
that.cpHzObj.sumPrice = that.bjPrice;
|
||||
that.cpHzObj.discount = (that.bjPrice / that.cpHzObj.price * 100).toFixed(2);
|
||||
}
|
||||
},
|
||||
// 计算金额
|
||||
cpCalcFun: function() {
|
||||
let arr = that.cpList;
|
||||
let bjPrice = 0;
|
||||
let zprice = 0;
|
||||
let totalNum = 0;
|
||||
for(var i = 0; i < arr.length; i++) {
|
||||
arr[i].totalPrice = (parseFloat(arr[i].sellingPrice) * arr[i].num).toFixed(2);
|
||||
bjPrice += parseFloat(arr[i].totalPrice);
|
||||
zprice += parseFloat(arr[i].price) * arr[i].num;
|
||||
totalNum += arr[i].num;
|
||||
}
|
||||
that.cpHzObj.price = zprice.toFixed(2);
|
||||
that.cpHzObj.discount = (bjPrice / that.cpHzObj.price * 100).toFixed(2);
|
||||
if(that.cpHzObj.discount == 'NaN') {
|
||||
that.cpHzObj.discount = 0;
|
||||
}
|
||||
that.cpHzObj.sumPrice = bjPrice.toFixed(2);
|
||||
that.cpHzObj.totalNum = totalNum;
|
||||
that.cpList = arr;
|
||||
if(bjPrice == 0) {
|
||||
that.bjPrice = '';
|
||||
} else {
|
||||
that.bjPrice = bjPrice.toFixed(2);
|
||||
}
|
||||
},
|
||||
// 提交按钮方法
|
||||
submitBtnFun: function() {
|
||||
if(!that.bjName) {
|
||||
uni.$myModalFun('报价名称不能为空,请输入!');
|
||||
return
|
||||
}
|
||||
if(!that.clientName) {
|
||||
uni.$myModalFun('报价单所属客户不能为空,请选择!');
|
||||
return
|
||||
}
|
||||
if(!that.bjPrice) {
|
||||
uni.$myModalFun('报价金额不能为空,请输入或者添加产品自动计算!');
|
||||
return
|
||||
}
|
||||
let req = {
|
||||
bjName: that.bjName,
|
||||
sjName: that.sjName,
|
||||
sjId: that.sjId,
|
||||
cpNum: that.cpList.length,
|
||||
// clientName: that.clientName,
|
||||
clientId: that.clientId,
|
||||
clientLxr: that.clientLxr,
|
||||
clientLxrId: that.clientLxrId,
|
||||
bjPrice: that.bjPrice,
|
||||
describe: that.describe,
|
||||
bjdDate: that.bjdDate,
|
||||
bjdDateTime: that.bjdDateTime,
|
||||
// cpList: that.cpList,
|
||||
fuZeRenId: that.fuZeRenId,
|
||||
fuZeRen: that.fuZeRen,
|
||||
}
|
||||
let dateArr = getDayFun();
|
||||
let nowDate = getNowDate().nowDate;
|
||||
let fgArr = nowDate.split(" ");
|
||||
let dateStr = (fgArr[0]).replace(/-/g, "");
|
||||
// if(that.cpList.length > 0) {
|
||||
// req.cpHzObj = that.cpHzObj;
|
||||
// }
|
||||
let reqObj = {
|
||||
cpList: that.cpList,
|
||||
req
|
||||
}
|
||||
let action = 'addBaoJiaDan';
|
||||
if (that.pageType == 'update') {
|
||||
action = 'update'
|
||||
reqObj._id = that.xgInfoObj._id;
|
||||
reqObj.req.update_date = new Date().getTime();
|
||||
uni.showLoading({
|
||||
title: '修改中...'
|
||||
})
|
||||
} else {
|
||||
reqObj.req.create_date = new Date().getTime();
|
||||
reqObj.req.update_date = new Date().getTime();
|
||||
reqObj.req.cjRen = uni.$userInfo.xingMing;
|
||||
reqObj.req.cjRenId = uni.$userInfo._id;
|
||||
reqObj.startDate = dateArr[0];
|
||||
reqObj.endDate = dateArr[1];
|
||||
reqObj.dateStr = parseInt(dateStr);
|
||||
uni.showLoading({
|
||||
title: '提交中...'
|
||||
})
|
||||
}
|
||||
let reqData = {
|
||||
action: action,
|
||||
params: reqObj
|
||||
}
|
||||
crmBaoJiaDanApi(reqData)
|
||||
.then(res => {
|
||||
if (action == 'update') {
|
||||
that.addCzjlFun();
|
||||
uni.showToast({
|
||||
title: '报价单修改成功',
|
||||
icon: 'none',
|
||||
duration: 1000,
|
||||
mask: true
|
||||
})
|
||||
setTimeout(()=> {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '报价单新增成功',
|
||||
icon: 'none',
|
||||
duration: 1000,
|
||||
mask: true
|
||||
})
|
||||
reqObj.req._id = res.result.id;
|
||||
reqObj.req.clientName = that.clientName;
|
||||
uni.$emit('addBjdItemInListFun')
|
||||
setTimeout(()=> {
|
||||
uni.redirectTo({
|
||||
url: './detail?index=0&fromDetail=true&alloAllocatedMasterID=' + res.result.id
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
},
|
||||
addCzjlFun: function(action, _id) {
|
||||
let czjlObj = {
|
||||
create_date: new Date().getTime(),
|
||||
czRen: uni.$userInfo._id,
|
||||
pageType: 'quotation',
|
||||
}
|
||||
let xgInfoObj = that.xgInfoObj;
|
||||
czjlObj.dataId = xgInfoObj._id;
|
||||
czjlObj.type = '编辑';
|
||||
czjlObj.newUpdate = new Date().getTime();
|
||||
czjlObj.oldUpdate = xgInfoObj.update_date;
|
||||
let content = [];
|
||||
let str = '';
|
||||
if(that.bjName != xgInfoObj.bjName) {
|
||||
str = '修改 报价单名称 ,由 "' + xgInfoObj.bjName + '" 变更为 "' + that.bjName + '"'
|
||||
content.push(str)
|
||||
}
|
||||
if(that.sjName != xgInfoObj.sjName) {
|
||||
str = '修改 商机 ,由 "' + xgInfoObj.sjName + '" 变更为 "' + that.sjName + '"'
|
||||
content.push(str)
|
||||
}
|
||||
if(that.clientName != xgInfoObj.clientName) {
|
||||
str = '修改 客户 ,由 "' + xgInfoObj.clientName + '" 变更为 "' + that.clientName + '"'
|
||||
content.push(str)
|
||||
}
|
||||
if(that.bjName != xgInfoObj.bjName) {
|
||||
str = '修改 报价单名称 ,由 "' + xgInfoObj.bjName + '" 变更为 "' + that.bjName + '"'
|
||||
content.push(str)
|
||||
}
|
||||
if(that.clientLxrId != xgInfoObj.clientLxrId) {
|
||||
str = '修改 联系人 ,由 "' + xgInfoObj.clientLxr + '" 变更为 "' + that.clientLxr + '"'
|
||||
content.push(str)
|
||||
}
|
||||
if(that.bjPrice != xgInfoObj.bjPrice) {
|
||||
str = '修改 报价金额 ,由 "' + xgInfoObj.bjPrice + '" 变更为 "' + that.bjPrice + '"'
|
||||
content.push(str)
|
||||
}
|
||||
if(that.describe != xgInfoObj.describe) {
|
||||
str = '修改 备注 ,由 "' + xgInfoObj.describe + '" 变更为 "' + that.describe + '"'
|
||||
content.push(str)
|
||||
}
|
||||
if(that.bjdDate != xgInfoObj.bjdDate) {
|
||||
str = '修改 报价日期 ,由 "' + xgInfoObj.bjdDate + '" 变更为 "' + that.bjdDate + '"'
|
||||
content.push(str)
|
||||
}
|
||||
if(that.fuZeRen != xgInfoObj.fuZeRen) {
|
||||
str = '修改 负责人 ,由 "' + xgInfoObj.fuZeRen + '" 变更为 "' + that.fuZeRen + '"'
|
||||
content.push(str)
|
||||
}
|
||||
czjlObj.content = content;
|
||||
uni.$czjlApiAddFun(czjlObj);
|
||||
},
|
||||
// 数据恢复
|
||||
setDataFun: function() {
|
||||
let obj = uni.$infoObj
|
||||
that.xgInfoObj = uni.$infoObj
|
||||
that.bjName = obj.bjName
|
||||
that.sjName = obj.sjName
|
||||
that.sjId = obj.sjId
|
||||
that.clientName = obj.clientName
|
||||
that.clientId = obj.clientId
|
||||
that.clientLxr = obj.clientLxr
|
||||
that.clientLxrId = obj.clientLxrId
|
||||
that.bjPrice = obj.bjPrice
|
||||
that.describe = obj.describe
|
||||
that.bjdDate = obj.bjdDate
|
||||
that.bjdDateTime = obj.bjdDateTime
|
||||
// that.cpList = obj.cpList
|
||||
// that.cpHzObj = obj.cpHzObj || {}
|
||||
that.fuZeRenId = obj.fuZeRenId
|
||||
that.fuZeRen = obj.fuZeRen
|
||||
that.getCpByIdFun()
|
||||
},
|
||||
getCpByIdFun: function() {
|
||||
let reqData = {
|
||||
action: 'getCp',
|
||||
params: {
|
||||
bjdId: that.xgInfoObj._id
|
||||
}
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
crmBaoJiaDanApi(reqData)
|
||||
.then(res => {
|
||||
let data = res.result.data;
|
||||
if(data.length > 0) {
|
||||
let cpHzObj = {
|
||||
discount: 0,
|
||||
price: 0,
|
||||
sumPrice: 0,
|
||||
totalNum: 0
|
||||
};
|
||||
for(var i = 0; i < data.length; i++) {
|
||||
var obj = data[i];
|
||||
obj.discount = (obj.sellingPrice / obj.price * 100).toFixed(2);
|
||||
obj.totalPrice = (obj.sellingPrice * obj.num).toFixed(2);
|
||||
data[i] = obj;
|
||||
cpHzObj.price += parseFloat(obj.price) * obj.num;
|
||||
cpHzObj.sumPrice += parseFloat(obj.sellingPrice) * obj.num;
|
||||
cpHzObj.totalNum += obj.num;
|
||||
}
|
||||
cpHzObj.discount = cpHzObj.sumPrice / cpHzObj.price * 100;
|
||||
that.cpHzObj = cpHzObj;
|
||||
that.cpList = data;
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据商机id查询产品
|
||||
getCpBysjIdFun: function(sjId) {
|
||||
let reqData = {
|
||||
action: 'getCp',
|
||||
params: {
|
||||
sjId: sjId
|
||||
}
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中...'
|
||||
})
|
||||
crmShangJiApi(reqData)
|
||||
.then(res => {
|
||||
let data = res.result.data;
|
||||
if(data.length > 0) {
|
||||
let cpHzObj = {
|
||||
discount: 0,
|
||||
price: 0,
|
||||
sumPrice: 0,
|
||||
totalNum: 0
|
||||
};
|
||||
for(var i = 0; i < data.length; i++) {
|
||||
var obj = data[i];
|
||||
obj._id = '';
|
||||
obj.discount = (obj.sellingPrice / obj.price * 100).toFixed(2);
|
||||
obj.totalPrice = (obj.sellingPrice * obj.num).toFixed(2);
|
||||
data[i] = obj;
|
||||
cpHzObj.price += parseFloat(obj.price) * obj.num;
|
||||
cpHzObj.sumPrice += parseFloat(obj.sellingPrice) * obj.num;
|
||||
cpHzObj.totalNum += obj.num;
|
||||
}
|
||||
cpHzObj.discount = cpHzObj.sumPrice / cpHzObj.price * 100;
|
||||
that.cpHzObj = cpHzObj;
|
||||
that.cpList = data;
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #F8F8F8;
|
||||
padding-bottom: 260rpx;
|
||||
}
|
||||
.u-radio {
|
||||
width: 200rpx !important;
|
||||
}
|
||||
.submitView {
|
||||
width: 100%;
|
||||
padding: 16rpx 0 26rpx;
|
||||
background-color: #FFFFFF;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
border-top: 1rpx solid #f1f1f1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 100;
|
||||
}
|
||||
.submitBtn {
|
||||
width: 666rpx;
|
||||
}
|
||||
.productBox {
|
||||
background-color: #FFFFFF;
|
||||
margin-top: 32rpx;
|
||||
padding: 26rpx 0;
|
||||
}
|
||||
.tjcpName {
|
||||
width: 686rpx;
|
||||
height: 40rpx;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
border-left: 6rpx solid #007AFF;
|
||||
padding-left: 12rpx;
|
||||
margin-left: 26rpx;
|
||||
margin-top: 26rpx;
|
||||
}
|
||||
.cpInput {
|
||||
width: 150rpx !important;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.cpInput>input {
|
||||
box-sizing: border-box;
|
||||
border: 1rpx solid #DDDDDD;
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
.cpInput1 {
|
||||
width: 200rpx !important;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
.cpInput1>input {
|
||||
box-sizing: border-box;
|
||||
border: 1rpx solid #DDDDDD;
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
border-radius: 10rpx;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
.clearIcon {
|
||||
position: absolute;
|
||||
right: 6rpx;
|
||||
top: 6rpx;
|
||||
}
|
||||
.greenPrice {
|
||||
font-size: 16px;
|
||||
color: #19BE6B !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
.disFlex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
.inputName {
|
||||
color: #ADADAD;
|
||||
font-size: 16px;
|
||||
}
|
||||
.addHKQS {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 26rpx;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,468 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-form ref="uForm">
|
||||
<u-form-item label-width="80" label="单号:">
|
||||
<text class="title" style="width:300px;">{{storeInData.BillGUID}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="80" label="仓位:">
|
||||
<input type="text" v-model="storeInData.StoreStationNo" :focus="aPositionFocus0" style="width:80px;"
|
||||
@confirm="GetStoreStationName" />
|
||||
<text class="title" style="width:100px;">名称: {{storeInData.StoreStationName}}</text>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="CreateNewBillMaster">新增单据</button>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="80" label="机号:">
|
||||
<input type="text" v-model="storeInData.WeaveMachineNo" :focus="aPositionFocus1" style="width:150px;"
|
||||
@confirm="GetWeaveMachineNo"/>
|
||||
<text class="title" style="width:50px;">重量: </text>
|
||||
<input type="text" v-model="storeInData.Qty" :focus="aPositionFocus2" style="width:150px;"
|
||||
@confirm="GetStoreInDataQty"/>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="80" label="条码:">
|
||||
<input type="text" v-model="storeInData.QRBarCode" :focus="aPositionFocus3" style="width:150px;"
|
||||
@confirm="StoreFabricBarCodeScanIn" />
|
||||
<text class="title" style="width:150px;">布号: {{storeInData.FabricBillNo}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title">{{BillDataMessage}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="80" label="织厂:">
|
||||
<text class="title" style="width:150px;">{{storeInData.WeaveFactoryName}}</text>
|
||||
<text class="title" style="width:150px;">编号: {{storeInData.FabricEmbryoNo}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="80" label="品名:">
|
||||
<text class="title" style="width:150px;">{{storeInData.FabricEmbryoName}}</text>
|
||||
<text class="title" style="width:300px;">颜色: {{storeInData.EmbryoCodeNo}}{{storeInData.EmbryoCodeName}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="80" label="条数:">
|
||||
<text class="title" style="width:150px;">{{storeInData.SumRoll}}</text>
|
||||
<text class="title" style="width:150px;">重量:{{storeInData.SumQty}}</text>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<view class="u-demo-area">
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<wyb-table ref="table" :headers="storeInData.headersMaster"
|
||||
:contents="storeInData.saleInDetailDataList" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import util, {
|
||||
parFabricGoodsBarCode2D,
|
||||
parYarnGoodsBarCode2D,
|
||||
playSuccessAudio,
|
||||
playErrorAudio,
|
||||
guid
|
||||
} from '../../common/util';
|
||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
aPositionFocus0: true,
|
||||
aPositionFocus1: false,
|
||||
aPositionFocus2: false,
|
||||
aPositionFocus3: false,
|
||||
storeInData: {
|
||||
BillGUID:'',
|
||||
QRBarCode: '',
|
||||
StoreNameID: '0',
|
||||
StoreStationNo: '',
|
||||
StoreStationName: '',
|
||||
WeaveFactoryID: 0,
|
||||
WeaveFactoryName: '',
|
||||
FabricEmbryoID: 0,
|
||||
FabricEmbryoNo: '',
|
||||
FabricEmbryoName: '',
|
||||
EmbryoCodeID: 0,
|
||||
EmbryoCodeNo: '',
|
||||
EmbryoCodeName: '',
|
||||
WeaveMachineNo: '',
|
||||
FabricBillNo: '',
|
||||
Qty: '',
|
||||
SumRoll: '',
|
||||
SumQty: '',
|
||||
saleInDetailDataList: [],
|
||||
headersMaster: [{
|
||||
label: '织厂',
|
||||
key: 'WeaveFactoryName'
|
||||
},{
|
||||
label: '编号',
|
||||
key: 'FabricEmbryoNo'
|
||||
}, {
|
||||
label: '色号',
|
||||
key: 'EmbryoCodeNo'
|
||||
}, {
|
||||
label: '条数',
|
||||
key: 'Roll'
|
||||
}, {
|
||||
label: '重量',
|
||||
key: 'Qty'
|
||||
}, {
|
||||
label: '颜色',
|
||||
key: 'EmbryoCodeName'
|
||||
}, {
|
||||
label: '机号',
|
||||
key: 'WeaveMachineNo'
|
||||
}],
|
||||
},
|
||||
BillDataMessage: '',
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
playSuccess() {
|
||||
util.playSuccessAudio();
|
||||
},
|
||||
playError() {
|
||||
util.playErrorAudio();
|
||||
},
|
||||
GetStoreStationName: function() {
|
||||
if (this.storeInData.BillGUID == ''){
|
||||
this.playError();
|
||||
this.BillDataMessage = '请先按新增单据再输入扫描!';
|
||||
return;
|
||||
};
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.GetStoreStationName',
|
||||
params: [{
|
||||
name: 'No',
|
||||
value: this.storeInData.StoreStationNo
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
this.playSuccess();
|
||||
var aResultData = res.data.data;
|
||||
for (var i = 0; i < aResultData.length; i++) {
|
||||
this.storeInData.StoreStationName = aResultData[i].StoreStationName;
|
||||
this.storeInData.StoreNameID = parseInt(aResultData[i].StoreNameID);
|
||||
};
|
||||
this.aPositionFocus0 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus1 = true;
|
||||
this.aPositionFocus2 = false;
|
||||
this.aPositionFocus3 = false;
|
||||
});
|
||||
} else {
|
||||
this.playError();
|
||||
this.StoreStationName = "",
|
||||
this.storeInData.StoreNameID = 0,
|
||||
this.storeInData.BillDataMessage = '不存在当前的仓位资料,请确认!';
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
this.playError();
|
||||
this.BillDataMessage = '连接服务器出错,请检查后台服务是否启动!' + res.data.msg;
|
||||
},
|
||||
})
|
||||
},
|
||||
GetWeaveMachineNo(){
|
||||
if (this.storeInData.BillGUID == ''){
|
||||
this.playError();
|
||||
this.BillDataMessage = '请先按新增单据再输入扫描!';
|
||||
return;
|
||||
};
|
||||
this.aPositionFocus1 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus0 = false;
|
||||
this.aPositionFocus2 = true;
|
||||
this.aPositionFocus3 = false;
|
||||
});
|
||||
this.playSuccess();
|
||||
},
|
||||
GetStoreInDataQty(){
|
||||
if (this.storeInData.BillGUID == ''){
|
||||
this.playError();
|
||||
this.BillDataMessage = '请先按新增单据再输入扫描!';
|
||||
return;
|
||||
};
|
||||
this.aPositionFocus2 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus0 = false;
|
||||
this.aPositionFocus1 = false;
|
||||
this.aPositionFocus3 = true;
|
||||
});
|
||||
this.playSuccess();
|
||||
},
|
||||
|
||||
CreateNewBillMaster() {
|
||||
this.storeInData.BillGUID = guid();
|
||||
console.log("-------->" + this.storeInData.BillGUID + "<----");
|
||||
this.aPositionFocus0 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus0 = true;
|
||||
this.aPositionFocus1 = false;
|
||||
this.aPositionFocus2 = false;
|
||||
this.aPositionFocus3 = false;
|
||||
});
|
||||
this.playSuccess();
|
||||
},
|
||||
|
||||
GetStoreInDataList: function() {
|
||||
this.CarryDetailList = [];
|
||||
this.BillID = 0;
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP_GetStoreFabricInStoreMaster',
|
||||
params: [{
|
||||
name: 'GUID',
|
||||
value: this.storeInData.BillGUID
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
this.playSuccess();
|
||||
var aResultData = res.data.data;
|
||||
this.storeInData.saleInDetailDataList = [];
|
||||
for (var i = 0; i < aResultData.length; i++) {
|
||||
this.storeInData.saleInDetailDataList.push(aResultData[i]);
|
||||
};
|
||||
this.testFocus2 = false;
|
||||
this.$nextTick(() => {
|
||||
this.testFocus2 = true;
|
||||
});
|
||||
|
||||
} else if (res.data.status == 0 && res.data.count <= 0) {
|
||||
this.playError();
|
||||
this.testFocus2 = false;
|
||||
this.$nextTick(() => {
|
||||
this.testFocus2 = true;
|
||||
});
|
||||
} else {
|
||||
this.playError();
|
||||
this.testFocus2 = false;
|
||||
this.$nextTick(() => {
|
||||
this.testFocus2 = true;
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
this.playError();
|
||||
this.testFocus2 = false;
|
||||
this.$nextTick(() => {
|
||||
this.testFocus2 = true;
|
||||
});
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '连接服务器出错,请检查后台服务是否启动!' + res.data.msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
StoreFabricBarCodeScanIn() {
|
||||
if (this.storeInData.BillGUID == ''){
|
||||
this.playError();
|
||||
this.BillDataMessage = '请先按新增单据再输入扫描!';
|
||||
return;
|
||||
};
|
||||
if (this.storeInData.WeaveMachineNo == ''){
|
||||
this.playError();
|
||||
this.BillDataMessage = '请先输入机号再扫描!';
|
||||
return;
|
||||
};
|
||||
if (this.storeInData.Qty == ''){
|
||||
this.playError();
|
||||
this.BillDataMessage = '请先输入重量再扫描!';
|
||||
return;
|
||||
};
|
||||
var aStrBarCode = this.storeInData.QRBarCode;
|
||||
aStrBarCode = aStrBarCode.trimRight().trimLeft();
|
||||
console.log("-------->" + aStrBarCode + "<----");
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/storedproc',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
proc_name: 'Usp_APP_StoreFabricBarCodeScanIn',
|
||||
method: 'open_proc',
|
||||
params: [{
|
||||
name: '@BarCode',
|
||||
value: aStrBarCode
|
||||
},{
|
||||
name: '@SaleOrderMasterID',
|
||||
value: '0'
|
||||
},{
|
||||
name: '@CustomerID',
|
||||
value: '0'
|
||||
},{
|
||||
name: '@FabricGoodsID',
|
||||
value: '0'
|
||||
},{
|
||||
name: '@GoodsCodeID',
|
||||
value: '0'
|
||||
},{
|
||||
name: '@WeaveFactoryID',
|
||||
value: '0'
|
||||
},{
|
||||
name: '@WeaveMachineNo',
|
||||
value: ''
|
||||
},{
|
||||
name: '@ImportFileName',
|
||||
value: this.storeInData.BillGUID
|
||||
},{
|
||||
name: '@DeleteStatus',
|
||||
value: '0'
|
||||
},{
|
||||
name: '@StoreStationName',
|
||||
value: this.storeInData.StoreStationName
|
||||
},{
|
||||
name: '@InWeaveMachineNo',
|
||||
value: this.storeInData.WeaveMachineNo
|
||||
},{
|
||||
name: '@InQty',
|
||||
value: this.storeInData.Qty
|
||||
},{
|
||||
name: '@UserName',
|
||||
value: getApp().globalData.UserName
|
||||
}
|
||||
]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0) {
|
||||
console.log(res.data.data.toString());
|
||||
var aResultData = JSON.parse(res.data.data);
|
||||
if (aResultData.BillDataStatus == '0' && aResultData.BillDataMessage == 'SUCCESS') {
|
||||
this.playSuccess();
|
||||
this.storeInData.WeaveFactoryID = aResultData.WeaveFactoryID;
|
||||
this.storeInData.WeaveFactoryName = aResultData.WeaveFactoryName;
|
||||
this.storeInData.FabricEmbryoID = aResultData.FabricEmbryoID;
|
||||
this.storeInData.FabricEmbryoNo = aResultData.FabricEmbryoNo;
|
||||
this.storeInData.FabricEmbryoName = aResultData.FabricEmbryoName;
|
||||
this.storeInData.EmbryoCodeID = aResultData.EmbryoCodeID;
|
||||
this.storeInData.EmbryoCodeNo = aResultData.EmbryoCodeNo + '#';
|
||||
this.storeInData.EmbryoCodeName = aResultData.EmbryoCodeName;
|
||||
this.storeInData.FabricBillNo = aResultData.FabricBillNo;
|
||||
this.storeInData.SumRoll = aResultData.SumRoll;
|
||||
this.storeInData.SumQty = aResultData.SumQty;
|
||||
this.BillDataMessage = '扫描成功!';
|
||||
this.storeInData.Qty = '';
|
||||
this.storeInData.QRBarCode = '';
|
||||
this.GetStoreInDataList();
|
||||
this.aPositionFocus3 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus0 = false;
|
||||
this.aPositionFocus1 = false;
|
||||
this.aPositionFocus2 = true;
|
||||
});
|
||||
} else {
|
||||
this.playError();
|
||||
this.storeInData.Qty = '';
|
||||
this.storeInData.QRBarCode = '';
|
||||
this.BillDataMessage = '入仓出错,' + aResultData.BillDataMessage;
|
||||
this.aPositionFocus3 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus0 = false;
|
||||
this.aPositionFocus1 = false;
|
||||
this.aPositionFocus2 = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this.playError();
|
||||
this.storeInData.Qty = '';
|
||||
this.storeInData.QRBarCode = '';
|
||||
this.BillDataMessage = '入仓出错,' + res.data.msg;
|
||||
this.aPositionFocus3 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus0 = false;
|
||||
this.aPositionFocus1 = false;
|
||||
this.aPositionFocus2 = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
this.playError();
|
||||
this.QRBarCode = '';
|
||||
this.aPositionFocus3 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus0 = false;
|
||||
this.aPositionFocus1 = false;
|
||||
this.aPositionFocus2 = true;
|
||||
});
|
||||
this.BillDataMessage = '入仓出错,' + res.data.msg;
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '连接服务器出错,请检查后台服务是否启动!' + res.data.msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import 'index.scss';
|
||||
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.wrap .search {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.apply-text {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
|
||||
span {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.user-images {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.apply-list-foot {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.personnel-list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.personnel-user {
|
||||
position: relative;
|
||||
margin: 5px 9px 0;
|
||||
}
|
||||
|
||||
.user-images {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin-right: 0;
|
||||
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: -5px;
|
||||
color: #FE0100;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,382 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-form ref="uForm">
|
||||
<u-form-item label-width="80" label="单号:">
|
||||
<text class="title" style="width:300px;">{{storeOutData.BillGUID}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item label="染厂" label-width="150" >
|
||||
<u-input type="select" :select-open="DyeWorksNameShow"
|
||||
v-model="storeOutData.DyeWorksName" placeholder="请选择染厂名称"
|
||||
@click="DyeWorksNameShow = true">
|
||||
</u-input>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="80" label="条码:">
|
||||
<input type="text" v-model="storeOutData.QRBarCode" :focus="aPositionFocus0" style="width:150px;"
|
||||
@confirm="StoreFabricBarCodeScanOut" />
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="CreateNewBillMaster">新增单据</button>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="80" label="编号:">
|
||||
<text class="title" style="width:100px;">{{storeOutData.FabricEmbryoNo}}</text>
|
||||
<text class="title" style="width:250px;">品名: {{storeOutData.FabricEmbryoName}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="80" label="色号:">
|
||||
<text class="title" style="width:100px;">{{storeOutData.EmbryoCodeNo}}</text>
|
||||
<text class="title" style="width:250px;">颜色: {{storeOutData.EmbryoCodeName}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="80" label="织厂:">
|
||||
<text class="title" style="width:100px;">{{storeOutData.WeaveFactoryName}}</text>
|
||||
<text class="title" style="width:250px;">机号: {{storeOutData.WeaveMachineNo}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="80" label="布号:">
|
||||
<text class="title" style="width:100px;">{{storeOutData.FabricBillNo}}</text>
|
||||
<text class="title" style="width:250px;">条重: {{storeOutData.Qty}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title">{{BillDataMessage}}</text>
|
||||
</u-form-item>
|
||||
<u-form-item label-width="80" label="条数:">
|
||||
<text class="title" style="width:150px;">{{storeOutData.SumRoll}}</text>
|
||||
<text class="title" style="width:150px;">重量:{{storeOutData.SumQty}}</text>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<view class="u-demo-area">
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<wyb-table ref="table" :headers="storeOutData.headersMaster"
|
||||
:contents="storeOutData.StoreOutDetailDataList"/>
|
||||
</view>
|
||||
<u-action-sheet :list="DyeWorksNameList" v-model="DyeWorksNameShow"
|
||||
@click="DyeWroksNameDataCallback"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import util, {
|
||||
parFabricGoodsBarCode2D,
|
||||
parYarnGoodsBarCode2D,
|
||||
playSuccessAudio,
|
||||
playErrorAudio,
|
||||
guid
|
||||
} from '../../common/util';
|
||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
aPositionFocus0: true,
|
||||
labelPosition: 'left',
|
||||
DyeWorksNameShow: false,
|
||||
DyeWorksNameList:[],
|
||||
storeOutData: {
|
||||
BillGUID:'',
|
||||
QRBarCode: '',
|
||||
StoreNameID: '0',
|
||||
StoreStationNo: '',
|
||||
StoreStationName: '',
|
||||
DyeWorksID:'',
|
||||
DyeWorksName: '',
|
||||
WeaveFactoryID: 0,
|
||||
WeaveFactoryName: '',
|
||||
FabricEmbryoID: 0,
|
||||
FabricEmbryoNo: '',
|
||||
FabricEmbryoName: '',
|
||||
EmbryoCodeID: 0,
|
||||
EmbryoCodeNo: '',
|
||||
EmbryoCodeName: '',
|
||||
WeaveMachineNo: '',
|
||||
FabricBillNo: '',
|
||||
Qty: '',
|
||||
SumRoll: '',
|
||||
SumQty: '',
|
||||
StoreOutDetailDataList: [],
|
||||
headersMaster: [{
|
||||
label: '编号',
|
||||
key: 'FabricEmbryoNo'
|
||||
}, {
|
||||
label: '色号',
|
||||
key: 'EmbryoCodeNo'
|
||||
}, {
|
||||
label: '条数',
|
||||
key: 'Roll'
|
||||
}, {
|
||||
label: '重量',
|
||||
key: 'Qty'
|
||||
}, {
|
||||
label: '颜色',
|
||||
key: 'EmbryoCodeName'
|
||||
}, {
|
||||
label: '机号',
|
||||
key: 'WeaveMachineNo'
|
||||
}, {
|
||||
label: '织厂',
|
||||
key: 'WeaveFactoryName'
|
||||
}],
|
||||
},
|
||||
BillDataMessage: '',
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
playSuccess() {
|
||||
util.playSuccessAudio();
|
||||
},
|
||||
playError() {
|
||||
util.playErrorAudio();
|
||||
},
|
||||
DyeWroksNameDataCallback(index) {
|
||||
uni.hideKeyboard();
|
||||
this.storeOutData.DyeWorksName = this.DyeWorksNameList[index].text;
|
||||
this.storeOutData.DyeWorksID = this.DyeWorksNameList[index].CustomerID;
|
||||
console.log("------------->>>" + this.storeOutData.DyeWorksID )
|
||||
this.aPositionFocus0 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus0 = true;
|
||||
});
|
||||
},
|
||||
|
||||
CreateNewBillMaster() {
|
||||
this.storeOutData.BillGUID = guid();
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.GetBaseDataDyeWorksNameList',
|
||||
params: []
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
this.playSuccess();
|
||||
var aResultData = res.data.data;
|
||||
this.DyeWorksNameList = [];
|
||||
console.log("------------>>>>" + aResultData.length);
|
||||
for (var i = 0; i < aResultData.length; i++) {
|
||||
this.DyeWorksNameList.push(aResultData[i]);
|
||||
};
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
this.playSuccess();
|
||||
},
|
||||
|
||||
GetStoreOutDataList: function() {
|
||||
this.BillID = 0;
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP_GetStoreFabricOutStoreMaster',
|
||||
params: [{
|
||||
name: 'GUID',
|
||||
value: this.storeOutData.BillGUID
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
this.playSuccess();
|
||||
var aResultData = res.data.data;
|
||||
this.storeOutData.StoreOutDetailDataList = [];
|
||||
for (var i = 0; i < aResultData.length; i++) {
|
||||
this.storeOutData.StoreOutDetailDataList.push(aResultData[i]);
|
||||
};
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
this.playError();
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '连接服务器出错,请检查后台服务是否启动!' + res.data.msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
StoreFabricBarCodeScanOut() {
|
||||
if (this.storeOutData.BillGUID == ''){
|
||||
this.playError();
|
||||
this.BillDataMessage = '请先按新增单据再扫描条码!';
|
||||
return;
|
||||
};
|
||||
if (this.storeOutData.DyeWorksName == ''){
|
||||
this.playError();
|
||||
this.BillDataMessage = '请先选择染厂名称再扫描条码!';
|
||||
return;
|
||||
};
|
||||
var aStrBarCode = this.storeOutData.QRBarCode;
|
||||
aStrBarCode = aStrBarCode.trimRight().trimLeft();
|
||||
console.log("-------->" + aStrBarCode + "<----");
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/storedproc',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
proc_name: 'Usp_APP_StoreFabricBarCodeScanOut',
|
||||
method: 'open_proc',
|
||||
params: [{
|
||||
name: '@BarCode',
|
||||
value: aStrBarCode
|
||||
},{
|
||||
name: '@SaleOrderMasterID',
|
||||
value: '0'
|
||||
},{
|
||||
name: '@CustomerID',
|
||||
value: '0'
|
||||
},{
|
||||
name: '@FabricGoodsID',
|
||||
value: '0'
|
||||
},{
|
||||
name: '@GoodsCodeID',
|
||||
value: '0'
|
||||
},{
|
||||
name: '@WeaveFactoryID',
|
||||
value: '0'
|
||||
},{
|
||||
name: '@WeaveMachineNo',
|
||||
value: ''
|
||||
},{
|
||||
name: '@ImportFileName',
|
||||
value: this.storeOutData.BillGUID
|
||||
},{
|
||||
name: '@DeleteStatus',
|
||||
value: '0'
|
||||
},{
|
||||
name: '@DyeWorksID',
|
||||
value: this.storeOutData.DyeWorksID
|
||||
},{
|
||||
name: '@UserName',
|
||||
value: getApp().globalData.UserName
|
||||
}
|
||||
]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0) {
|
||||
console.log(res.data.data.toString());
|
||||
var aResultData = JSON.parse(res.data.data);
|
||||
if (aResultData.BillDataStatus == '0' && aResultData.BillDataMessage == 'SUCCESS') {
|
||||
this.playSuccess();
|
||||
this.storeOutData.WeaveFactoryID = aResultData.WeaveFactoryID;
|
||||
this.storeOutData.WeaveFactoryName = aResultData.WeaveFactoryName;
|
||||
this.storeOutData.FabricEmbryoID = aResultData.FabricEmbryoID;
|
||||
this.storeOutData.FabricEmbryoNo = aResultData.FabricEmbryoNo;
|
||||
this.storeOutData.FabricEmbryoName = aResultData.FabricEmbryoName;
|
||||
this.storeOutData.EmbryoCodeID = aResultData.EmbryoCodeID;
|
||||
this.storeOutData.EmbryoCodeNo = aResultData.EmbryoCodeNo;
|
||||
this.storeOutData.EmbryoCodeName = aResultData.EmbryoCodeName;
|
||||
this.storeOutData.WeaveMachineNo = aResultData.WeaveMachineNo;
|
||||
this.storeOutData.FabricBillNo = aResultData.FabricBillNo;
|
||||
this.storeOutData.Qty = aResultData.Qty;
|
||||
this.storeOutData.SumRoll = aResultData.SumRoll;
|
||||
this.storeOutData.SumQty = aResultData.SumQty;
|
||||
this.BillDataMessage = '扫描成功!';
|
||||
this.storeOutData.QRBarCode = '';
|
||||
this.GetStoreOutDataList();
|
||||
this.aPositionFocus0 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus0 = true;
|
||||
});
|
||||
} else {
|
||||
this.playError();
|
||||
this.BillDataMessage = '出仓出错,' + aResultData.BillDataMessage;
|
||||
this.storeOutData.QRBarCode = '';
|
||||
this.aPositionFocus0 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus0 = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this.playError();
|
||||
this.storeOutData.QRBarCode = '';
|
||||
this.BillDataMessage = '出仓出错,' + res.data.msg;
|
||||
this.aPositionFocus0 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus0 = true;
|
||||
});
|
||||
return;
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
this.playError();
|
||||
this.QRBarCode = '';
|
||||
this.aPositionFocus0 = false;
|
||||
this.$nextTick(() => {
|
||||
this.aPositionFocus0 = true;
|
||||
});
|
||||
this.BillDataMessage = '出仓出错,' + res.data.msg;
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '连接服务器出错,请检查后台服务是否启动!' + res.data.msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import 'index.scss';
|
||||
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.wrap .search {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.apply-text {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
|
||||
span {
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.user-images {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.apply-list-foot {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.personnel-list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.personnel-user {
|
||||
position: relative;
|
||||
margin: 5px 9px 0;
|
||||
}
|
||||
|
||||
.user-images {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin-right: 0;
|
||||
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: -5px;
|
||||
color: #FE0100;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-form ref="uForm">
|
||||
<u-form-item label="仓库名称" label-width="150" prop="StoreName">
|
||||
<u-input :border="border" type="select" :select-open="actionSheetShow" v-model="StoreName"
|
||||
placeholder="请选择仓库" @click="actionSheetShow = true"></u-input>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="ClearStoreNameData">清空</button>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<u-search shape="square" v-model="FabricEmbryoName" placeholder="胚布名称" actionText=""></u-search>
|
||||
<u-search shape="square" v-model="EmbryoCodeName" placeholder="胚布色号" actionText=""></u-search>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="GetFabricDetailData">查询</button>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">总件数:{{FabircSumRoll}}</text>
|
||||
<text class="title" style="width:200px;">总重量:{{FabricSumQty}}</text>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<view class="u-demo-area">
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<wyb-table ref="table" :headers="headersMaster" :contents="FabricDataList" @onCellClick="GetFabricDetailData" />
|
||||
<!-- <wyb-table ref="table" :headers="headersDetail" :contents="GoodsCrockNoDataList" height="600rpx" /> !-->
|
||||
</view>
|
||||
<u-action-sheet :list="StoreNameDataList" v-model="actionSheetShow" @click="actionSheetCallback"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import util, {parFabricGoodsBarCode2D} from '../../common/util';
|
||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||
export default {
|
||||
name: "btable",
|
||||
data() {
|
||||
return {
|
||||
borderColor: '#e4e7ed',
|
||||
align: 'center',
|
||||
index: 0,
|
||||
actionSheetShow: false,
|
||||
StoreName:'',
|
||||
FabricEmbryoName:'',
|
||||
EmbryoCodeName:'',
|
||||
FabircSumRoll:0,
|
||||
FabricSumQty:0,
|
||||
FabricDataList:[],
|
||||
StoreNameDataList: [],
|
||||
headersMaster: [{
|
||||
label: '单据日期',
|
||||
key: 'BillDate'
|
||||
}, {
|
||||
label: '单据类型',
|
||||
key: 'BillTypeName'
|
||||
}, {
|
||||
label: '往来单位',
|
||||
key: 'CustomerName'
|
||||
}, {
|
||||
label: '排产单号',
|
||||
key: 'ProductWeaveNo'
|
||||
},{
|
||||
label: '胚布编号',
|
||||
key: 'FabricEmbryoNo'
|
||||
}, {
|
||||
label: '胚布名称',
|
||||
key: 'FabricEmbryoName'
|
||||
}, {
|
||||
label: '色号',
|
||||
key: 'EmbryoCodeNo'
|
||||
}, {
|
||||
label: '颜色',
|
||||
key: 'EmbryoCodeName'
|
||||
}, {
|
||||
label: '机号',
|
||||
key: 'WaveMachineNo'
|
||||
}, {
|
||||
label: '针寸数',
|
||||
key: 'NeedleInch'
|
||||
}, {
|
||||
label: '条数',
|
||||
key: 'Roll'
|
||||
}, {
|
||||
label: '重量',
|
||||
key: 'Qty'
|
||||
}, {
|
||||
label: '备注',
|
||||
key: 'Remark'
|
||||
}],
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getStoreNameData();
|
||||
},
|
||||
methods: {
|
||||
upx2px(value) {
|
||||
//#ifndef MP-WEIXIN
|
||||
return uni.upx2px(value) + 'px'
|
||||
//#endif
|
||||
//#ifdef MP-WEIXIN
|
||||
return uni.upx2px(value)
|
||||
//#endif
|
||||
},
|
||||
rowClick(e) {
|
||||
console.log(e)
|
||||
},
|
||||
pullup(){
|
||||
console.log('上拉')
|
||||
},
|
||||
// 点击actionSheet回调
|
||||
actionSheetCallback(index) {
|
||||
uni.hideKeyboard();
|
||||
this.StoreName = this.StoreNameDataList[index].text;
|
||||
},
|
||||
|
||||
ClearStoreNameData() {
|
||||
this.StoreName = '';
|
||||
},
|
||||
|
||||
getStoreNameData() {
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.GetStoreNameList',
|
||||
params: [{
|
||||
name: 'TypeNo',
|
||||
value: '%StoreFabricEmbryo%'
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
var aResultData = res.data.data;
|
||||
this.StoreNameDataList = res.data.data;
|
||||
} else if (res.data.status == 0 && res.data.count <= 0) {
|
||||
this.StoreNameDataList = [];
|
||||
} else {
|
||||
this.StoreNameDataList = [];
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '连接服务器出错,请检查后台服务是否启动!' + res.data.msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
GetFabricDetailData: function() {
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP_GetStoreFabricAllInDetailSQL',
|
||||
params: [{
|
||||
name: 'SName',
|
||||
value: '%'+this.StoreName+'%'
|
||||
},{
|
||||
name: 'FGNo',
|
||||
value: '%'+this.FabricEmbryoName+'%'
|
||||
},{
|
||||
name: 'FGName',
|
||||
value: '%'+this.FabricEmbryoName+'%'
|
||||
},{
|
||||
name: 'GCNO',
|
||||
value: '%'+this.EmbryoCodeName+'%'
|
||||
},{
|
||||
name: 'GCName',
|
||||
value: '%'+this.EmbryoCodeName+'%'
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
this.FabricDataList = res.data.data;
|
||||
var aResultData = res.data.data;
|
||||
this.FabircSumRoll = 0;
|
||||
this.FabricSumQty = 0;
|
||||
for (var i = 0; i < aResultData.length; i++) {
|
||||
this.FabircSumRoll = this.FabircSumRoll + aResultData[i].Roll;
|
||||
this.FabricSumQty = this.FabricSumQty + aResultData[i].Qty;
|
||||
};
|
||||
this.FabircSumRoll = this.FabircSumRoll.toFixed(2) + '条';
|
||||
this.FabricSumQty = this.FabricSumQty.toFixed(2) + 'Kg';
|
||||
} else if (res.data.status == 0 && res.data.count <= 0) {
|
||||
this.FabricDataList = [];
|
||||
} else {
|
||||
this.FabricDataList = [];
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '连接服务器出错,请检查后台服务是否启动!' + res.data.msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.uni-progress {
|
||||
color: red;
|
||||
|
||||
::v-deep(.uni-progress-info) {
|
||||
font-size: 10px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-form ref="uForm">
|
||||
<u-form-item label="仓库名称" label-width="150" prop="StoreName">
|
||||
<u-input :border="border" type="select" :select-open="actionSheetShow" v-model="StoreName"
|
||||
placeholder="请选择仓库" @click="actionSheetShow = true"></u-input>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="ClearStoreNameData">清空</button>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<u-search shape="square" v-model="FabricEmbryoName" placeholder="胚布名称" actionText=""></u-search>
|
||||
<u-search shape="square" v-model="EmbryoCodeName" placeholder="胚布色号" actionText=""></u-search>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="GetFabricDetailData">查询</button>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">总件数:{{FabircSumRoll}}</text>
|
||||
<text class="title" style="width:200px;">总重量:{{FabricSumQty}}</text>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<view class="u-demo-area">
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<wyb-table ref="table" :headers="headersMaster" :contents="FabricDataList" @onCellClick="GetFabricDetailData" />
|
||||
<!-- <wyb-table ref="table" :headers="headersDetail" :contents="GoodsCrockNoDataList" height="600rpx" /> !-->
|
||||
</view>
|
||||
<u-action-sheet :list="StoreNameDataList" v-model="actionSheetShow" @click="actionSheetCallback"></u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import util, {parFabricGoodsBarCode2D} from '../../common/util';
|
||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||
export default {
|
||||
name: "btable",
|
||||
data() {
|
||||
return {
|
||||
borderColor: '#e4e7ed',
|
||||
align: 'center',
|
||||
index: 0,
|
||||
actionSheetShow: false,
|
||||
StoreName:'',
|
||||
FabricEmbryoName:'',
|
||||
EmbryoCodeName:'',
|
||||
FabircSumRoll:0,
|
||||
FabricSumQty:0,
|
||||
FabricDataList:[],
|
||||
StoreNameDataList: [],
|
||||
headersMaster: [{
|
||||
label: '单据日期',
|
||||
key: 'BillDate'
|
||||
}, {
|
||||
label: '单据类型',
|
||||
key: 'BillTypeName'
|
||||
}, {
|
||||
label: '往来单位',
|
||||
key: 'CustomerName'
|
||||
}, {
|
||||
label: '排产单号',
|
||||
key: 'ProductWeaveNo'
|
||||
},{
|
||||
label: '胚布编号',
|
||||
key: 'FabricEmbryoNo'
|
||||
}, {
|
||||
label: '胚布名称',
|
||||
key: 'FabricEmbryoName'
|
||||
}, {
|
||||
label: '色号',
|
||||
key: 'EmbryoCodeNo'
|
||||
}, {
|
||||
label: '颜色',
|
||||
key: 'EmbryoCodeName'
|
||||
}, {
|
||||
label: '机号',
|
||||
key: 'WaveMachineNo'
|
||||
}, {
|
||||
label: '针寸数',
|
||||
key: 'NeedleInch'
|
||||
}, {
|
||||
label: '条数',
|
||||
key: 'Roll'
|
||||
}, {
|
||||
label: '重量',
|
||||
key: 'Qty'
|
||||
}, {
|
||||
label: '备注',
|
||||
key: 'Remark'
|
||||
}],
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getStoreNameData();
|
||||
},
|
||||
methods: {
|
||||
upx2px(value) {
|
||||
//#ifndef MP-WEIXIN
|
||||
return uni.upx2px(value) + 'px'
|
||||
//#endif
|
||||
//#ifdef MP-WEIXIN
|
||||
return uni.upx2px(value)
|
||||
//#endif
|
||||
},
|
||||
rowClick(e) {
|
||||
console.log(e)
|
||||
},
|
||||
pullup(){
|
||||
console.log('上拉')
|
||||
},
|
||||
// 点击actionSheet回调
|
||||
actionSheetCallback(index) {
|
||||
uni.hideKeyboard();
|
||||
this.StoreName = this.StoreNameDataList[index].text;
|
||||
},
|
||||
|
||||
ClearStoreNameData() {
|
||||
this.StoreName = '';
|
||||
},
|
||||
|
||||
getStoreNameData() {
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.GetStoreNameList',
|
||||
params: [{
|
||||
name: 'TypeNo',
|
||||
value: '%StoreFabricEmbryo%'
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
var aResultData = res.data.data;
|
||||
this.StoreNameDataList = res.data.data;
|
||||
} else if (res.data.status == 0 && res.data.count <= 0) {
|
||||
this.StoreNameDataList = [];
|
||||
} else {
|
||||
this.StoreNameDataList = [];
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '连接服务器出错,请检查后台服务是否启动!' + res.data.msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
GetFabricDetailData: function() {
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP_GetStoreFabricAllOutDetailSQL',
|
||||
params: [{
|
||||
name: 'SName',
|
||||
value: '%'+this.StoreName+'%'
|
||||
},{
|
||||
name: 'FGNo',
|
||||
value: '%'+this.FabricEmbryoName+'%'
|
||||
},{
|
||||
name: 'FGName',
|
||||
value: '%'+this.FabricEmbryoName+'%'
|
||||
},{
|
||||
name: 'GCNO',
|
||||
value: '%'+this.EmbryoCodeName+'%'
|
||||
},{
|
||||
name: 'GCName',
|
||||
value: '%'+this.EmbryoCodeName+'%'
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
this.FabricDataList = res.data.data;
|
||||
var aResultData = res.data.data;
|
||||
this.FabircSumRoll = 0;
|
||||
this.FabricSumQty = 0;
|
||||
for (var i = 0; i < aResultData.length; i++) {
|
||||
this.FabircSumRoll = this.FabircSumRoll + aResultData[i].Roll;
|
||||
this.FabricSumQty = this.FabricSumQty + aResultData[i].Qty;
|
||||
};
|
||||
this.FabircSumRoll = this.FabircSumRoll.toFixed(2) + '条';
|
||||
this.FabricSumQty = this.FabricSumQty.toFixed(2) + 'Kg';
|
||||
} else if (res.data.status == 0 && res.data.count <= 0) {
|
||||
this.FabricDataList = [];
|
||||
} else {
|
||||
this.FabricDataList = [];
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '连接服务器出错,请检查后台服务是否启动!' + res.data.msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.uni-progress {
|
||||
color: red;
|
||||
|
||||
::v-deep(.uni-progress-info) {
|
||||
font-size: 10px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<view class="wrap">
|
||||
<u-form ref="uForm">
|
||||
<u-form-item label="仓库名称" label-width="150" prop="StoreName">
|
||||
<u-input type="select" :select-open="actionSheetShow" v-model="StoreName"
|
||||
placeholder="请选择仓库" @click="actionSheetShow = true"></u-input>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="ClearStoreNameData">清空</button>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
|
||||
<common-select type="radio":popupTitle="popupTitle" name="cworkStationName"
|
||||
:dataLists="FabricdataLists" placeholder="输入工站名称搜索" @cancel="show=false" @search="selectSearch"
|
||||
@submit=""> </common-select>
|
||||
|
||||
|
||||
<u-search shape="round" v-model="FabricGoodsName" placeholder="请输入布类" actionText=""></u-search>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<u-search shape="round" v-model="GoodsCodeName" placeholder="请输入颜色" actionText=""></u-search>
|
||||
<button class="mini-btn" type="primary" size="mini" @tap="GetDetailListData">查询</button>
|
||||
</u-form-item>
|
||||
<u-form-item>
|
||||
<text class="title" style="width:200px;">总条数:{{FabricSumRoll}}</text>
|
||||
<text class="title" style="width:200px;">总重量:{{FabricSumQty}}</text>
|
||||
</u-form-item>
|
||||
</u-form>
|
||||
<view class="u-demo-area">
|
||||
<u-toast ref="uToast"></u-toast>
|
||||
<wyb-table ref="table" :headers="headersMaster" :contents="FabricGoodsDataList"
|
||||
@onCellClick="GetDetailCrockNoListData" />
|
||||
</view>
|
||||
<u-action-sheet :list="StoreNameDataList" v-model="actionSheetShow" @click="actionSheetCallback">
|
||||
</u-action-sheet>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import util, {
|
||||
parFabricGoodsBarCode2D
|
||||
} from '../../common/util';
|
||||
import wybTable from '@/components/wyb-table/wyb-table.vue';
|
||||
//import {btable} from '@/components/qianziyu-select/qianziyu-select.vue';
|
||||
export default {
|
||||
name: "btable",
|
||||
data() {
|
||||
return {
|
||||
borderColor: '#e4e7ed',
|
||||
align: 'center',
|
||||
index: 0,
|
||||
actionSheetShow: false,
|
||||
StoreName: '',
|
||||
FabricGoodsName: '',
|
||||
GoodsCodeName: '',
|
||||
FabricSumRoll:0,
|
||||
FabricSumQty:0,
|
||||
FabricGoodsDataList: [],
|
||||
GoodsCrockNoDataList: [],
|
||||
FabricdataLists:[],
|
||||
StoreNameDataList: [],
|
||||
popupTitle: '',
|
||||
headersMaster: [{
|
||||
label: '编号',
|
||||
key: 'FabricGoodsNo'
|
||||
},{
|
||||
label: '名称',
|
||||
key: 'FabricGoodsName'
|
||||
}, {
|
||||
label: '色号',
|
||||
key: 'GoodsCodeNo'
|
||||
}, {
|
||||
label: '颜色',
|
||||
key: 'GoodsCodeName'
|
||||
}, {
|
||||
label: '条数',
|
||||
key: 'Roll'
|
||||
}, {
|
||||
label: '数量',
|
||||
key: 'Qty'
|
||||
}, {
|
||||
label: '单位',
|
||||
key: 'UnitName'
|
||||
}, {
|
||||
label: '仓库',
|
||||
key: 'StoreName'
|
||||
}],
|
||||
headersDetail: [{
|
||||
label: '名称',
|
||||
key: 'FabricGoodsName'
|
||||
}, {
|
||||
label: '色号',
|
||||
key: 'GoodsCodeNo'
|
||||
}, {
|
||||
label: '颜色',
|
||||
key: 'GoodsCodeName'
|
||||
}, {
|
||||
label: '缸号',
|
||||
key: 'CrockNo'
|
||||
}, {
|
||||
label: '条数',
|
||||
key: 'Roll'
|
||||
}, {
|
||||
label: '数量',
|
||||
key: 'Qty'
|
||||
}]
|
||||
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getStoreNameData();
|
||||
},
|
||||
methods: {
|
||||
upx2px(value) {
|
||||
//#ifndef MP-WEIXIN
|
||||
return uni.upx2px(value) + 'px'
|
||||
//#endif
|
||||
//#ifdef MP-WEIXIN
|
||||
return uni.upx2px(value)
|
||||
//#endif
|
||||
},
|
||||
rowClick(e) {
|
||||
console.log(e)
|
||||
},
|
||||
pullup() {
|
||||
console.log('上拉')
|
||||
},
|
||||
// 点击actionSheet回调
|
||||
actionSheetCallback(index) {
|
||||
uni.hideKeyboard();
|
||||
this.StoreName = this.StoreNameDataList[index].text;
|
||||
},
|
||||
|
||||
getStoreNameData() {
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.GetStoreNameList',
|
||||
params: [{
|
||||
name: 'TypeNo',
|
||||
value: '%StoreFabricEmbryo%'
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
var aResultData = res.data.data;
|
||||
this.StoreNameDataList = res.data.data;
|
||||
} else if (res.data.status == 0 && res.data.count <= 0) {
|
||||
this.StoreNameDataList = [];
|
||||
} else {
|
||||
this.StoreNameDataList = [];
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '连接服务器出错,请检查后台服务是否启动!' + res.data.msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
ClearStoreNameData() {
|
||||
this.StoreName = '';
|
||||
},
|
||||
|
||||
GetDetailListData: function() {
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP.GetStoreFabricMasterSQL',
|
||||
params: [{
|
||||
name: 'StoreName',
|
||||
value: '%' + this.StoreName + '%'
|
||||
}, {
|
||||
name: 'FGNo',
|
||||
value: '%' + this.FabricGoodsName + '%'
|
||||
}, {
|
||||
name: 'FGName',
|
||||
value: '%' + this.FabricGoodsName + '%'
|
||||
}, {
|
||||
name: 'GCNO',
|
||||
value: '%' + this.GoodsCodeName + '%'
|
||||
}, {
|
||||
name: 'GCName',
|
||||
value: '%' + this.GoodsCodeName + '%'
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
var aResultData = res.data.data;
|
||||
this.FabricGoodsDataList = res.data.data;
|
||||
var aResultData = res.data.data;
|
||||
this.FabricSumRoll = 0;
|
||||
this.FabricSumQty = 0;
|
||||
for (var i = 0; i < aResultData.length; i++) {
|
||||
this.FabricSumRoll = this.FabricSumRoll + aResultData[i].Roll;
|
||||
this.FabricSumQty = this.FabricSumQty + aResultData[i].Qty;
|
||||
};
|
||||
this.FabricSumRoll = this.FabricSumRoll.toFixed(2) + '条';
|
||||
this.FabricSumQty = this.FabricSumQty.toFixed(2) + 'Kg';
|
||||
} else if (res.data.status == 0 && res.data.count <= 0) {
|
||||
this.FabricGoodsDataList = [];
|
||||
} else {
|
||||
this.FabricGoodsDataList = [];
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '连接服务器出错,请检查后台服务是否启动!' + res.data.msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
},
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
GetDetailCrockNoListData: function(index) {
|
||||
console.log(this.FabricGoodsDataList[index].FabricGoodsName);
|
||||
uni.request({
|
||||
url: util.apiurl + 'rest/db/opensql',
|
||||
data: {
|
||||
token: getApp().globalData.Token,
|
||||
format: 'json',
|
||||
data: {
|
||||
db_name: getApp().globalData.AppDBName,
|
||||
sql_command_id: 'APP_GetStoreGoodsDetailCrockNoSQL',
|
||||
params: [{
|
||||
name: 'StoreName',
|
||||
value: this.StoreName
|
||||
}, {
|
||||
name: 'FGNo',
|
||||
value: this.FabricGoodsName
|
||||
}, {
|
||||
name: 'GCNO',
|
||||
value: this.GoodsCodeName
|
||||
}]
|
||||
},
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.status == 0 && res.data.count > 0) {
|
||||
var aResultData = res.data.data;
|
||||
this.GoodsCrockNoDataList = [];
|
||||
for (var i = 0; i < aResultData.length; i++) {
|
||||
this.GoodsCrockNoDataList.push(aResultData[i]);
|
||||
};
|
||||
} else if (res.data.status == 0 && res.data.count <= 0) {
|
||||
this.GoodsCrockNoDataList = [];
|
||||
} else {
|
||||
this.GoodsCrockNoDataList = [];
|
||||
}
|
||||
},
|
||||
fail: (error) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '连接服务器出错,请检查后台服务是否启动!' + res.data.msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 5000);
|
||||
},
|
||||
})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.uni-progress {
|
||||
color: red;
|
||||
|
||||
::v-deep( .uni-progress-info) {
|
||||
font-size: 10px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user