gqx 2 роки тому
батько
коміт
038767519d

+ 281 - 0
src/views/markets/agreementunit.vue

@@ -0,0 +1,281 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+          <a-col :span="3">
+            <a-form-item label="">
+              <j-input
+                placeholder="客户名称"
+                v-model="queryParam.name"
+              ></j-input>
+            </a-form-item>
+          </a-col>
+          <a-col :span="3">
+            <a-form-item label="">
+              <a-select
+                v-model="queryParam.customerType"
+                style="width: 100%"
+                placeholder="客户类型"
+                :allowClear="true"
+              >
+                <a-select-option
+                  :value="item.id"
+                  v-for="(item, index) in customerSourceList"
+                  :key="item.id"
+                >
+                  {{ item.itemText }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :span="3">
+            <a-form-model-item label="">
+              <a-select placeholder="状态" v-model="queryParam.status">
+                <a-select-option :value="1"> 正常 </a-select-option>
+                <a-select-option :value="2"> 停用 </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="6" :sm="8">
+            <span
+              style="float: left; overflow: hidden"
+              class="table-page-search-submitButtons"
+            >
+              <a-button type="primary" @click="searchQuery" icon="search"
+                >查询</a-button
+              >
+              <a-button
+                type="primary"
+                @click="searchReset"
+                icon="reload"
+                style="margin-left: 8px"
+                >重置</a-button
+              >
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px">
+        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
+        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a
+        >项
+        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
+      </div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{ x: true }"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{
+          selectedRowKeys: selectedRowKeys,
+          onChange: onSelectChange,
+        }"
+        class="j-table-force-nowrap"
+        @change="handleTableChange"
+      >
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text, record">
+          <span v-if="!text" style="font-size: 12px; font-style: italic"
+            >无图片</span
+          >
+          <img
+            v-else
+            :src="getImgView(text)"
+            :preview="record.id"
+            height="25px"
+            alt=""
+            style="max-width: 80px; font-size: 12px; font-style: italic"
+          />
+        </template>
+        <template slot="customerType" slot-scope="text">
+          {{ getText(text) }}
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm
+                  title="确定删除吗?"
+                  @confirm="() => handleDelete(record.id)"
+                >
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+      </a-table>
+    </div>
+
+    <bus-agreement-unit-modal
+      ref="modalForm"
+      @ok="modalFormOk"
+    ></bus-agreement-unit-modal>
+  </a-card>
+</template>
+
+<script>
+import "@/assets/less/TableExpand.less";
+import { mixinDevice } from "@/utils/mixin";
+import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+import BusAgreementUnitModal from "./modules/agreementunit/BusAgreementUnitModal";
+import { httpAction, getAction, postAction } from "@/api/manage";
+export default {
+  name: "BusAgreementUnitList",
+  mixins: [JeecgListMixin, mixinDevice],
+  components: {
+    BusAgreementUnitModal,
+  },
+  data() {
+    return {
+      description: "bus_agreement_unit管理页面",
+      // 表头
+      columns: [
+        {
+          title: "商家",
+          align: "center",
+          dataIndex: "hotelName",
+        },
+        {
+          title: "客户全称",
+          align: "center",
+          dataIndex: "name",
+        },
+        {
+          title: "手机号",
+          align: "center",
+          dataIndex: "mobile",
+        },
+        {
+          title: "主联系人",
+          align: "center",
+          dataIndex: "contactName",
+        },
+        {
+          title: "客户类型",
+          align: "center",
+          dataIndex: "customerType",
+          scopedSlots: { customRender: "customerType" },
+        },
+        {
+          title: "状态",
+          align: "center",
+          dataIndex: "status",
+          customRender: function (text) {
+            return text == 1 ? "正常" : "停用";
+          },
+        },
+        {
+          title: "操作",
+          dataIndex: "action",
+          align: "center",
+          fixed: "right",
+          width: 147,
+          scopedSlots: { customRender: "action" },
+        },
+      ],
+      url: {
+        list: "/business/busAgreementUnit/list",
+        delete: "/business/busAgreementUnit/delete",
+        deleteBatch: "/business/busAgreementUnit/deleteBatch",
+        exportXlsUrl: "/business/busAgreementUnit/exportXls",
+        importExcelUrl: "business/busAgreementUnit/importExcel",
+      },
+      dictOptions: {},
+      superFieldList: [],
+      customerSourceList: [],
+    };
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+
+    getAction("/business/busDictItem/list", {
+      hotelId: _info.id,
+      dictId: "1639538553774624769",
+    }).then((res) => {
+      if (res.success) {
+        this.customerSourceList = res.result.records;
+      }
+    });
+  },
+  computed: {
+    importExcelUrl: function () {
+      return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
+    },
+  },
+  methods: {
+    getText(text) {
+      var find = this.customerSourceList.find((t) => t.id == text);
+      return find ? find.itemText : "";
+    },
+    initDictConfig() {},
+    getSuperFieldList() {
+      let fieldList = [];
+      fieldList.push({ type: "string", value: "tenantId", text: "关联租户" });
+      fieldList.push({ type: "string", value: "hotelId", text: "关联酒店" });
+      fieldList.push({ type: "string", value: "name", text: "客户全称" });
+      fieldList.push({ type: "string", value: "mobile", text: "手机号" });
+      fieldList.push({
+        type: "string",
+        value: "systemType",
+        text: "系统类型字典id",
+      });
+      fieldList.push({
+        type: "string",
+        value: "contactName",
+        text: "主联系人",
+      });
+      fieldList.push({
+        type: "string",
+        value: "customerType",
+        text: "客户类型",
+      });
+      fieldList.push({ type: "string", value: "staffId", text: "销售员" });
+      fieldList.push({ type: "string", value: "address", text: "地址" });
+      fieldList.push({
+        type: "string",
+        value: "customerSource",
+        text: "客户来源",
+      });
+      fieldList.push({
+        type: "string",
+        value: "customerTrade",
+        text: "客户行业",
+      });
+      fieldList.push({ type: "int", value: "status", text: "状态" });
+      this.superFieldList = fieldList;
+    },
+  },
+};
+</script>
+<style scoped>
+@import "~@assets/less/common.less";
+</style>

