USER-20230908AJ\Administrator 1 год назад
Родитель
Сommit
07202cc67b

+ 44 - 4
page_task/task_details/module/record.vue

@@ -11,7 +11,7 @@
 				</view>
 				<view class="reply-box size-24">
 					<view class="reply-top size-24"></view>
-					<view class="reply-buttom size-24" @click="onSendChat">回复</view>
+					<view class="reply-buttom size-24" @click="onSendChat(msg.id)">回复</view>
 				</view>
 			</view>
 			<view class="row m-t20 ">
@@ -48,6 +48,11 @@
 					</view>
 				</view>
 			</view>
+      <view class="row m-t20 ">
+        <view class="empty-box"></view>
+        <view class="size-22 text-color-999">{{ msg.created_at }}</view>
+      </view>
+
 		</view>
     <en-blank v-if="msgList.length<=0"></en-blank>
 		<uni-popup background-color="#fff" ref="popup" type="bottom" borderRadius="10px 10px 0 0"
@@ -58,7 +63,7 @@
 					<text class="size-30 sys-weight-600">任务反馈</text>
 					<image class="wh-25" src="/static/img/task-details/close.png" mode="" @click="onClose"></image>
 				</view>
-				<SendChat is_button></SendChat>
+				<SendChat is_button @butClick="setMsg" v-model="msgData"></SendChat>
 			</view>
 		</uni-popup>
 	</view>
@@ -66,7 +71,7 @@
 
 <script>
 	import SendChat from "./send_chat.vue"
-  import {getMsgList} from "@/api/task";
+  import {getMsgList, setMsg} from "@/api/task";
   import EnImage from "@/components/en-utils/en-image/en-image.vue";
   import tools from "@/service/tools";
   import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
@@ -90,9 +95,43 @@
 		data() {
 			return {
         msgList: [],
+        replyId:'',
+        msgData: {
+          business_id: '',
+          msg: '',
+          reply_id: 0,
+          msg_img: [],
+          file_list: [],
+        },
+        isAjax:false
       }
 		},
 		methods: {
+      setMsg() {
+        console.log('------butClick--------------')
+        if (this.isAjax) {
+          return;
+        }
+        // this.isAjax=true;
+        this.msgData.business_id = this.businessId
+        if (this.replyId) {
+          this.msgData.reply_id = this.replyId;
+        }
+        setMsg(this.msgData).then((res) => {
+          if (res.code === 1) {
+            tools.success(res.msg)
+            this.msgData.reply_id=''
+            this.msgData.msg=''
+            this.msgData.msg_img=[]
+            this.getMsgList()
+            this.$refs.popup.close()
+          } else {
+            tools.error(res.msg)
+            this.isAjax = false;
+          }
+
+        })
+      },
       openFile(file) {
         if (!file.url) {
           tools.error('下载地址不存在')
@@ -136,7 +175,8 @@
 			moveHandle() {
 				return false
 			},
-			onSendChat() {
+			onSendChat(replyId) {
+        this.replyId=replyId
 				this.$refs.popup.open('bottom')
 			},
 			onClose() {

+ 6 - 1
page_task/task_details/module/send_chat.vue

@@ -37,7 +37,7 @@
 				</view>
 			</view>
 		</view>
-		<EnButton v-if="is_button"  @click.stop=""></EnButton>
+		<EnButton v-if="is_button"  @onSubmit="clickBut"></EnButton>
     <uni-popup ref="popup" type="bottom">
       <view class="popup-block">
         <view class="popup-row" @click="uploadingFile(1)">拍照</view>
@@ -60,6 +60,7 @@
 				type: Boolean,
 				default: false
 			}
+
 		},
 		data() {
 			return {
@@ -81,6 +82,10 @@
       }
     },
 		methods: {
+      clickBut(){
+        console.log('------butClick--------------')
+          this.$emit('butClick')
+      },
       delFile(fileIndex){
         this.msgData.file_list.splice(fileIndex, 1)
         this.fileNum=-1