Browse Source

yxy代码

yzx 6 months ago
parent
commit
cc7b0f5236

+ 8 - 1
app/admin/controller/borrow/BorrowApp.php

@@ -174,12 +174,19 @@ class BorrowApp extends Backend
             $data = $this->request->post()['data'];
             $this->BorrowTools->checkRules($data);
             $data = $this->BorrowTools->checkText($data);
-            if ($data['status'] == 1 || $data['status'] == 7 ) {
+
+            if ($data['status'] == 1  ) {
                 if(!isset($data['annotation'])){
                     $this->error("驳回时请填写批注!");
                 }
             }
 
+            if ( $data['status'] == 7 ) {
+                if(!isset($data['college_annotation'])){
+                    $this->error("驳回时请填写批注!");
+                }
+            }
+
             if (!(array_key_exists('status', $data) && $data['status'] !== null && $data['status'] !== '')) {
                 $this->error("请检查仪器状态");
             }

+ 5 - 0
app/admin/controller/borrow/BorrowApplication.php

@@ -175,6 +175,11 @@ class BorrowApplication extends Backend
             $data = $this->excludeFields($data);
             //获取用户类型
             $user_id = $this->auth->id;
+            if($user_id == $data['user_id']){
+                $data['annotation'] = '';
+                $data['college_annotation'] = '';
+            }
+
             $user_group_id = Db::name('admin_group_access')->where('uid', $user_id)->value("group_id");
             $open_id = Db::name('oauth_log')->where('user_id', $data['user_id'])->value('opid');
             if ($open_id !== null) {

+ 19 - 7
uniapp/pages/index/detail.vue

@@ -77,7 +77,7 @@
 						<block v-if="datailData.annotation!=null">
 
 							<uni-collapse-item
-								:title="'批注:&nbsp;&nbsp;&nbsp;'+ datailData.annotation.slice(0, 13)+'.....'"
+								:title="'实验室批注:&nbsp;&nbsp;&nbsp;'+ datailData.annotation.slice(0, 13)+'.....'"
 								v-if="datailData.annotation.length > 13">
 								<view class="content">
 									<text class="text">{{datailData.annotation}}{{'&nbsp;'}}</text>
@@ -85,11 +85,24 @@
 							</uni-collapse-item>
 							<block v-else>
 								<view class="">
-									<view class="detail_tou">批注:</view>{{datailData.annotation}}{{'&nbsp;'}}
+									<view class="detail_tou">实验室批注:</view>{{datailData.annotation}}{{'&nbsp;'}}
+								</view>
+							</block>
+						</block>
+						<block v-if="datailData.college_annotation!=null">
+							<uni-collapse-item
+								:title="'学院批注:&nbsp;&nbsp;&nbsp;'+ datailData.college_annotation.slice(0, 13)+'.....'"
+								v-if="datailData.college_annotation.length > 13">
+								<view class="content">
+									<text class="text">{{datailData.college_annotation}}{{'&nbsp;'}}</text>
+								</view>
+							</uni-collapse-item>
+							<block v-else>
+								<view class="">
+									<view class="detail_tou">学院批注:</view>{{datailData.college_annotation}}{{'&nbsp;'}}
 								</view>
 							</block>
 						</block>
-						
 						<view class="" v-if="datailData.status == 0">
 							<view class="detail_tou">电子签名:</view>
 							<view class="" style="float: left;">
@@ -454,7 +467,7 @@
 	let return_data2 = ref(null)
 	let damage_data = ref(null)
 	let replace_data = ref(null)
-	const status = ref(['待审批', '已驳回', '待使用', '使用中', '已归还', '已逾期', '领导审批中', '领导驳回'])
+	const status = ref(['待审批', '已驳回', '待使用', '使用中', '已归还', '已逾期', '学院审批', '领导驳回'])
 	const remark = ref(null)
 	var analyze = ref(null)
 	// var datailData = ref(null)
@@ -543,12 +556,11 @@
 	async function pass() {
 		if (userInfo.userInfo.group != 3 && datailData.value.purpose == 0) {
 			datailData.value.status = 6
+			datailData.value.annotation = remark.value
 		} else {
 			datailData.value.status = 2
+			datailData.value.college_annotation = remark.value
 		}
-
-		datailData.value.annotation = remark.value
-		console.log(datailData.value)
 		wx.showToast({
 			title: '审批完成',
 			icon: 'success',

+ 9 - 0
web/src/views/backend/borrow/borrowApplication/popupForm.vue

@@ -133,6 +133,15 @@
                         message="驳回时批注为必填项!"
                         :input-attr="{ maxlength: 200, clearable: true, 'show-password': true }"
                     />
+                    <FormItem
+                        :label="t('borrow.borrowapplication.college_annotation')"
+                        prop="college_annotation"
+                        type="textarea"
+                        v-model="baTable.form.items!.college_annotation"
+                        :required="baTable.form.items!.status == 1"
+                        message="驳回时批注为必填项!"
+                        :input-attr="{ maxlength: 200, clearable: true, 'show-password': true }"
+                    />
                     <el-form-item label="配件">
                         <div style="width: 100% ;">
                             <el-card class="box-card">

+ 23 - 0
web/src/views/backend/borrow/borrowApply/popupForm.vue

@@ -130,6 +130,29 @@
                         :placeholder="t('borrow.borrowapply.approval person')"
                         v-if="baTable.form.items!.status !== 0 && baTable.form.operate !== 'Add'"
                     />
+
+                    <FormItem
+                        :label="t('borrow.borrowapply.annotation')"
+                        v-model="baTable.form.items!.annotation"
+                        type="string"
+                        prop="annotation"
+                        :placeholder="t('borrow.borrowapply.annotation')"
+                        v-if="baTable.form.operate !== 'Add'"
+                        :input-attr="{
+                            disabledDate: expireTimeOption, readonly: true,
+                        }"
+                    />
+                    <FormItem
+                        label="学院批注"
+                        v-model="baTable.form.items!.college_annotation"
+                        type="string"
+                        prop="college_annotation"
+                        placeholder = "学院批注"
+                        v-if="baTable.form.operate !== 'Add'"
+                        :input-attr="{
+                            disabledDate: expireTimeOption, readonly: true,
+                        }"
+                    />
                    <el-input name="sign"  v-model="baTable.form.items!.sign" hidden="hidden" />
                    <el-form-item label="选择无人机配件" v-if="is_w">
                         <div style="width: 100% ;">