chenrui 2 роки тому
батько
коміт
0815bd1610

+ 1 - 1
config/index.js

@@ -6,7 +6,7 @@ const getConfig = (theme) => {
 			themePath: 'default',
 			pro_URL: 'https://iscm.360arrow.com/qpls-md/', // 生产地址
 			uat_URL: 'http://p.iscm.360arrow.com/qpls-md/', // 预发布地址
-			dev_URL: 'http://192.168.0.215:8503/qpls-md/', // 本地地址
+			dev_URL: 'http://192.168.0.103:8503/qpls-md/', // 本地地址
 			appName: 'iSCM智慧供应链', // app 名称
 			company: '陕西山海高科信息技术有限公司',
 			loadText:{

+ 9 - 0
libs/getDate.js

@@ -236,5 +236,14 @@ export default {
 	  		'YYYY年MM月')
 	  	return date
 	  },
+	  editDay(start,end){
+		  const obj = {
+		    starttime: '',
+		    endtime: ''
+		  }
+		  obj.starttime = moment(start).format('YYYY年MM月DD日')
+		  obj.endtime =moment(end).format('YYYY年MM月DD日')
+		  return obj 
+	  }
 	}
 	

+ 8 - 1
manifest.json

@@ -54,7 +54,8 @@
         },
         /* 模块配置 */
         "modules" : {
-            "Bluetooth" : {}
+            "Bluetooth" : {},
+            "Share" : {}
         },
         /* 应用发布信息 */
         "distribute" : {
@@ -113,6 +114,12 @@
                     "system" : {
                         "__platform__" : [ "ios", "android" ]
                     }
+                },
+                "share" : {
+                    "weixin" : {
+                        "appid" : "",
+                        "UniversalLinks" : ""
+                    }
                 }
             },
             "icons" : {

+ 89 - 21
pages/sales/bill.vue

@@ -7,7 +7,7 @@
 					<text>客户名称</text>
 				</view>
 				<view class="list_r u-flex">
-					<u-input v-model="customerObj.customerName" @click="jumpPage('/pages/sales/chooseCustomerBill')" disabled placeholder="请选择客户名称" />
+					<u-input v-model="customerObj.customerName" @click="goChooseCustomer" disabled placeholder="请选择客户名称" />
 					<u-icon name="arrow-right" color="#999" size="30"></u-icon>
 				</view>
 			</view>
@@ -33,7 +33,7 @@
 				<text>¥{{totalPayPrice}}</text>
 			</view>
 		</view>
-		<view class="chooseCon"><billList ref="bill" :showCheck="true" :list="bill"></billList></view>
+		<view class="chooseCon"><billList ref="bill" :showCheck="true" :list="bill"  @allChecked="allCheckedCallback"></billList></view>
 		<view class="footer u-flex">
 			<view class="f-left">
 				<u-checkbox @change="allCheckeChange" v-model="allChecked" shape="circle">{{ allChecked ? '取消全选' : '全选' }}</u-checkbox>
@@ -43,11 +43,11 @@
 					待收:
 					<text>¥{{chooseTotalPayPrice}}</text>
 				</view>
-				<view>
+				<view v-if="chooseList.length>0">
 					折后:
 					<text>¥{{settlement}}</text>
 				</view>
-				<view class="u-flex">
+				<view class="u-flex" v-if="chooseList.length>0">
 					<view>
 						折让:
 						<text>¥{{discountVal || 0}}</text>
@@ -85,13 +85,13 @@
 				<view class="costPopupCon">
 					<view class="costList">
 						<text class="label">待收金额:</text>
-						<text>¥{{totalPayPrice}}</text>
+						<text>¥{{chooseTotalPayPrice}}</text>
 					</view>
 					<view class="costList u-flex">
 						<view class="label">折让金额:</view>
 						<u-input v-model="discountVal" @input="onKeyInput" :border="true" :height="50"/>
 					</view>
-					<view class="tip" v-if="discountVal>totalPayPrice">折让金额不能大于待收金额,请重新输入</view>
+					<view class="tip" v-if="discountVal>chooseTotalPayPrice">折让金额不能大于待收金额,请重新输入</view>
 					<view class="costText">折让后金额</view>
 					<view class="costText">¥{{settlement}}</view>
 				</view>
@@ -175,12 +175,13 @@ export default {
 			cycleName: '',
 			
 			params: {
-				targetSn: '437705264826884096',
+				targetSn: undefined,
 				bizBeginDate: undefined,
 				bizEndDate: undefined
 			},
 			bill: [],
-			dateArray:''
+			dateArray:'',
+			chooseList:[]
 		};
 	},
 	onReady() {
@@ -191,16 +192,20 @@ export default {
 	},
 	onLoad(options) {
 		//获取对账周期默认值
-		let systemList = this.$store.state.vuex_systemSetList;
-		let cycleObj = systemList.find(item => {
-			return item.remarks == 'sales_bill_period';
-		});
-		this.curTab = this.placeTab.findIndex(con => con.name == cycleObj.valueShow);
+		if(uni.getStorageSync('curTab')){
+			this.curTab = uni.getStorageSync('curTab');
+		}else{
+			let systemList = this.$store.state.vuex_systemSetList;
+			let cycleObj = systemList.find(item => {
+				return item.remarks == 'sales_bill_period';
+			});
+			this.curTab = this.placeTab.findIndex(con => con.name == cycleObj.valueShow);
+		}
 		this.cycleName = this.changeShowTime();
 		// 获取选择客户
 		if (options && options.data) {
 			this.customerObj = JSON.parse(options.data);
-			// this.params.targetSn = this.customerObj.customerSn;
+			this.params.targetSn = this.customerObj.customerSn;
 		}
 		this.changeTime();
 	},
@@ -212,7 +217,8 @@ export default {
 	onBackPress() {
 		if (this.showSearch) {
 			this.showSearch = false;
-			return true;
+		}else{
+			uni.removeStorageSync('curTab')
 		}
 	},
 	computed: {
@@ -222,13 +228,26 @@ export default {
 				this.bill[i].unsettleAmount = this.bill[i].unsettleAmount ? this.bill[i].unsettleAmount :0
 				totalPrice += this.bill[i].unsettleAmount;
 			}
-			return totalPrice || 0;
+			return totalPrice;
+		},
+		chooseTotalPayPrice(){
+			let price=0;
+			this.chooseList.forEach(item=>{
+				item.unsettleAmount =item.unsettleAmount? item.unsettleAmount:0;
+				price += item.unsettleAmount;
+			})
+			return price;
 		},
-		// settlement(){
-		// 	return this.totalPayPrice - this.discountVal || 0;
-		// }
+		settlement(){
+			return this.chooseTotalPayPrice - this.discountVal || 0;
+		}
 	},
 	methods: {
+		//选择客户
+		goChooseCustomer(){
+			uni.setStorageSync('curTab',this.curTab);
+			this.jumpPage('/pages/sales/chooseCustomerBill');
+		},
 		changeTime() {
 			if (this.curTab != 6 && this.curTab != 7) {
 				this.params.bizBeginDate = this.getQueryDate().beginDate;
@@ -287,11 +306,60 @@ export default {
 			this.costShow = false
 		},
 		submitOrder(){//发送对账单
-			
+			if(this.chooseList.length==0){
+				uni.showToast({
+					title:'请选择要发送的对账单',
+					icon:'none'
+				})
+				return;
+			}
+			let obj={
+				detailNum:this.chooseList.length,
+				totalAmount:this.chooseTotalPayPrice,
+				discountAmount:this.discountVal,
+				settleAmount:this.settlement,
+				detailList:this.chooseList
+			}
+			let ajaxData=Object.assign(this.params,obj)
+			insert(ajaxData).then(res => {
+				if (res.status == 200) {
+					this.goShare();
+				}
+			});
 		},
-		allCheckeChange(){
+		allCheckeChange(e){
 			this.$refs.bill.allSelect(e.value)
 			const list = this.$refs.bill.getAllData()
+		},
+		// 选中事件
+		allCheckedCallback(isAllChecked,row){
+			const has = this.chooseList.findIndex(k => k.bizSn == row.bizSn)
+			// 在已选列表中
+			if(has>=0){
+				// 取消选中
+				if(!row.checked){
+					this.chooseList.splice(has,1)
+				}
+			}else{
+				if(row.checked){
+					this.chooseList.push(row)
+				}
+			}
+			// 是否全选
+			this.allChecked = isAllChecked
+		},
+		// 分享图文
+		goShare(){
+			uni.shareWithSystem({
+			  summary: '',
+			  href: '',
+			  success(){
+			    // 分享完成,请注意此时不一定是成功分享
+			  },
+			  fail(){
+			    // 分享失败
+			  }
+			})
 		}
 	}
 };

+ 5 - 5
pages/sales/billHistory.vue

@@ -7,12 +7,12 @@
 		<view class="p-content" v-if="billList && billList.length>0">
 			<view class="list" @click="jumpPage('/pages/sales/billHistoryDetail?billId='+item.verifySn)" v-for="(item,i) in billList" :key="i">
 				<view class="list_t u-flex u-row-between">
-					<view class="u-line-1">{{item.curCustomerName}}</view>
-					<view>¥526.88</view>
+					<view class="u-line-1">{{item.customer.customerName}}</view>
+					<view>¥{{item.settleAmount}}</view>
 				</view>
-				<view class="list_b u-flex u-row-between">
-					<view>2022-11-29 14:32:32</view>
-					<view class="u-flex">
+				<view class="list_b u-flex u-row-between" >
+					<view>{{item.createDate}}</view>
+					<view class="u-flex" v-if="item.billStatus != 'UNSETTLE'">
 						<view>已付款</view>
 						<u-icon name="yifukuan" custom-prefix="iscm-icon" size="40" :color="wordColor"></u-icon>
 					</view>

+ 40 - 19
pages/sales/billHistoryDetail.vue

@@ -3,45 +3,45 @@
 		<view class="b_head">
 			<view class="head_list">
 				<text>分享时间</text>
-				<text>2022-11-29 10:02:54</text>
+				<text>{{billInfo.createDate}}</text>
 			</view>
-			<view class="head_list">
+			<view class="head_list" v-if="billList.customer">
 				<text>客户名称</text>
-				<text>东莞市寮步车正汽车服务中心</text>
+				<text>{{billInfo.customer.customerName}}</text>
 			</view>
 			<view class="head_list">
 				<text>对账周期</text>
-				<text>2022年11月29日~2022年12月31日</text>
+				<text>{{timeInfo || '--'}}</text>
 			</view>
 			<view class="head_list">
 				<text>付款状态</text>
-				<text>已付款(支付宝)</text>
+				<text>{{billInfo.billStatus != 'UNSETTLE'?'未付款':billInfo.settleStyleSnDictValue ? '已付款('+billInfo.settleStyleSnDictValue+')':'已付款'}}</text>
 			</view>
 		</view>
 		<view class="b_detail">
 			<view class="detail_list u-flex">
 				<view class="detail_box">
 					<text>总单数:</text>
-					<text>34</text>
+					<text>{{billInfo.detailNum}}</text>
 				</view>
 				<view class="detail_box">
 					<text>待收金额合计:</text>
-					<text>34.00</text>
+					<text>{{billInfo.totalAmount}}</text>
 				</view>
 			</view>
 			<view class="detail_list u-flex">
 				<view class="detail_box">
 					<text>折让金额:</text>
-					<text>34</text>
+					<text>{{billInfo.discountAmount}}</text>
 				</view>
 				<view class="detail_box">
-					<text>折让待收金额:</text>
-					<text>34.00</text>
+					<text>折让待收金额:</text>
+					<text>{{billInfo.settleAmount}}</text>
 				</view>
 			</view>
 		</view>
 		<view class="detail_con">
-			<billList></billList>
+			<billList :list="billList"></billList>
 		</view>
 		<view class="footer">
 			<u-button type="primary" :custom-style="customStyle" shape="circle">再次发送对账单</u-button>
@@ -51,7 +51,8 @@
 
 <script>
 import billList from './billListComponent.vue'
-import { findBySn,insert } from '@/api/verify.js';
+import { findBySn,insert} from '@/api/verify.js';
+import getDate from '@/libs/getDate.js';
 export default {
 	components: { billList },
 	data() {
@@ -60,8 +61,9 @@ export default {
 				backgroundColor: this.$config('primaryColor'),
 				color: '#fff',
 				verifySn:'',
-				billInfo:{},
-				billList:[]
+				billInfo:null,
+				billList:[],
+				timeInfo:''
 			},
 		};
 	},
@@ -74,18 +76,37 @@ export default {
 	onLoad(options) {
 		if(options && options.billId){
 			this.verifySn=options.billId
-			this.loadData()
+			this.loadData({verifySn:options.billId})
 		}
 	},
 	methods:{
-		loadData(){
-			queryPage({verifySn:this.verifySn}).then(res => {
+		loadData(ajaxData){
+			findBySn(ajaxData).then(res => {
 				if (res.status == 200) {
 					this.billInfo=res.data;
-					this.billList=res.data.list;
+					this.billList=res.data.detailList;
+					let timeobj=getDate.editDay(res.data.bizBeginDate,res.data.bizEndDate);
+					this.timeInfo= timeobj.starttime +'~'+timeobj.endtime
 				}
 			});
-		}
+		},
+		submitOrder(){//发送对账单
+			let ajaxData={
+				detailNum:this.billInfo.detailNum,
+				totalAmount:this.billInfo.totalAmount,
+				discountAmount:this.billInfo.discountAmount,
+				settleAmount:this.billInfo.settleAmount,
+				detailList:this.billList,
+				targetSn: this.billInfo.customer.customerSn,
+				bizBeginDate: this.billInfo.bizBeginDate,
+				bizEndDate: this.billInfo.bizEndDate
+			}
+			insert(ajaxData).then(res => {
+				if (res.status == 200) {
+					//去分享
+				}
+			});
+		},
 	}
 };
 </script>

+ 1 - 6
pages/sales/billListComponent.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="bill-list-component">
 		<view class="chooseList u-flex" v-for="(item,index) in listData" :key="item.bizSn">
-			<view class="checkbox" v-show="showCheck"><u-checkbox v-model="item.checked" name="item.bizSn" @change.stop="checkChange" size="40" shape="circle"></u-checkbox></view>
+			<view class="checkbox" v-show="showCheck"><u-checkbox v-model="item.checked" :name="item.bizSn" @change="checkChange" size="40" shape="circle"></u-checkbox></view>
 			<view class="choose_r" @click="jumpPage('/pages/sales/salesDetail?salesBillId='+item.bizSn)" >
 				<view class="u-flex u-row-between">
 					<view class="billInfo u-flex">
@@ -61,11 +61,6 @@ export default {
 			const isAllNoChecked = this.listData.filter(item => !item.checked)
 			this.$emit('allChecked',isAllNoChecked.length == 0,row)
 		},
-		setChecked(id,val){
-			const row = this.partList.find(item => item.id == id)
-			row.checked = val
-			this.partList.splice()
-		},
 		// 获取所有数据
 		getAllData(){
 			return this.listData

+ 12 - 16
pages/sales/orderInfoModal.vue

@@ -26,7 +26,7 @@
 					<text class="info-item-txt">{{infoData && infoData.settleStyleSnDictValue || '--'}}</text>
 				</view>
 				<view>
-					<text class="info-item-tit">制单人:</text>
+					<text class="info-item-tit">{{infoFlag? '开单人':'制单人'}}:</text>
 					<text class="info-item-txt">{{infoData && infoData.operatorName || '--'}}</text>
 				</view>
 				<view>
@@ -34,7 +34,7 @@
 					<text class="info-item-txt">{{infoData && infoData.salesManName || '--'}}</text>
 				</view>
 				<view>
-					<text class="info-item-tit">来源:</text>
+					<text class="info-item-tit">{{infoFlag? '单据来源':'来源'}}:</text>
 					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
 				</view>
 				<view>
@@ -49,43 +49,35 @@
 					<text class="info-item-tit">备注:</text>
 					<text class="info-item-txt">{{infoData && infoData.remarks || '--'}}</text>
 				</view>
-				
-				
-				<view>
-					<text class="info-item-tit">单据来源:</text>
-					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
-				</view>
+				<view v-if="infoFlag">
 				<view>
 					<text class="info-item-tit">创建时间:</text>
 					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
 				</view>
 				<view>
 					<text class="info-item-tit">审核时间:</text>
-					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+					<text class="info-item-txt">{{infoData && infoData.auditDate || '--'}}</text>
 				</view>
 				<view>
 					<text class="info-item-tit">联系人:</text>
-					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+					<text class="info-item-txt">{{infoData && infoData.consigneeName || '--'}}</text>
 				</view>
 				<view>
 					<text class="info-item-tit">联系手机:</text>
-					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+					<text class="info-item-txt">{{infoData && infoData.consigneeMobile || '--'}}</text>
 				</view>
 				<view>
 					<text class="info-item-tit">价格类型:</text>
-					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+					<text class="info-item-txt">{{infoData && infoData.priceType || '--'}}</text>
 				</view>
 				<view>
 					<text class="info-item-tit">配送方式:</text>
-					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
+					<text class="info-item-txt">{{infoData && infoData.dispatchType || '--'}}</text>
 				</view>
 				<view>
 					<text class="info-item-tit">铺货出库:</text>
 					<text class="info-item-txt">{{infoData && infoData.sourceTypeDictValue || '--'}}</text>
 				</view>
-				<view>
-					<text class="info-item-tit">开单人:</text>
-					<text class="info-item-txt">{{infoData && infoData.operatorName || '--'}}</text>
 				</view>
 			</view>
 			<view class="order-info-footer">
@@ -107,6 +99,10 @@
 				default: ()=>{
 					return null
 				}
+			},
+			infoFlag:{
+				type: Boolean,
+				default: false
 			}
 		},
 		data() {

+ 1 - 1
pages/sales/salesDetail.vue

@@ -104,7 +104,7 @@
 			</view>
 		</view>
 		<!-- 基础信息 -->
-		<orderInfoModal :openModal="infoModal" :infoData="detailData" @close="infoModal=false" />
+		<orderInfoModal :infoFlag="true" :openModal="infoModal" :infoData="detailData" @close="infoModal=false" />
 	</view>
 </template>