achao пре 3 година
родитељ
комит
2cb926a080
4 измењених фајлова са 55 додато и 43 уклоњено
  1. 1 1
      components/ossutil/uploadFile.js
  2. 1 1
      pages/order/index.vue
  3. 10 3
      pages/order/orderDetails.vue
  4. 43 38
      pages/order/signContract.vue

+ 1 - 1
components/ossutil/uploadFile.js

@@ -12,7 +12,7 @@ const Crypto = require('./crypto.js');
  *@param - successc:成功回调
  *@param - failc:失败回调
  */
-const uploadFile = function(type, filePath, dir, successc, failc) {debugger
+const uploadFile = function(type, filePath, dir, successc, failc) {
 	console.log('type', type)
 	if (!filePath || filePath.length < 9) {
 		uni.showModal({

+ 1 - 1
pages/order/index.vue

@@ -147,7 +147,7 @@
 						<view class="normal" @click.stop="stop(good)"
 							v-if="good.cargoOwnerStatus=='待还款'||good.cargoOwnerStatus=='已还款'">还款</view>
 
-						<view class="start normal" @click.stop="addevaluation(good)">评价</view>
+						<view class="start normal" @click.stop="addevaluation(good)"  v-if="good.cargoOwnerStatus=='已完结'">评价</view>
 					</view>
 				</view>
 			</view>

+ 10 - 3
pages/order/orderDetails.vue

@@ -24,7 +24,7 @@
 				</u-button>
 				<u-button class="btn" text="终止" @click="stop()" v-if="dataObj.cargoOwnerStatus=='未装车'">
 				</u-button>
-				<u-button class="btn" text="查看合同" @click="lookContract"></u-button>
+				<u-button class="btn" text="查看合同" @click="lookContract" v-if="dataObj.cargoOwnerContract=='1'"></u-button>
 				<u-button class="btn" text="签订合同" @click="signContract"
 					v-if="dataObj.cargoOwnerStatus=='待确认装车'&&dataObj.cargoOwnerContract!='1'">
 				</u-button>
@@ -34,7 +34,7 @@
 		<!-- 		<u-button class="btn" text="确认装车" @click="confirmLoading(3)"
 					v-if="dataObj.cargoOwnerStatus=='待确认装车'&&dataObj.cargoOwnerContract=='1'">
 				</u-button> -->
-				<u-button class="btn" text="确认装车" @click="confirmLoading(3)">
+				<u-button class="btn" text="确认装车" @click="confirmLoading(3)" v-if="dataObj.cargoOwnerStatus=='待确认装车'">
 				</u-button>
 				
 				<u-button class="btn" text="驳回卸车信息" @click="confirmUnLoading" v-if="dataObj.cargoOwnerStatus=='待收货'">
@@ -388,7 +388,7 @@
 			},
 			signContract() {
 				// this.lookAlert = true
-				uni.$u.route('/pages/order/signContract', this.dataObj);
+				uni.$u.route('/pages/order/signContract',{obj:JSON.stringify(this.dataObj)});
 
 			},
 			// 完结
@@ -432,6 +432,13 @@
 			},
 			confirmLoading(type) {
 				debugger
+				if(this.dataObj.cargoOwnerContract!='1'){
+					uni.showToast({
+						title:'请先签订合同',
+						icon:'none'
+					})
+					return
+				}
 				this.type = type
 				if (type == 3) {
 					this.alertTitle = '确认装车?'

+ 43 - 38
pages/order/signContract.vue

@@ -1,20 +1,20 @@
 <template>
 	<view class="content">
-		<view class="content1">
-			<view style='width:70px'>付款方式</view>
+		<!-- <view class="content1"> -->
+		<!-- 	<view style='width:70px'>付款方式</view>
 			<u-radio-group v-model="dataDetails.advanceFreightService" placement="row">
 				<u-radio :customStyle="radioCustomStyle" v-for="(item, index) in radiolist1" :key="index"
 					:label="item.name" :name="item.name" @change="radioChange">
 				</u-radio>
-			</u-radio-group>
-			<!-- 		<view class="left">
+			</u-radio-group> -->
+		<!-- 		<view class="left">
 				付款方式
 			</view>
 			<view class="right">
 				<view class="left-text">平台垫付运费</view>
 					<u-switch @change="change" v-model="value" inactiveColor='#ABB0BB' size="20" ></u-switch>
 			</view> -->
-		</view>
+		<!-- </view> -->
 		<view class="content2">
 			<view class="title">
 				合同摘要
@@ -117,8 +117,8 @@
 		onLoad(options) {
 			that = this
 			console.log(options)
-			this.dataDetails = options
-			this.dataDetails.advanceFreightService = '平台垫付运费'
+			this.dataDetails = JSON.parse(decodeURIComponent(options.obj))
+			// this.dataDetails.advanceFreightService = '平台垫付运费'
 			this.ctx = uni.createCanvasContext("handWriting");
 			this.$nextTick(() => {
 				uni.createSelectorQuery().select('.handCenter').boundingClientRect(rect => {
@@ -163,37 +163,42 @@
 									title: '加载中',
 									mask: true
 								})
-
-								that.$request.baseRequest('get', '/orderInfo/setPdf', that.dataDetails).then(res => {
-										if (res.code == 200) {
-											debugger
-											// that.contractSrc = res.data
-											// uni.downloadFile({
-											// 	url: res.data,
-											// 	success: function(res) {
-											// 		var filePath = res.tempFilePath;
-											// 		uni.openDocument({
-								   //  		filePath: filePath,
-											// 			showMenu: true,
-								   // 			success: function(res) {
-											// 				console.log('打开文档成功');
-											// 			}
-											// 		});
-											// 	}
-											// });
-											// this.$refs.uToast.show({
-											// 	type: 'success',
-											// 	message: "提交成功",
-											// 	complete() {
-											// 		that.upCallback({
-											// 			size: 10,
-											// 			num: 1
-											// 		})
-											// 	}
-											// })
-
-										}
-									})
+								let _obj = {}
+								_obj.id = that.dataDetails.id
+								_obj.typeFlag = 1
+								_obj.cargoOwnerAutograph = that.dataDetails.cargoOwnerAutograph
+								debugger
+								that.$request.baseRequest('get', '/orderInfo/setPdf', _obj).then(
+										res => {
+											if (res.code == 200) {
+												debugger
+												// that.contractSrc = res.data
+												// uni.downloadFile({
+												// 	url: res.data,
+												// 	success: function(res) {
+												// 		var filePath = res.tempFilePath;
+												// 		uni.openDocument({
+												//  		filePath: filePath,
+												// 			showMenu: true,
+												// 			success: function(res) {
+												// 				console.log('打开文档成功');
+												// 			}
+												// 		});
+												// 	}
+												// });
+												// this.$refs.uToast.show({
+												// 	type: 'success',
+												// 	message: "提交成功",
+												// 	complete() {
+												// 		that.upCallback({
+												// 			size: 10,
+												// 			num: 1
+												// 		})
+												// 	}
+												// })
+
+											}
+										})
 									.catch(res => {
 										uni.$u.toast(res.message);
 									});