From e951b168f2f9ebc94c861ce868a73e13f21d3c53 Mon Sep 17 00:00:00 2001
From: zhangzeli <123456>
Date: 星期二, 18 一月 2022 09:55:48 +0800
Subject: [PATCH] bug
---
src/views/your/suggest-manage/suggestManage.vue | 132 ++++++++++++++++++++++++++++----------------
1 files changed, 84 insertions(+), 48 deletions(-)
diff --git a/src/views/your/suggest-manage/suggestManage.vue b/src/views/your/suggest-manage/suggestManage.vue
index 8994f67..8a6d149 100644
--- a/src/views/your/suggest-manage/suggestManage.vue
+++ b/src/views/your/suggest-manage/suggestManage.vue
@@ -52,49 +52,15 @@
</Card>
<!-- 缂栬緫 -->
- <Modal
- :title="modalTitle"
- v-model="roleModalVisible"
- :mask-closable="false"
- :width="500"
- >
- <Form
- ref="addOilForm"
- :model="addOilForm"
- :label-width="80"
- :rules="addOilFormValidate"
- >
- <FormItem label="杞﹁締" prop="carId">
- <Select v-model="addOilForm.carId" filterable>
- <Option v-for="item in carList" :value="item.id">{{ item.carNo }}</Option>
- </Select>
- </FormItem>
- <Form-item label="鍔犳补鏃ユ湡" prop="addDate">
- <Row>
- <Col span="11">
- <Date-picker @on-change="change1" type="date" value="yyyy-MM-dd" placeholder="閫夋嫨鏃ユ湡" v-model="addOilForm.addDate"></Date-picker>
- </Col>
- </Row>
- </Form-item>
- <FormItem label="鍔犳补閲�" prop="amount">
- <Input v-model="addOilForm.amount" type="number"/>
- </FormItem>
- <FormItem label="鍗曚环" prop="unitPrice">
- <Input v-model="addOilForm.unitPrice" type="number"/>
- </FormItem>
- <FormItem label="鍔犳补閲戦" prop="money">
- <Input v-model="addOilForm.money" type="number"/>
- </FormItem>
- <FormItem label="鍔犳补鏃堕噷绋�" prop="mileage">
- <Input v-model="addOilForm.mileage" type="number"/>
- </FormItem>
- <FormItem label="澶囨敞" prop="remarks">
- <Input v-model="addOilForm.remarks" />
+ <Modal :title="modalTitle" v-model="suggestVisible" :mask-closable="false" :width="500">
+ <Form ref="replyForm" :model="replyForm" :label-width="80" :rules="equipmentFormValidate">
+ <FormItem label="鍥炲鍐呭" prop="replyContent">
+ <Input v-model="replyForm.replyContent" type="textarea" :autosize="{minRows: 2,maxRows: 5}" placeholder="璇疯緭鍏ュ洖澶嶅唴瀹�..."></Input>
</FormItem>
</Form>
<div slot="footer">
<Button type="text" @click="carRole">鍙栨秷</Button>
- <Button type="primary" :loading="submitLoading" @click="submitAddOil"
+ <Button type="primary" :loading="submitLoading" @click="submitReplay"
>鎻愪氦</Button
>
</div>
@@ -200,6 +166,7 @@
deleteCar,
getSuggest,
deleteSuggest,
+ editSuggest,
} from "@/api/open";
import util from "@/libs/util.js";
export default {
@@ -220,6 +187,7 @@
modalType: 0,
roleModalVisible: false,
carModalVisible: false,
+ suggestVisible:false,
permModalVisible: false,
depModalVisible: false,
modalTitle: "",
@@ -233,6 +201,9 @@
},
addOilForm: {
status : 0
+ },
+ replyForm: {
+ status : 1
},
removeForm: {
status : 1
@@ -256,32 +227,53 @@
align: "center",
},
{
- title: "鎰忚鍒嗙被",
- key: "title",
- width: 150,
- },
- {
title: "鍐呭",
key: "content",
- width: 200,
+ tooltip:true,
+ width: 230,
},
{
title: "鍙嶉鏃堕棿",
key: "createTime",
- width: 240,
- sortable: true,
+ width: 110,
+ render: (h, params) => {
+ return h("div",params.row.createTime.substr(0,10));
+ }
},
{
title: "鍙嶉鍟嗘埛",
key: "name",
- width: 150,
+ tooltip:true,
+ width: 260,
+ },
+ {
+ title: "鍥炲鍐呭",
+ key: "replyContent",
+ tooltip:true,
+ width: 300,
},
{
title: "鎿嶄綔",
key: "action",
align: "center",
+ width: 150,
render: (h, params) => {
return h("div", [
+ h(
+ "a",
+ {
+ on: {
+ click: () => {
+ this.reply(params.row);
+ },
+ },
+ },
+ "鍥炲"
+ ),h("Divider", {
+ props: {
+ type: "vertical",
+ },
+ }),
h(
"a",
{
@@ -531,6 +523,21 @@
},
});
},
+ reply(v) {
+
+ this.modalType = 1;
+ this.modalTitle = "鍥炲";
+ // 杞崲null涓�""
+ for (let attr in v) {
+ if (v[attr] == null) {
+ v[attr] = "";
+ }
+ }
+ let str = JSON.stringify(v);
+ let roleInfo = JSON.parse(str);
+ this.replyForm = roleInfo;
+ this.suggestVisible = true;
+ },
setDefault(v) {
this.loading = true;
let params = {
@@ -648,6 +655,35 @@
}
});
},
+ submitReplay(v){
+ this.$refs.replyForm.validate((valid) => {
+ this.replyForm.status=1;
+ if (valid) {
+ if (this.modalType == 0) {
+ // 娣诲姞
+ this.submitLoading = true;
+ editSuggest(this.replyForm).then((res) => {
+ this.submitLoading = false;
+ if (res.success) {
+ this.$Message.success("鎿嶄綔鎴愬姛");
+ this.getDataList();
+ this.suggestVisible = false;
+ }
+ });
+ } else {
+ this.submitLoading = true;
+ editSuggest(this.replyForm).then((res) => {
+ this.submitLoading = false;
+ if (res.success) {
+ this.$Message.success("鎿嶄綔鎴愬姛");
+ this.getDataList();
+ this.suggestVisible = false;
+ }
+ });
+ }
+ }
+ });
+ },
submitPermEdit() {
this.submitPermLoading = true;
let permIds = "";
--
Gitblit v1.9.1