wang-hao-jie
2022-06-06 818d4458d77505b25ea057b49b409b1868ea8cff
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: "",
@@ -234,6 +202,9 @@
        addOilForm: {
          status : 0
        },
        replyForm: {
          status : 1
        },
        removeForm: {
          status : 1
        },
@@ -245,43 +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: "title",
            width: 150,
          },
          {
            title: "内容",
            key: "content",
            width: 200,
            tooltip:true,
            width: 230,
          },
          {
            title: "反馈时间",
            key: "createTime",
            width: 240,
            sortable: true,
            width: 130,
            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 = "";