From 818d4458d77505b25ea057b49b409b1868ea8cff Mon Sep 17 00:00:00 2001 From: wang-hao-jie <1550036656@qq.com> Date: 星期一, 06 六月 2022 15:34:11 +0800 Subject: [PATCH] 默认更改列表 --- src/views/your/suggest-manage/suggestManage.vue | 156 ++++++++++++++++++++++++++++++++-------------------- 1 files changed, 96 insertions(+), 60 deletions(-) diff --git a/src/views/your/suggest-manage/suggestManage.vue b/src/views/your/suggest-manage/suggestManage.vue index bc975a7..bfd88ca 100644 --- a/src/views/your/suggest-manage/suggestManage.vue +++ b/src/views/your/suggest-manage/suggestManage.vue @@ -7,16 +7,15 @@ <div class="search"> <Card> <Row class="operation"> - <Button @click="addOil" type="primary" icon="md-add">娣诲姞鍔犳补璁板綍</Button> <Button @click="init" icon="md-refresh">鍒锋柊</Button> <Button type="dashed" @click="openTip = !openTip">{{ openTip ? "鍏抽棴鎻愮ず" : "寮�鍚彁绀�" }}</Button> <Input - v-model="searchForm.carNo" + v-model="searchForm.content" suffix="ios-search" @on-change="getDataList" - placeholder="杈撳叆杞︾墝鍙锋悳绱�" + placeholder="杈撳叆鍙嶉鍐呭鎼滅储" clearable style="width: 250px" /> @@ -53,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> @@ -199,6 +164,9 @@ getCarList, editCar, deleteCar, + getSuggest, + deleteSuggest, + editSuggest, } from "@/api/open"; import util from "@/libs/util.js"; export default { @@ -219,6 +187,7 @@ modalType: 0, roleModalVisible: false, carModalVisible: false, + suggestVisible:false, permModalVisible: false, depModalVisible: false, modalTitle: "", @@ -233,6 +202,9 @@ addOilForm: { status : 0 }, + replyForm: { + status : 1 + }, removeForm: { status : 1 }, @@ -244,44 +216,64 @@ submitLoading: false, selectList: [], columns: [ - { - type: "selection", - width: 60, - align: "center", - }, + // { + // type: "selection", + // width: 60, + // align: "center", + // }, { type: "index", width: 60, align: "center", }, { - title: "鎰忚鍒嗙被", - key: "dictDataId", - width: 150, - }, - { title: "鍐呭", key: "content", - width: 200, + tooltip:true, + width: 230, }, { title: "鍙嶉鏃堕棿", key: "createTime", - width: 180, - sortable: true, + width: 130, + render: (h, params) => { + return h("div",params.row.createTime.substr(0,10)); + } }, { title: "鍙嶉鍟嗘埛", - key: "customerId", - width: 150, + key: "name", + tooltip:true, + width: 260, + }, + { + title: "鍥炲鍐呭", + key: "replyContent", + tooltip:true, + width: 300, }, { title: "鎿嶄綔", key: "action", align: "center", - width: 195, + width: 150, render: (h, params) => { return h("div", [ + h( + "a", + { + on: { + click: () => { + this.reply(params.row); + }, + }, + }, + "鍥炲" + ),h("Divider", { + props: { + type: "vertical", + }, + }), h( "a", { @@ -383,7 +375,7 @@ }, getDataList() { this.loading = true; - getAddOilList(this.searchForm).then((res) => { + getSuggest(this.searchForm).then((res) => { this.loading = false; if (res.success) { this.data = res.result.records; @@ -520,7 +512,7 @@ content: "鎮ㄧ‘璁よ鍒犻櫎鍚� ", loading: true, onOk: () => { - deleteAddOil({ ids: v.id }).then((res) => { + deleteSuggest({ ids: v.id }).then((res) => { this.$Modal.remove(); if (res.success) { this.clearSelectAll(); @@ -530,6 +522,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; @@ -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