Przeglądaj źródła

调整关闭出差外出

wgl 4 lat temu
rodzic
commit
24c37c3baf

+ 11 - 0
src/projects/business/apis/Master/business_travel.js

@@ -61,3 +61,14 @@ export function verifyList(params) {
 		method: 'post',
 	})
 }
+
+//出差结束
+export function businessOutEnd(id) {
+	return request({
+		url: '/mobile/businessOutApiController/businessOutEnd',
+		data: Qs.stringify({
+			id: id
+		}),
+		method: 'post',
+	})
+}

+ 31 - 2
src/projects/business/views/Master/BusinessTravel/Info.vue

@@ -40,6 +40,10 @@
 					<label>申请时间</label>
 					<span v-text="detail.createTime"></span>
 				</div>
+				<div v-if="detail.endTime" class="mui-input-row">
+					<label>结束时间</label>
+					<span v-text="detail.endTime"></span>
+				</div>
 			</form>
 			<div class="vongi-slot">
 				<div v-for="(item,index) in detail.list" class="vongi-slot-block">
@@ -51,8 +55,8 @@
 				</div>
 			</div>
 		</div>
-		<div class="fyy-footer">
-			<div class="bindfyy-btn"><button type="submit" class="mui-btn mui-btn-danger">结束出差</button></div>
+		<div v-if="wm && !detail.endTime" class="fyy-footer">
+			<div class="bindfyy-btn"><button type="button" @click="closeActoin" class="mui-btn mui-btn-danger">结束出差</button></div>
 		</div>
 		<loading :visible="isLoading"></loading>
 	</div>
@@ -84,6 +88,9 @@
 				detail: {
 					list: [],
 				},
+
+				//微信模板消息过来的
+				wm: this.$route.query.wm,
 			}
 		},
 		created() {},
@@ -112,6 +119,28 @@
 				}
 				return 'color:' + color + ';border-color:' + color + ';';
 			},
+			//结束状态
+			closeActoin() {
+				var _this = this;
+				var btnArray = ['否', '是'];
+				mui.confirm('是否立即结束出差?', '确认', btnArray, function(e) {
+					if (e.index == 1) {
+						_this.outEnd();
+					}
+				})
+			},
+			//结束状态
+			outEnd() {
+				this.isLoading = true;
+				API_BusinessTravel.businessOutEnd(this.id).then(response => {
+					this.isLoading = false;
+
+					mui.toast('处理成功');
+				}).catch(error => {
+					this.isLoading = false;
+					mui.toast(error);
+				})
+			},
 			asynCallBack() {
 				//获取详情
 				this.getInfo();

+ 31 - 2
src/projects/business/views/Master/Egress/Info.vue

@@ -40,6 +40,10 @@
 					<label>申请时间</label>
 					<span v-text="detail.createTime"></span>
 				</div>
+				<div v-if="detail.endTime" class="mui-input-row">
+					<label>结束时间</label>
+					<span v-text="detail.endTime"></span>
+				</div>
 			</form>
 			<div class="mui-content-padded">
 				<h5>审核记录</h5>
@@ -61,8 +65,8 @@
 				</template>
 			</form>
 		</div>
-		<div class="fyy-footer">
-			<div class="bindfyy-btn"><button type="submit" class="mui-btn mui-btn-danger">结束外出</button></div>
+		<div v-if="wm && !detail.endTime" class="fyy-footer">
+			<div class="bindfyy-btn"><button type="button" @click="closeActoin" class="mui-btn mui-btn-danger">结束外出</button></div>
 		</div>
 		<loading :visible="isLoading"></loading>
 	</div>
@@ -94,6 +98,9 @@
 				detail: {
 					list: [],
 				},
+
+				//微信模板消息过来的
+				wm: this.$route.query.wm,
 			}
 		},
 		created() {},
@@ -122,6 +129,28 @@
 				}
 				return 'color:' + color + ';border-color:' + color + ';';
 			},
+			//结束状态
+			closeActoin() {
+				var _this = this;
+				var btnArray = ['否', '是'];
+				mui.confirm('是否立即结束出差?', '确认', btnArray, function(e) {
+					if (e.index == 1) {
+						_this.outEnd();
+					}
+				})
+			},
+			//结束状态
+			outEnd() {
+				this.isLoading = true;
+				API_BusinessTravel.businessOutEnd(this.id).then(response => {
+					this.isLoading = false;
+
+					mui.toast('处理成功');
+				}).catch(error => {
+					this.isLoading = false;
+					mui.toast(error);
+				})
+			},
 			asynCallBack() {
 				//获取详情
 				this.getInfo();