+ 1 - 1
src/views/markets/marketInfo.vue

@@ -27,7 +27,7 @@
         />
         <p>营销短信</p>
       </div>
-      <div class="height-100" @click="toPage()">
+      <div class="height-100" @click="toPage('/tenant/marketinfo/agreementunit')">
         <img
           src="https://oss.qlan99.com/20200525/5a16520de701452d885cdcbfd2508e50.png"
         />

+ 316 - 0
src/views/markets/modules/agreementunit/BusAgreementUnitForm.vue

@@ -0,0 +1,316 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <a-form-model-item
+              label="客户全称"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="name"
+            >
+              <a-input
+                v-model="model.name"
+                placeholder="请输入客户全称"
+              ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="手机号"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="mobile"
+            >
+              <a-input
+                v-model="model.mobile"
+                placeholder="请输入手机号"
+              ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="系统类型"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="systemType"
+            >
+              <a-select
+                v-model="model.systemType"
+                style="width: 100%"
+                placeholder="客户类型"
+                :allowClear="true"
+              >
+                <a-select-option
+                  :value="item.id"
+                  v-for="(item, index) in systemTypeList"
+                  :key="item.id"
+                >
+                  {{ item.itemText }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="主联系人"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="contactName"
+            >
+              <a-input
+                v-model="model.contactName"
+                placeholder="请输入主联系人"
+              ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="客户类型"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="customerType"
+            >
+              <a-select
+                v-model="model.customerType"
+                style="width: 100%"
+                placeholder="客户类型"
+                :allowClear="true"
+              >
+                <a-select-option
+                  :value="item.id"
+                  v-for="(item, index) in customerSourceList"
+                  :key="item.id"
+                >
+                  {{ item.itemText }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="销售员"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="staffId"
+            >
+              <a-select placeholder="销售员工" v-model="model.staffId">
+                <a-select-option
+                  :value="item.id"
+                  v-for="item in warranterList"
+                  :key="item.id"
+                >
+                  {{ item.name }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="地址"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="address"
+            >
+              <a-input
+                v-model="model.address"
+                placeholder="请输入地址"
+              ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="客户来源"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="customerSource"
+            >
+              <a-select placeholder="订单来源" v-model="model.customerSource">
+                <a-select-option
+                  :value="item.id"
+                  v-for="(item, index) in customerSourceList2"
+                  :key="item.id"
+                >
+                  {{ item.itemText }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="客户行业"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="customerTrade"
+            >
+              <a-select
+                v-model="model.customerTrade"
+                style="width: 100%"
+                placeholder="客户类型"
+                :allowClear="true"
+              >
+                <a-select-option
+                  :value="item.id"
+                  v-for="(item, index) in customerTradeList"
+                  :key="item.id"
+                >
+                  {{ item.itemText }}
+                </a-select-option>
+              </a-select>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
+export default {
+  name: "BusAgreementUnitForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
+    },
+  },
+  data() {
+    return {
+      model: {},
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      validatorRules: {
+        name: [{ required: true, message: "请输入客户全称!" }],
+        mobile: [{ required: true, message: "请输入手机号!" }],
+        systemType: [{ required: true, message: "请输入系统类型字典id!" }],
+        contactName: [{ required: true, message: "请输入主联系人!" }],
+        customerSource: [{ required: true, message: "请输入客户来源!" }],
+        customerTrade: [{ required: true, message: "请输入客户行业!" }],
+        status: [{ required: true, message: "请输入状态!" }],
+      },
+      url: {
+        add: "/business/busAgreementUnit/add",
+        edit: "/business/busAgreementUnit/edit",
+        queryById: "/business/busAgreementUnit/queryById",
+      },
+      customerSourceList: [],
+      systemTypeList: [],
+      customerTradeList: [],
+      customerSourceList2: [],
+      warranterList: [],
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
+    },
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    getAction("/business/busDictItem/list", {
+      hotelId: _info.id,
+      dictId: "1639538553774624769",
+    }).then((res) => {
+      if (res.success) {
+        this.customerSourceList = res.result.records;
+      }
+    });
+    getAction("/business/busDictItem/list", {
+      hotelId: _info.id,
+      dictId: "1639538438666145794",
+    }).then((res) => {
+      if (res.success) {
+        this.systemTypeList = res.result.records;
+      }
+    });
+    getAction("/business/busDictItem/list", {
+      hotelId: _info.id,
+      dictId: "1639538788483682305",
+    }).then((res) => {
+      if (res.success) {
+        this.customerTradeList = res.result.records;
+      }
+    });
+    getAction("/business/busDictItem/list", {
+      hotelId: _info.id,
+      dictId: "1639538915239743490",
+    }).then((res) => {
+      if (res.success) {
+        this.customerSourceList2 = res.result.records;
+      }
+    });
+    getAction("/business/busSalesPerson/list", {
+      hotelId: _info.id,
+      pageNo: 1,
+      pageSize: 100,
+    }).then((res) => {
+      if (res.success) {
+        this.warranterList = res.result.records;
+      }
+    });
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+  },
+  methods: {
+    add() {
+      this.edit(this.modelDefault);
+    },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          that.confirmLoading = true;
+          let httpurl = "";
+          let method = "";
+          if (!this.model.id) {
+            httpurl += this.url.add;
+            method = "post";
+          } else {
+            httpurl += this.url.edit;
+            method = "put";
+          }
+          httpAction(httpurl, this.model, method)
+            .then((res) => {
+              if (res.success) {
+                that.$message.success(res.message);
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
+              }
+            })
+            .finally(() => {
+              that.confirmLoading = false;
+            });
+        }
+      });
+    },
+  },
+};
+</script>

+ 84 - 0
src/views/markets/modules/agreementunit/BusAgreementUnitModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <bus-agreement-unit-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></bus-agreement-unit-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import BusAgreementUnitForm from './BusAgreementUnitForm'
+
+  export default {
+    name: 'BusAgreementUnitModal',
+    components: {
+      BusAgreementUnitForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/markets/modules/agreementunit/BusAgreementUnitModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-agreement-unit-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-agreement-unit-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import BusAgreementUnitForm from './BusAgreementUnitForm'
+  export default {
+    name: 'BusAgreementUnitModal',
+    components: {
+      BusAgreementUnitForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>