xuhaifeng 8 maanden geleden
bovenliggende
commit
4b8407304c

+ 1 - 1
.env.development

@@ -6,7 +6,7 @@ ENV = 'development'
 
 # 一七生活管理系统/开发环境
 VUE_APP_BASE_API_HOST = 'http://localhost:9801'
-VUE_APP_BASE_API = '/'
+VUE_APP_BASE_API = 'http://localhost:9801'
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 1 - 1
.env.staging

@@ -8,6 +8,6 @@ ENV = 'staging'
 
 # 一七生活管理系统/测试环境
 VUE_APP_BASE_API_HOST = 'http://localhost:9801'
-VUE_APP_BASE_API = '/stage-api'
+VUE_APP_BASE_API = 'http://localhost:9801'
 
 port=9900

+ 8 - 0
.prettierrc

@@ -0,0 +1,8 @@
+{
+  "useTabs": false,
+  "tabWidth": 4,
+  "printWidth": 320,
+  "singleQuote": true,
+  "trailingComma": "none",
+  "semi": false
+}

+ 2 - 2
src/settings.js

@@ -2,7 +2,7 @@ module.exports = {
   /**
    * 侧边栏主题 深色主题theme-dark,浅色主题theme-light
    */
-  sideTheme: 'theme-light',
+  sideTheme: 'theme-dark',
 
   /**
    * 是否系统布局配置
@@ -12,7 +12,7 @@ module.exports = {
   /**
    * 是否显示顶部导航
    */
-  topNav: true,
+  topNav: false,
 
   /**
    * 是否显示 tagsView

+ 340 - 391
src/views/app/banner/index.vue

@@ -1,406 +1,355 @@
 <template>
-  <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-<!--      <el-form-item label="轮播图类型" prop="bannerType" label-width="120px">-->
-<!--        <el-select v-model="queryParams.bannerType" placeholder="轮播图类型" clearable>-->
-<!--          <el-option-->
-<!--            v-for="dict in dict.type.app_banner_type"-->
-<!--            :key="dict.value"-->
-<!--            :label="dict.label"-->
-<!--            :value="dict.value"-->
-<!--          />-->
-<!--        </el-select>-->
-<!--      </el-form-item>-->
-<!--      <el-form-item label="点击类型" prop="clickType">-->
-<!--        <el-select v-model="queryParams.clickType" placeholder="点击类型" clearable>-->
-<!--          <el-option-->
-<!--            v-for="dict in dict.type.app_banner_click_type"-->
-<!--            :key="dict.value"-->
-<!--            :label="dict.label"-->
-<!--            :value="dict.value"-->
-<!--          />-->
-<!--        </el-select>-->
-<!--      </el-form-item>-->
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="状态" clearable>
-          <el-option
-            v-for="dict in dict.type.sys_normal_disable"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search"   @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh"   @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-           
-          @click="handleAdd"
-          v-hasPermi="[bannerType==0?'app:banner:add':'app:launchAdver:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-           
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="[bannerType == 0?'app:banner:edit':'app:launchAdver:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-           
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="[bannerType == 0?'app:banner:remove':'app:launchAdver:remove']"
-        >删除</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-table v-loading="loading" :data="bannerList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="ID" align="center" prop="id" />
-      <el-table-column label="图片" align="center" prop="imgUrl"  width="250">
-        <template slot-scope="scope">
-          <el-image
-            style="width: 150px; height: 150px"
-            :src="scope.row.imgUrl"
-            :preview-src-list="[scope.row.imgUrl]">
-          </el-image>
-        </template>
-      </el-table-column>
-      <el-table-column label="图片类型" align="center" prop="bannerType" >
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.app_banner_type" :value="scope.row.bannerType"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="点击类型" align="center" prop="clickType" >
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.app_banner_click_type" :value="scope.row.clickType"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="启用状态" align="center" prop="status" >
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="创建人" align="center" prop="createBy" />
-      <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
-      <el-table-column label="修改人" align="center" prop="updateBy"/>
-      <el-table-column label="修改时间" align="center" prop="createTime" width="180" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-             
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="[bannerType == 0?'app:banner:edit':'app:launchAdver:edit']"
-          >修改</el-button>
-          <el-button
-             
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="[bannerType == 0?'app:banner:remove':'app:launchAdver:remove']"
-          >删除</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-
-    <!-- 添加或修改轮播图对话框 -->
-    <el-dialog :title="title" :visible.sync="open" size="30%" append-to-body  >
-      <el-row :gutter="15" >
-        <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-          <el-col :span="24">
-            <el-form-item label="上传" prop="imgUrl">
-              <el-upload
-                class="image-uploader"
-                :action="uploadAction"
-                :before-upload="handleBeforeUpload"
-                :on-success="handleUploadSuccess"
-                :on-error="handleUploadError"
-                accept="image/*"
-                :show-file-list="false"
-              >
-                <img v-if="form.imgUrl" :src="form.imgUrl">
-                <i v-else class="el-icon-plus image-uploader-icon"></i>
-              </el-upload>
-            </el-form-item>
-          </el-col>
-<!--          <el-col :span="24">-->
-<!--            <el-form-item label="轮播图类型" prop="bannerType">-->
-<!--              <el-radio-group v-model="form.bannerType" size="small">-->
-<!--                <el-radio-button v-for="dict in dict.type.app_banner_type" :label="dict.value">{{dict.label}}</el-radio-button>-->
-<!--              </el-radio-group>-->
-<!--            </el-form-item>-->
-<!--          </el-col>-->
-          <el-col :span="24">
-            <el-form-item label="点击类型" prop="clickType">
-              <el-radio-group v-model="form.clickType" size="small" @input="onClickTypeChange">
-                <el-radio-button v-for="dict in dict.type.app_banner_click_type" :label="dict.value">{{dict.label}}</el-radio-button>
-              </el-radio-group>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24" v-if="form.clickType == '1'">
-            <el-form-item label="跳转内容" prop="redirectContent">
-              <el-input v-model="form.redirectContent" placeholder="请输入跳转网址" />
+    <div class="app-container">
+        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+            <!--      <el-form-item label="轮播图类型" prop="bannerType" label-width="120px">-->
+            <!--        <el-select v-model="queryParams.bannerType" placeholder="轮播图类型" clearable>-->
+            <!--          <el-option-->
+            <!--            v-for="dict in dict.type.app_banner_type"-->
+            <!--            :key="dict.value"-->
+            <!--            :label="dict.label"-->
+            <!--            :value="dict.value"-->
+            <!--          />-->
+            <!--        </el-select>-->
+            <!--      </el-form-item>-->
+            <!--      <el-form-item label="点击类型" prop="clickType">-->
+            <!--        <el-select v-model="queryParams.clickType" placeholder="点击类型" clearable>-->
+            <!--          <el-option-->
+            <!--            v-for="dict in dict.type.app_banner_click_type"-->
+            <!--            :key="dict.value"-->
+            <!--            :label="dict.label"-->
+            <!--            :value="dict.value"-->
+            <!--          />-->
+            <!--        </el-select>-->
+            <!--      </el-form-item>-->
+            <el-form-item prop="status">
+                <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
+                    <el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
+                </el-select>
             </el-form-item>
-          </el-col>
-          <el-col :span="24" v-if="form.clickType == '2'">
-            <el-form-item label="跳转内容" prop="redirectContent">
-              <editor v-model="form.redirectContent" :min-height="192"/>
+            <el-form-item>
+                <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+                <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
             </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="状态" prop="status">
-              <el-radio-group v-model="form.status" size="small">
-                <el-radio-button v-for="dict in dict.type.sys_normal_disable" :label="dict.value">{{dict.label}}</el-radio-button>
-              </el-radio-group>
-            </el-form-item>
-          </el-col>
         </el-form>
-      </el-row>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
+
+        <el-row :gutter="10" class="mb8">
+            <el-col :span="1.5">
+                <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="[bannerType == 0 ? 'app:banner:add' : 'app:launchAdver:add']">新增</el-button>
+            </el-col>
+            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+        </el-row>
+
+        <Page uri="/app/banner/list" :request-params="queryParams" ref="pagination">
+            <el-table-column label="ID" align="center" prop="id" />
+            <el-table-column label="图片" align="center" prop="imgUrl" width="100">
+                <template slot-scope="scope">
+                    <el-image style="width: 80px; height: 80px" :src="scope.row.imgUrl" :preview-src-list="[scope.row.imgUrl]"> </el-image>
+                </template>
+            </el-table-column>
+            <el-table-column label="图片类型" align="center" prop="bannerType">
+                <template slot-scope="scope">
+                    <dict-tag :options="dict.type.app_banner_type" :value="scope.row.bannerType" />
+                </template>
+            </el-table-column>
+            <el-table-column label="点击类型" align="center" prop="clickType">
+                <template slot-scope="scope">
+                    <dict-tag :options="dict.type.app_banner_click_type" :value="scope.row.clickType" />
+                </template>
+            </el-table-column>
+            <el-table-column label="启用状态" align="center" prop="status">
+                <template slot-scope="scope">
+                    <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" />
+                </template>
+            </el-table-column>
+            <el-table-column label="创建人" align="center" prop="createBy" />
+            <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
+            <el-table-column label="修改人" align="center" prop="updateBy" />
+            <el-table-column label="修改时间" align="center" prop="createTime" width="180" />
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                <template slot-scope="scope">
+                    <el-button type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="[bannerType == 0 ? 'app:banner:edit' : 'app:launchAdver:edit']">修改</el-button>
+                    <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="[bannerType == 0 ? 'app:banner:remove' : 'app:launchAdver:remove']">删除</el-button>
+                </template>
+            </el-table-column>
+        </Page>
+
+        <!-- 添加或修改轮播图对话框 -->
+        <el-dialog :title="title" :visible.sync="open" size="30%" append-to-body>
+            <el-row :gutter="15">
+                <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+                    <el-col :span="24">
+                        <el-form-item label="上传" prop="imgUrl">
+                            <el-upload class="image-uploader" :action="uploadAction" :before-upload="handleBeforeUpload" :on-success="handleUploadSuccess" :on-error="handleUploadError" accept="image/*" :show-file-list="false">
+                                <img v-if="form.imgUrl" :src="form.imgUrl" />
+                                <i v-else class="el-icon-plus image-uploader-icon"></i>
+                            </el-upload>
+                        </el-form-item>
+                    </el-col>
+                    <!--          <el-col :span="24">-->
+                    <!--            <el-form-item label="轮播图类型" prop="bannerType">-->
+                    <!--              <el-radio-group v-model="form.bannerType" size="small">-->
+                    <!--                <el-radio-button v-for="dict in dict.type.app_banner_type" :label="dict.value">{{dict.label}}</el-radio-button>-->
+                    <!--              </el-radio-group>-->
+                    <!--            </el-form-item>-->
+                    <!--          </el-col>-->
+                    <el-col :span="24">
+                        <el-form-item label="点击类型" prop="clickType">
+                            <el-radio-group v-model="form.clickType" size="small" @input="onClickTypeChange">
+                                <el-radio-button v-for="dict in dict.type.app_banner_click_type" :label="dict.value">{{ dict.label }}</el-radio-button>
+                            </el-radio-group>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24" v-if="form.clickType == '1'">
+                        <el-form-item label="跳转内容" prop="redirectContent">
+                            <el-input v-model="form.redirectContent" placeholder="请输入跳转网址" />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24" v-if="form.clickType == '2'">
+                        <el-form-item label="跳转内容" prop="redirectContent">
+                            <editor v-model="form.redirectContent" :min-height="192" />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="24">
+                        <el-form-item label="状态" prop="status">
+                            <el-radio-group v-model="form.status" size="small">
+                                <el-radio-button v-for="dict in dict.type.sys_normal_disable" :label="dict.value">{{ dict.label }}</el-radio-button>
+                            </el-radio-group>
+                        </el-form-item>
+                    </el-col>
+                </el-form>
+            </el-row>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
+                <el-button @click="cancel">取 消</el-button>
+            </div>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
-import { listBanner, getBanner, delBanner, addBanner, updateBanner } from "@/api/app/banner";
+import { listBanner, getBanner, delBanner, addBanner, updateBanner } from '@/api/app/banner'
 
 export default {
-  name: "Banner",
-  dicts: ['app_banner_type', 'app_banner_click_type','sys_normal_disable'],
-  data() {
-    return {
-      uploadAction: `${process.env.VUE_APP_BASE_API}` + '/common/uploadOSS',
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 轮播图表格数据
-      bannerList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        bannerType: null,
-        imgUrl: null,
-        clickType: null,
-        redirectContent: null,
-        status: null,
-        createById: null,
-        updateById: null,
-      },
-      // 表单参数
-      form: {
-      },
-      // 表单校验
-      rules: {
-        bannerType: [{
-          required: true,
-          message: "图片类型不能为空",
-          trigger: "blur"
-        }],
-        imgUrl: [{
-          required: true,
-          message: "请先上传图片",
-          trigger: "blur"
-        }],
-        clickType: [{
-          required: true,
-          message: "点击类型不能为空",
-          trigger: "blur"
-        }],
-        status: [{
-          required: true,
-          message: "状态不能为空",
-          trigger: "blur"
-        }],
-        redirectContent:[{
-          required: true,
-          message: "跳转内容不能为空",
-          trigger: "blur"
-        }]
-      },
-      bannerType:''
-    };
-  },
-  created() {
-    this.bannerType = this.getUrlParam('bannerType')
-    this.form.bannerType = this.bannerType
-    this.getList();
-  },
-  methods: {
-    onClickTypeChange(){
-      this.form.redirectContent = ''
-    },
-    // 上传前校检格式和大小
-    handleBeforeUpload(file) {
-      // 校检文件大小
-      if (this.fileSize) {
-        const isLt = file.size / 1024 / 1024 < this.fileSize;
-        if (!isLt) {
-          this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
-          return false;
+    name: 'Banner',
+    dicts: ['app_banner_type', 'app_banner_click_type', 'sys_normal_disable'],
+    data() {
+        return {
+            uploadAction: `${process.env.VUE_APP_BASE_API}` + '/common/uploadOSS',
+            // 遮罩层
+            loading: true,
+            // 选中数组
+            ids: [],
+            // 非单个禁用
+            single: true,
+            // 非多个禁用
+            multiple: true,
+            // 显示搜索条件
+            showSearch: true,
+            // 总条数
+            total: 0,
+            // 轮播图表格数据
+            bannerList: [],
+            // 弹出层标题
+            title: '',
+            // 是否显示弹出层
+            open: false,
+            // 查询参数
+            queryParams: {
+                bannerType: null,
+                imgUrl: null,
+                clickType: null,
+                redirectContent: null,
+                status: null,
+                createById: null,
+                updateById: null
+            },
+            // 表单参数
+            form: {},
+            // 表单校验
+            rules: {
+                bannerType: [
+                    {
+                        required: true,
+                        message: '图片类型不能为空',
+                        trigger: 'blur'
+                    }
+                ],
+                imgUrl: [
+                    {
+                        required: true,
+                        message: '请先上传图片',
+                        trigger: 'blur'
+                    }
+                ],
+                clickType: [
+                    {
+                        required: true,
+                        message: '点击类型不能为空',
+                        trigger: 'blur'
+                    }
+                ],
+                status: [
+                    {
+                        required: true,
+                        message: '状态不能为空',
+                        trigger: 'blur'
+                    }
+                ],
+                redirectContent: [
+                    {
+                        required: true,
+                        message: '跳转内容不能为空',
+                        trigger: 'blur'
+                    }
+                ]
+            },
+            bannerType: ''
         }
-      }
-      return true;
-    },
-    handleUploadSuccess(res, file) {
-      // 获取富文本组件实例
-      let quill = this.Quill;
-      // 如果上传成功
-      if (res.code == 200) {
-        // 获取光标所在位置
-        this.form.imgUrl = res.data.src
-        this.$forceUpdate()
-      } else {
-        this.$message.error("图片插入失败");
-      }
     },
-    handleUploadError() {
-      this.$message.error("图片插入失败");
+    created() {
+        this.bannerType = this.getUrlParam('bannerType')
+        this.queryParams.bannerType = this.bannerType
+        this.form.bannerType = this.bannerType
+        this.getList()
     },
-    /** 查询轮播图列表 */
-    getList() {
-      this.loading = true;
-      listBanner({...this.queryParams,...{bannerType:this.bannerType}}).then(response => {
-        this.bannerList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    checkClose(done) {
-      this.$confirm('是否关闭表单,关闭后数据将丢失?').then(function() {
-        done()
-      }).then(() => {}).catch(() => {});
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        bannerType: this.bannerType,
-        imgUrl: null,
-        clickType: null,
-        redirectContent: null,
-        status: "0"
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加轮播图";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids
-      getBanner(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改轮播图";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateBanner(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addBanner(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
+    methods: {
+        onClickTypeChange() {
+            this.form.redirectContent = ''
+        },
+        // 上传前校检格式和大小
+        handleBeforeUpload(file) {
+            // 校检文件大小
+            if (this.fileSize) {
+                const isLt = file.size / 1024 / 1024 < this.fileSize
+                if (!isLt) {
+                    this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`)
+                    return false
+                }
+            }
+            return true
+        },
+        handleUploadSuccess(res, file) {
+            // 获取富文本组件实例
+            let quill = this.Quill
+            // 如果上传成功
+            if (res.code == 200) {
+                // 获取光标所在位置
+                this.form.imgUrl = res.data.src
+                this.$forceUpdate()
+            } else {
+                this.$message.error('图片插入失败')
+            }
+        },
+        handleUploadError() {
+            this.$message.error('图片插入失败')
+        },
+        /** 查询轮播图列表 */
+        getList() {
+            this.$nextTick(() => {
+                this.$refs.pagination.handleSearch(true)
+            })
+        },
+        checkClose(done) {
+            this.$confirm('是否关闭表单,关闭后数据将丢失?')
+                .then(function () {
+                    done()
+                })
+                .then(() => {})
+                .catch(() => {})
+        },
+        // 取消按钮
+        cancel() {
+            this.open = false
+            this.reset()
+        },
+        // 表单重置
+        reset() {
+            this.form = {
+                id: null,
+                bannerType: this.bannerType,
+                imgUrl: null,
+                clickType: null,
+                redirectContent: null,
+                status: '0'
+            }
+            this.resetForm('form')
+        },
+        /** 搜索按钮操作 */
+        handleQuery() {
+            this.queryParams.pageNum = 1
+            this.getList()
+        },
+        /** 重置按钮操作 */
+        resetQuery() {
+            this.resetForm('queryForm')
+            this.handleQuery()
+        },
+        // 多选框选中数据
+        handleSelectionChange(selection) {
+            this.ids = selection.map((item) => item.id)
+            this.single = selection.length !== 1
+            this.multiple = !selection.length
+        },
+        /** 新增按钮操作 */
+        handleAdd() {
+            this.reset()
+            this.open = true
+            this.title = '添加轮播图'
+        },
+        /** 修改按钮操作 */
+        handleUpdate(row) {
+            this.reset()
+            const id = row.id || this.ids
+            getBanner(id).then((response) => {
+                this.form = response.data
+                this.open = true
+                this.title = '修改轮播图'
+            })
+        },
+        /** 提交按钮 */
+        submitForm() {
+            this.$refs['form'].validate((valid) => {
+                if (valid) {
+                    if (this.form.id != null) {
+                        updateBanner(this.form).then((response) => {
+                            this.$modal.msgSuccess('修改成功')
+                            this.open = false
+                            this.getList()
+                        })
+                    } else {
+                        addBanner(this.form).then((response) => {
+                            this.$modal.msgSuccess('新增成功')
+                            this.open = false
+                            this.getList()
+                        })
+                    }
+                }
+            })
+        },
+        /** 删除按钮操作 */
+        handleDelete(row) {
+            const ids = row.id || this.ids
+            this.$modal
+                .confirm('是否确认删除轮播图编号为"' + ids + '"的数据项?')
+                .then(function () {
+                    return delBanner(ids)
+                })
+                .then(() => {
+                    this.getList()
+                    this.$modal.msgSuccess('删除成功')
+                })
+                .catch(() => {})
+        },
+        /** 导出按钮操作 */
+        handleExport() {
+            this.download(
+                'app/banner/export',
+                {
+                    ...this.queryParams
+                },
+                `banner_${new Date().getTime()}.xlsx`
+            )
         }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除轮播图编号为"' + ids + '"的数据项?').then(function() {
-        return delBanner(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('app/banner/export', {
-        ...this.queryParams
-      }, `banner_${new Date().getTime()}.xlsx`)
     }
-  }
-};
+}
 </script>

+ 342 - 415
src/views/app/delivery/index.vue

@@ -1,435 +1,362 @@
 <template>
-  <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="派送员姓名" prop="appUserName" label-width="90px">
-        <el-input
-          v-model="queryParams.appUserName"
-          placeholder="请输入派送员姓名"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="派送员手机号" prop="phoneNumber" label-width="100px">
-        <el-input
-          v-model="queryParams.phoneNumber"
-          placeholder="请输入手机号"
-          clearable
-          maxlength="11"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search"   @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh"   @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-           
-          @click="handleAdd"
-          v-hasPermi="['app:delivery:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-           
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['app:delivery:edit']"
-        >修改</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-table v-loading="loading" :data="deliveryList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="姓名" align="center" prop="realName" width="150"/>
-      <el-table-column label="手机号" align="center" prop="phoneNumber" width="150"/>
-      <el-table-column label="简介" align="center" prop="description" width="220" show-overflow-tooltip/>
-      <el-table-column label="等级" align="center" prop="level" />
-      <el-table-column label="积分" align="center" >
-        <template slot-scope="scope">
-          <span> {{ scope.row.pointBalance == null ? '0' : scope.row.pointBalance }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="订单数量" align="center" prop="orderCount" />
-      <el-table-column label="绑定门店数量" align="center" >
-        <template slot-scope="scope">
-          <span> {{ scope.row.relationStoreNum == null ? '0' : scope.row.relationStoreNum }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="总接单数" align="center" >
-        <template slot-scope="scope">
-          <span> {{ scope.row.clothOrderTotalNum == null ? '0' : scope.row.clothOrderTotalNum }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="状态" align="center" prop="status" >
-        <template slot-scope="scope">
-          <el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
-                     @change="handleStatusChange(scope.row)"></el-switch>
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-             
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['app:delivery:edit']"
-          >修改</el-button>
-          <el-button
-             
-            type="text"
-            icon="el-icon-delete"
-            @click="recordDetail(scope.row)"
-            v-hasPermi="['app:delivery:edit']"
-          >接单记录</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-
-    <!-- 添加或修改配送员对话框 -->
-    <el-dialog :title="title" :visible.sync="open" size="50%" append-to-body >
-      <el-row :gutter="10" style="margin-right: 20px;margin-left: 20px;width: 95%">
-        <el-card class="box-card custom-card" style="height: 800px">
-          <div slot="header" class="clearfix">
-            <span>选择客户</span>
-          </div>
-          <el-form :model="phoneNumber" size="small"  :inline="true" label-width="68px">
-            <el-col :span="24" v-if="isUpdate">
-              <el-form-item label="手机号" prop="phoneNumber" >
-                <el-input label-width="110px"
-                  v-model="phoneNumber"
-                  placeholder="请输入手机号"
-                  clearable
-                  maxlength="11"
-                  @change="searchUser"
-                />
-              </el-form-item>
-              <el-form-item>
-                <el-button type="primary"   @click="searchUser" >查询</el-button>
-              </el-form-item>
-            </el-col>
-            <el-col :span="24" v-if="appUserInfo">
-              <el-descriptions :column="2" style="margin-top: 20px">
-                <el-descriptions-item label="用户名" >{{appUserInfo.realName}}</el-descriptions-item>
-                <el-descriptions-item label="手机号" >{{appUserInfo.phoneNumber}}</el-descriptions-item>
-                <el-descriptions-item label="等级">{{appUserInfo.level}}</el-descriptions-item>
-                <el-descriptions-item label="积分">{{appUserInfo.pointBalance}}</el-descriptions-item>
-              </el-descriptions>
-            </el-col>
-            <el-col :span="24" v-if="appUserInfo" >
-            <el-form-item label="绑定门店"  label-width="80px" style="margin-top: 20px" required>
-              <el-transfer filterable v-model="orgValue" :data="orgData"  :titles="['未绑定的门店','已绑定的门店']"></el-transfer>
+    <div class="app-container">
+        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+            <el-form-item prop="appUserName" label-width="90px">
+                <el-input v-model="queryParams.appUserName" placeholder="请输入派送员姓名" clearable @keyup.enter.native="handleQuery" />
             </el-form-item>
+            <el-form-item prop="phoneNumber" label-width="100px">
+                <el-input v-model="queryParams.phoneNumber" placeholder="请输入手机号" clearable maxlength="11" @keyup.enter.native="handleQuery" />
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+                <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+            </el-form-item>
+        </el-form>
+
+        <el-row :gutter="10" class="mb8">
+            <el-col :span="1.5">
+                <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="['app:delivery:add']">新增</el-button>
             </el-col>
-            <el-col :span="24" v-if="appUserInfo">
-              <el-form-item label="简介" >
-                <el-input v-model="description"
-                          type="textarea"
-                          placeholder="请输入配送员简介"
-                          maxlength="500"
-                          :rows="5"
-                          style="width: 260px"
-                          show-word-limit/>
-              </el-form-item>
+            <el-col :span="1.5">
+                <el-button type="success" plain icon="el-icon-edit" :disabled="single" @click="handleUpdate" v-hasPermi="['app:delivery:edit']">修改</el-button>
             </el-col>
-          </el-form>
-        </el-card>
-      </el-row>
-      <el-row>
+            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+        </el-row>
 
-      </el-row>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
+        <Page uri="/mapi/app/delivery/page" :request-params="queryParams" ref="pagination">
+            <el-table-column type="selection" width="55" align="center" />
+            <el-table-column label="姓名" align="center" prop="realName" width="150" />
+            <el-table-column label="手机号" align="center" prop="phoneNumber" width="150" />
+            <el-table-column label="简介" align="center" prop="description" width="220" show-overflow-tooltip />
+            <el-table-column label="等级" align="center" prop="level" />
+            <el-table-column label="积分" align="center">
+                <template slot-scope="scope">
+                    <span> {{ scope.row.pointBalance == null ? '0' : scope.row.pointBalance }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="订单数量" align="center" prop="orderCount" />
+            <el-table-column label="绑定门店数量" align="center">
+                <template slot-scope="scope">
+                    <span> {{ scope.row.relationStoreNum == null ? '0' : scope.row.relationStoreNum }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="总接单数" align="center">
+                <template slot-scope="scope">
+                    <span> {{ scope.row.clothOrderTotalNum == null ? '0' : scope.row.clothOrderTotalNum }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column label="状态" align="center" prop="status">
+                <template slot-scope="scope">
+                    <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
+                </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                <template slot-scope="scope">
+                    <el-button type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['app:delivery:edit']">修改</el-button>
+                    <el-button type="text" icon="el-icon-delete" @click="recordDetail(scope.row)" v-hasPermi="['app:delivery:edit']">接单记录</el-button>
+                </template>
+            </el-table-column>
+        </Page>
 
+        <!-- 添加或修改配送员对话框 -->
+        <el-dialog :title="title" :visible.sync="open" size="50%" append-to-body>
+            <el-row :gutter="10" style="margin-right: 20px; margin-left: 20px; width: 95%">
+                <el-card class="box-card custom-card" style="height: 800px">
+                    <div slot="header" class="clearfix">
+                        <span>选择客户</span>
+                    </div>
+                    <el-form :model="phoneNumber" size="small" :inline="true" label-width="68px">
+                        <el-col :span="24" v-if="isUpdate">
+                            <el-form-item label="手机号" prop="phoneNumber">
+                                <el-input label-width="110px" v-model="phoneNumber" placeholder="请输入手机号" clearable maxlength="11" @change="searchUser" />
+                            </el-form-item>
+                            <el-form-item>
+                                <el-button type="primary" @click="searchUser">查询</el-button>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24" v-if="appUserInfo">
+                            <el-descriptions :column="2" style="margin-top: 20px">
+                                <el-descriptions-item label="用户名">{{ appUserInfo.realName }}</el-descriptions-item>
+                                <el-descriptions-item label="手机号">{{ appUserInfo.phoneNumber }}</el-descriptions-item>
+                                <el-descriptions-item label="等级">{{ appUserInfo.level }}</el-descriptions-item>
+                                <el-descriptions-item label="积分">{{ appUserInfo.pointBalance }}</el-descriptions-item>
+                            </el-descriptions>
+                        </el-col>
+                        <el-col :span="24" v-if="appUserInfo">
+                            <el-form-item label="绑定门店" label-width="80px" style="margin-top: 20px" required>
+                                <el-transfer filterable v-model="orgValue" :data="orgData" :titles="['未绑定的门店', '已绑定的门店']"></el-transfer>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="24" v-if="appUserInfo">
+                            <el-form-item label="简介">
+                                <el-input v-model="description" type="textarea" placeholder="请输入配送员简介" maxlength="500" :rows="5" style="width: 260px" show-word-limit />
+                            </el-form-item>
+                        </el-col>
+                    </el-form>
+                </el-card>
+            </el-row>
+            <el-row> </el-row>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
+                <el-button @click="cancel">取 消</el-button>
+            </div>
+        </el-dialog>
 
-<!--   接单记录 -->
-    <el-dialog v-loading="loading" :title="recordDetailTitle" :visible.sync="openDetail" size="80%" append-to-body :before-close="checkCloseDetail">
-      <div class="head-column1" style="margin-top: 40px">
-        <el-table v-loading="loading" :data="recordDetailList" >
-          <el-table-column label="订单编号" align="center" prop="orderNo" width="200"/>
-          <el-table-column label="门店名称" align="center" prop="storeName" width="150"/>
-          <el-table-column label="派送员姓名" align="center" prop="realName" width="100"/>
-          <el-table-column label="派件方式" align="center">
-            <template slot-scope="scope">
-              <span v-if="scope.row.sendClothWay == '0'">到店</span>
-              <span v-if="scope.row.sendClothWay == '1'">上门</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="派件时间" align="center">
-            <template slot-scope="scope">
-              <span v-if="scope.row.sendClothWay == '0'">{{ scope.row.sendToStoreTime }}</span>
-              <span v-if="scope.row.sendClothWay == '1'">{{ scope.row.sendToUserTime }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="取件时间" align="center" prop="pickUpTime" />
-          <el-table-column label="送达时间" align="center" prop="finishTime" />
-        </el-table>
-        <pagination
-          v-show="recordTotal>0"
-          :total="recordTotal"
-          :page.sync="queryDetailParams.pageNum"
-          :limit.sync="queryDetailParams.pageSize"
-          @pagination="recordDetail"
-        />
-      </div>
-    </el-dialog>
-  </div>
+        <!--   接单记录 -->
+        <el-dialog v-loading="loading" :title="recordDetailTitle" :visible.sync="openDetail" size="80%" append-to-body :before-close="checkCloseDetail">
+            <div class="head-column1" style="margin-top: 40px">
+                <el-table v-loading="loading" :data="recordDetailList">
+                    <el-table-column label="订单编号" align="center" prop="orderNo" width="200" />
+                    <el-table-column label="门店名称" align="center" prop="storeName" width="150" />
+                    <el-table-column label="派送员姓名" align="center" prop="realName" width="100" />
+                    <el-table-column label="派件方式" align="center">
+                        <template slot-scope="scope">
+                            <span v-if="scope.row.sendClothWay == '0'">到店</span>
+                            <span v-if="scope.row.sendClothWay == '1'">上门</span>
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="派件时间" align="center">
+                        <template slot-scope="scope">
+                            <span v-if="scope.row.sendClothWay == '0'">{{ scope.row.sendToStoreTime }}</span>
+                            <span v-if="scope.row.sendClothWay == '1'">{{ scope.row.sendToUserTime }}</span>
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="取件时间" align="center" prop="pickUpTime" />
+                    <el-table-column label="送达时间" align="center" prop="finishTime" />
+                </el-table>
+                <pagination v-show="recordTotal > 0" :total="recordTotal" :page.sync="queryDetailParams.pageNum" :limit.sync="queryDetailParams.pageSize" @pagination="recordDetail" />
+            </div>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
-import {
-  listDelivery,
-  getDelivery,
-  delDelivery,
-  addDelivery,
-  updateDelivery,
-  updateDeliveryStatus,
-  getDeliveryOrderRecordList
-} from '@/api/app/delivery'
+import { listDelivery, getDelivery, delDelivery, addDelivery, updateDelivery, updateDeliveryStatus, getDeliveryOrderRecordList } from '@/api/app/delivery'
 import { findUserByPhoneNumber } from '@/api/app/user'
 import { allOrg } from '@/api/system/store'
 
 export default {
-  name: "Delivery",
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      phoneNumber:[],
-      appUserId:null,
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      recordTotal:0,
-      // 配送员表格数据
-      deliveryList: [],
-      // 弹出层标题
-      title: "",
-      recordDetailTitle:"",
-      // 是否显示弹出层
-      open: false,
-      openDetail:false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        appUserName: null,
-        phoneNumber: null,
-      },
-      // 查询参数
-      queryDetailParams: {
-        pageNum: 1,
-        pageSize: 10,
-        appUserId: null,
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-      },
-      appUserInfo:null,
-      // 简介
-      description:null,
-      isUpdate:true,
-      orgData:[],
-      orgValue:[],
-      recordDetailList:[],
-    };
-  },
-  created() {
-    allOrg().then(res => {
-      this.orgData = [];
-      res.data.forEach(org =>{
-        if (org.sourceType == '02'){
-          this.orgData.push({
-            key: org.sourceType+','+org.id,
-            label: org.name,
-          })
+    name: 'Delivery',
+    data() {
+        return {
+            // 遮罩层
+            loading: true,
+            // 选中数组
+            ids: [],
+            phoneNumber: [],
+            appUserId: null,
+            // 非单个禁用
+            single: true,
+            // 非多个禁用
+            multiple: true,
+            // 显示搜索条件
+            showSearch: true,
+            // 总条数
+            total: 0,
+            recordTotal: 0,
+            // 配送员表格数据
+            deliveryList: [],
+            // 弹出层标题
+            title: '',
+            recordDetailTitle: '',
+            // 是否显示弹出层
+            open: false,
+            openDetail: false,
+            // 查询参数
+            queryParams: {
+                appUserName: null,
+                phoneNumber: null
+            },
+            // 查询参数
+            queryDetailParams: {
+                pageNum: 1,
+                pageSize: 10,
+                appUserId: null
+            },
+            // 表单参数
+            form: {},
+            // 表单校验
+            rules: {},
+            appUserInfo: null,
+            // 简介
+            description: null,
+            isUpdate: true,
+            orgData: [],
+            orgValue: [],
+            recordDetailList: []
         }
-      })
-    })
-    this.getList();
-  },
-  methods: {
-    //搜索用户
-    searchUser(){
-      findUserByPhoneNumber({ phoneNumber: this.phoneNumber }).then(res => {
-        this.appUserInfo = res.data;
-      })
-    },
-    /** 查询配送员列表 */
-    getList() {
-      this.loading = true;
-      listDelivery(this.queryParams).then(response => {
-        this.deliveryList = response.data;
-        this.total = response.data.length;
-        this.loading = false;
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.appUserInfo = null;
-      this.description = null;
-      this.phoneNumber = null;
     },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.phoneNumber = selection.map(item => item.phoneNumber);
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.isUpdate = true;
-      this.appUserInfo = null;
-      this.description = null;
-      this.phoneNumber = null;
-      this.open = true;
-      this.title = "添加配送员";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.orgValue = [];
-      this.appUserInfo = null;
-      this.description = null;
-      const phoneNumber = row.phoneNumber || this.phoneNumber[0];
-      findUserByPhoneNumber( { phoneNumber: phoneNumber }).then(res => {
-        this.appUserInfo = res.data;
-      })
-      const id = row.id || this.ids
-      getDelivery(id).then(response => {
-        this.form = response.data;
-        if(this.form.relationList != null && this.form.relationList.length>0){
-          this.form.relationList.forEach(vo =>{
-            this.orgValue.push(vo.sourceType+','+vo.orgId)
-          })
-        }
-        this.description = response.data.description;
-        this.isUpdate = false;
-        this.open = true;
-        this.title = "修改配送员";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      if (this.orgValue.length <= 0){
-        this.$message.error("请选择关联门店");
-        return;
-      }
-      const relationList = [];
-      this.orgValue.forEach(vo =>{
-        relationList.push({
-          'sourceType': vo.split(',')[0],
-          'orgId': vo.split(',')[1]
+    created() {
+        allOrg().then((res) => {
+            this.orgData = []
+            res.data.forEach((org) => {
+                if (org.sourceType == '02') {
+                    this.orgData.push({
+                        key: org.sourceType + ',' + org.id,
+                        label: org.name
+                    })
+                }
+            })
         })
-      });
-      if (this.appUserInfo == null){
-        this.$message.error("请选择配送员");
-        return;
-      }
-      this.form.relationList = relationList;
-      if (this.form.id != null) {
-        this.form.description = this.description;
-        updateDelivery(this.form).then(response => {
-          this.$modal.msgSuccess("修改成功");
-          this.open = false;
-          this.getList();
-          this.form = {};
-        });
-      } else {
-        this.form.appUserId = this.appUserInfo.id;
-        this.form.description = this.description;
-        addDelivery(this.form).then(response => {
-          this.$modal.msgSuccess("新增成功");
-          this.open = false;
-          this.getList();
-          this.form = {};
-        });
-      }
-    },
-    recordDetail(row){
-      if (row.appUserId != null && row.appUserId != ''){
-        this.appUserId = row.appUserId;
-        this.queryDetailParams.appUserId = row.appUserId;
-      }else {
-        this.queryDetailParams.appUserId = this.appUserId;
-      }
-      console.log(this.appUserId)
-      getDeliveryOrderRecordList(this.queryDetailParams).then(response => {
-        this.recordDetailList = response.rows;
-        this.recordTotal = response.total;
-        this.openDetail = true;
-        this.recordDetailTitle = "接单记录";
-      });
-    },
-    checkClose(done) {
-      this.$confirm('是否关闭表单,关闭后数据将丢失?').then(function() {
-        done()
-      }).then(() => {}).catch(() => {});
+        this.getList()
     },
-    checkCloseDetail(done){
-      this.$confirm('是否关闭接单记录明细?').then(function() {
-        done()
-      }).then(() => {
-        this.appUserId = null;
-        this.queryDetailParams = {
-          pageNum: 1,
-          pageSize: 10,
-          appUserId: null,
+    methods: {
+        //搜索用户
+        searchUser() {
+            findUserByPhoneNumber({ phoneNumber: this.phoneNumber }).then((res) => {
+                this.appUserInfo = res.data
+            })
+        },
+        /** 查询配送员列表 */
+        getList() {
+            this.$nextTick(() => {
+                this.$refs.pagination.handleSearch(true)
+            })
+        },
+        // 取消按钮
+        cancel() {
+            this.open = false
+            this.appUserInfo = null
+            this.description = null
+            this.phoneNumber = null
+        },
+        /** 搜索按钮操作 */
+        handleQuery() {
+            this.queryParams.pageNum = 1
+            this.getList()
+        },
+        /** 重置按钮操作 */
+        resetQuery() {
+            this.resetForm('queryForm')
+            this.handleQuery()
+        },
+        // 多选框选中数据
+        handleSelectionChange(selection) {
+            this.ids = selection.map((item) => item.id)
+            this.phoneNumber = selection.map((item) => item.phoneNumber)
+            this.single = selection.length !== 1
+            this.multiple = !selection.length
+        },
+        /** 新增按钮操作 */
+        handleAdd() {
+            this.isUpdate = true
+            this.appUserInfo = null
+            this.description = null
+            this.phoneNumber = null
+            this.open = true
+            this.title = '添加配送员'
+        },
+        /** 修改按钮操作 */
+        handleUpdate(row) {
+            this.orgValue = []
+            this.appUserInfo = null
+            this.description = null
+            const phoneNumber = row.phoneNumber || this.phoneNumber[0]
+            findUserByPhoneNumber({ phoneNumber: phoneNumber }).then((res) => {
+                this.appUserInfo = res.data
+            })
+            const id = row.id || this.ids
+            getDelivery(id).then((response) => {
+                this.form = response.data
+                if (this.form.relationList != null && this.form.relationList.length > 0) {
+                    this.form.relationList.forEach((vo) => {
+                        this.orgValue.push(vo.sourceType + ',' + vo.orgId)
+                    })
+                }
+                this.description = response.data.description
+                this.isUpdate = false
+                this.open = true
+                this.title = '修改配送员'
+            })
+        },
+        /** 提交按钮 */
+        submitForm() {
+            if (this.orgValue.length <= 0) {
+                this.$message.error('请选择关联门店')
+                return
+            }
+            const relationList = []
+            this.orgValue.forEach((vo) => {
+                relationList.push({
+                    sourceType: vo.split(',')[0],
+                    orgId: vo.split(',')[1]
+                })
+            })
+            if (this.appUserInfo == null) {
+                this.$message.error('请选择配送员')
+                return
+            }
+            this.form.relationList = relationList
+            if (this.form.id != null) {
+                this.form.description = this.description
+                updateDelivery(this.form).then((response) => {
+                    this.$modal.msgSuccess('修改成功')
+                    this.open = false
+                    this.getList()
+                    this.form = {}
+                })
+            } else {
+                this.form.appUserId = this.appUserInfo.id
+                this.form.description = this.description
+                addDelivery(this.form).then((response) => {
+                    this.$modal.msgSuccess('新增成功')
+                    this.open = false
+                    this.getList()
+                    this.form = {}
+                })
+            }
+        },
+        recordDetail(row) {
+            if (row.appUserId != null && row.appUserId != '') {
+                this.appUserId = row.appUserId
+                this.queryDetailParams.appUserId = row.appUserId
+            } else {
+                this.queryDetailParams.appUserId = this.appUserId
+            }
+            console.log(this.appUserId)
+            getDeliveryOrderRecordList(this.queryDetailParams).then((response) => {
+                this.recordDetailList = response.rows
+                this.recordTotal = response.total
+                this.openDetail = true
+                this.recordDetailTitle = '接单记录'
+            })
+        },
+        checkClose(done) {
+            this.$confirm('是否关闭表单,关闭后数据将丢失?')
+                .then(function () {
+                    done()
+                })
+                .then(() => {})
+                .catch(() => {})
+        },
+        checkCloseDetail(done) {
+            this.$confirm('是否关闭接单记录明细?')
+                .then(function () {
+                    done()
+                })
+                .then(() => {
+                    this.appUserId = null
+                    this.queryDetailParams = {
+                        pageNum: 1,
+                        pageSize: 10,
+                        appUserId: null
+                    }
+                })
+                .catch(() => {})
+        },
+        handleStatusChange(row) {
+            let text = row.status === '0' ? '启用' : '停用'
+            this.$confirm('确认要' + text + ' ' + row.name + ' 吗?')
+                .then(function () {
+                    return updateDeliveryStatus(row.id, row.status)
+                })
+                .then(() => {
+                    this.$modal.msgSuccess(text + '成功')
+                })
+                .catch(function () {
+                    row.status = row.status === '0' ? '1' : '0'
+                })
         }
-      }).catch(() => {});
-    },
-    handleStatusChange(row) {
-      let text = row.status === "0" ? "启用" : "停用";
-      this.$confirm('确认要' + text + ' ' + row.name + ' 吗?').then(function() {
-        return updateDeliveryStatus(row.id, row.status);
-      }).then(() => {
-        this.$modal.msgSuccess(text + "成功");
-      }).catch(function() {
-        row.status = row.status === "0" ? "1" : "0";
-      });
-    },
-  }
-};
+    }
+}
 </script>

+ 230 - 304
src/views/app/feedback/index.vue

@@ -1,318 +1,244 @@
 <template>
-  <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="反馈类型" prop="feedbackType">
-        <el-select v-model="queryParams.feedbackType" placeholder="请选择反馈类型" clearable>
-          <el-option
-            v-for="dict in dict.type.feedback_type"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="用户ID" prop="userId">
-        <el-input
-          v-model="queryParams.userId"
-          placeholder="请输入用户ID"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="反馈状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择反馈状态" clearable>
-          <el-option
-            v-for="dict in dict.type.feedback_status"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search"   @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh"   @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
+    <div class="app-container">
+        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+            <el-form-item prop="feedbackType">
+                <el-select v-model="queryParams.feedbackType" placeholder="请选择反馈类型" clearable>
+                    <el-option v-for="dict in dict.type.feedback_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                </el-select>
+            </el-form-item>
+            <el-form-item prop="userId">
+                <el-input v-model="queryParams.userId" placeholder="请输入用户ID" clearable @keyup.enter.native="handleQuery" />
+            </el-form-item>
+            <el-form-item prop="status">
+                <el-select v-model="queryParams.status" placeholder="请选择反馈状态" clearable>
+                    <el-option v-for="dict in dict.type.feedback_status" :key="dict.value" :label="dict.label" :value="dict.value" />
+                </el-select>
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+                <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+            </el-form-item>
+        </el-form>
 
-    <el-row :gutter="10" class="mb8">
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="primary"-->
-<!--          plain-->
-<!--          icon="el-icon-plus"-->
-<!--           -->
-<!--          @click="handleAdd"-->
-<!--          v-hasPermi="['app:feedback:add']"-->
-<!--        >新增</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="success"-->
-<!--          plain-->
-<!--          icon="el-icon-edit"-->
-<!--           -->
-<!--          :disabled="single"-->
-<!--          @click="handleUpdate"-->
-<!--          v-hasPermi="['app:feedback:edit']"-->
-<!--        >修改</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="danger"-->
-<!--          plain-->
-<!--          icon="el-icon-delete"-->
-<!--           -->
-<!--          :disabled="multiple"-->
-<!--          @click="handleDelete"-->
-<!--          v-hasPermi="['app:feedback:remove']"-->
-<!--        >删除</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="warning"-->
-<!--          plain-->
-<!--          icon="el-icon-download"-->
-<!--           -->
-<!--          @click="handleExport"-->
-<!--          v-hasPermi="['app:feedback:export']"-->
-<!--        >导出</el-button>-->
-<!--      </el-col>-->
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
+        <el-row :gutter="10" class="mb8">
+            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+        </el-row>
 
-    <el-table v-loading="loading" :data="feedbackList" >
-<!--      @selection-change="handleSelectionChange"-->
-<!--      <el-table-column type="selection" width="55" align="center" fixed="left"/>-->
-<!--      <el-table-column label="ID" align="center" prop="id" />-->
-      <el-table-column label="用户ID" align="center" prop="userId" width="200px"/>
-      <el-table-column label="反馈类型" align="center" prop="feedbackType" width="200px">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.feedback_type" :value="scope.row.feedbackType"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="反馈状态" align="center" prop="status" width="200px">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.feedback_status" :value="scope.row.status"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="反馈内容" align="center" prop="content" show-overflow-tooltip/>
-      <el-table-column label="回复内容" align="center" prop="feedbackResult" show-overflow-tooltip/>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
-        <template slot-scope="scope">
-          <el-button
-             
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['app:feedback:edit']"
-            v-if="scope.row.status != '1'"
-          >回复</el-button>
-<!--          <el-button-->
-<!--             -->
-<!--            type="text"-->
-<!--            icon="el-icon-delete"-->
-<!--            @click="handleDelete(scope.row)"-->
-<!--            v-hasPermi="['app:feedback:remove']"-->
-<!--          >删除</el-button>-->
-        </template>
-      </el-table-column>
-    </el-table>
+        <Page uri="/mapi/app/feedback/list" :request-params="queryParams" ref="pagination">
+            <el-table-column label="用户ID" align="center" prop="userId" width="200px" />
+            <el-table-column label="反馈类型" align="center" prop="feedbackType" width="200px">
+                <template slot-scope="scope">
+                    <dict-tag :options="dict.type.feedback_type" :value="scope.row.feedbackType" />
+                </template>
+            </el-table-column>
+            <el-table-column label="反馈状态" align="center" prop="status" width="200px">
+                <template slot-scope="scope">
+                    <dict-tag :options="dict.type.feedback_status" :value="scope.row.status" />
+                </template>
+            </el-table-column>
+            <el-table-column label="反馈内容" align="center" prop="content" show-overflow-tooltip />
+            <el-table-column label="回复内容" align="center" prop="feedbackResult" show-overflow-tooltip />
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
+                <template slot-scope="scope">
+                    <el-button type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['app:feedback:edit']" v-if="scope.row.status != '1'">回复</el-button>
+                    <!--          <el-button-->
+                    <!--             -->
+                    <!--            type="text"-->
+                    <!--            icon="el-icon-delete"-->
+                    <!--            @click="handleDelete(scope.row)"-->
+                    <!--            v-hasPermi="['app:feedback:remove']"-->
+                    <!--          >删除</el-button>-->
+                </template>
+            </el-table-column>
+        </Page>
 
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
+        <!-- 添加或修改APP意见反馈对话框 -->
+        <el-dialog :title="title" :visible.sync="open" size="30%" append-to-body>
+            <el-row :gutter="15">
+                <el-form ref="form" :model="form" :rules="rules" label-width="100px" style="margin-left: 20px; margin-right: 20px">
+                    <el-col :span="24">
+                        <el-form-item label="回复内容">
+                            <el-input v-model="form.feedbackResult" type="textarea" placeholder="请输入回复内容" maxlength="500" :rows="8" style="width: 400px" show-word-limit />
+                        </el-form-item>
+                    </el-col>
+                </el-form>
+            </el-row>
 
-    <!-- 添加或修改APP意见反馈对话框 -->
-    <el-dialog :title="title" :visible.sync="open" size="30%" append-to-body >
-      <el-row :gutter="15" >
-        <el-form ref="form" :model="form" :rules="rules" label-width="100px" style="margin-left: 20px;margin-right: 20px">
-          <el-col :span="24">
-            <el-form-item label="回复内容" >
-              <el-input v-model="form.feedbackResult"
-                        type="textarea"
-                        placeholder="请输入回复内容"
-                        maxlength="500"
-                        :rows="8"
-                        style="width: 400px"
-                        show-word-limit/>
-            </el-form-item>
-          </el-col>
-        </el-form>
-      </el-row>
-
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
+                <el-button @click="cancel">取 消</el-button>
+            </div>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
-import { listFeedback, getFeedback, delFeedback, addFeedback, updateFeedback , updateFeedbackStatus } from "@/api/app/feedback";
+import { listFeedback, getFeedback, delFeedback, addFeedback, updateFeedback, updateFeedbackStatus } from '@/api/app/feedback'
 
 export default {
-  name: "Feedback",
-  dicts: ['feedback_type', 'feedback_status'],
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // APP意见反馈表格数据
-      feedbackList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        feedbackType: null,
-        content: null,
-        userId: null,
-        status: null,
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询APP意见反馈列表 */
-    getList() {
-      this.loading = true;
-      listFeedback(this.queryParams).then(response => {
-        this.feedbackList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        feedbackType: null,
-        feedbackResult:null,
-        content: null,
-        userId: null,
-        status: null,
-        createTime: null,
-        updateById: null,
-        updateBy: null,
-        updateTime: null
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加APP意见反馈";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids
-      getFeedback(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "回复APP意见反馈";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateFeedback(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addFeedback(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
+    name: 'Feedback',
+    dicts: ['feedback_type', 'feedback_status'],
+    data() {
+        return {
+            // 遮罩层
+            loading: true,
+            // 选中数组
+            ids: [],
+            // 非单个禁用
+            single: true,
+            // 非多个禁用
+            multiple: true,
+            // 显示搜索条件
+            showSearch: true,
+            // 总条数
+            total: 0,
+            // APP意见反馈表格数据
+            feedbackList: [],
+            // 弹出层标题
+            title: '',
+            // 是否显示弹出层
+            open: false,
+            // 查询参数
+            queryParams: {
+                feedbackType: null,
+                content: null,
+                userId: null,
+                status: null
+            },
+            // 表单参数
+            form: {},
+            // 表单校验
+            rules: {}
         }
-      });
     },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除APP意见反馈编号为"' + ids + '"的数据项?').then(function() {
-        return delFeedback(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+    created() {
+        this.getList()
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('mapi/app/feedback/export', {
-        ...this.queryParams
-      }, `feedback_${new Date().getTime()}.xlsx`)
-    },
-    checkClose(done) {
-      this.$confirm('是否关闭表单,关闭后数据将丢失?').then(function() {
-        done()
-      }).then(() => {}).catch(() => {});
-    },
-    handleStatusChange(row) {
-      let text = row.status === "0" ? "启用" : "停用";
-      this.$confirm('确认要' + text + ' ' + row.name + ' 吗?').then(function() {
-        return updateFeedbackStatus(row.id, row.status);
-      }).then(() => {
-        this.$modal.msgSuccess(text + "成功");
-      }).catch(function() {
-        row.status = row.status === "0" ? "1" : "0";
-      });
-    },
-
-  }
-};
+    methods: {
+        /** 查询APP意见反馈列表 */
+        getList() {
+            this.$nextTick(() => {
+                this.$refs.pagination.handleSearch(true)
+            })
+        },
+        // 取消按钮
+        cancel() {
+            this.open = false
+            this.reset()
+        },
+        // 表单重置
+        reset() {
+            this.form = {
+                id: null,
+                feedbackType: null,
+                feedbackResult: null,
+                content: null,
+                userId: null,
+                status: null,
+                createTime: null,
+                updateById: null,
+                updateBy: null,
+                updateTime: null
+            }
+            this.resetForm('form')
+        },
+        /** 搜索按钮操作 */
+        handleQuery() {
+            this.queryParams.pageNum = 1
+            this.getList()
+        },
+        /** 重置按钮操作 */
+        resetQuery() {
+            this.resetForm('queryForm')
+            this.handleQuery()
+        },
+        // 多选框选中数据
+        handleSelectionChange(selection) {
+            this.ids = selection.map((item) => item.id)
+            this.single = selection.length !== 1
+            this.multiple = !selection.length
+        },
+        /** 新增按钮操作 */
+        handleAdd() {
+            this.reset()
+            this.open = true
+            this.title = '添加意见反馈'
+        },
+        /** 修改按钮操作 */
+        handleUpdate(row) {
+            this.reset()
+            const id = row.id || this.ids
+            getFeedback(id).then((response) => {
+                this.form = response.data
+                this.open = true
+                this.title = '回复意见反馈'
+            })
+        },
+        /** 提交按钮 */
+        submitForm() {
+            this.$refs['form'].validate((valid) => {
+                if (valid) {
+                    if (this.form.id != null) {
+                        updateFeedback(this.form).then((response) => {
+                            this.$modal.msgSuccess('修改成功')
+                            this.open = false
+                            this.getList()
+                        })
+                    } else {
+                        addFeedback(this.form).then((response) => {
+                            this.$modal.msgSuccess('新增成功')
+                            this.open = false
+                            this.getList()
+                        })
+                    }
+                }
+            })
+        },
+        /** 删除按钮操作 */
+        handleDelete(row) {
+            const ids = row.id || this.ids
+            this.$modal
+                .confirm('是否确认删除APP意见反馈编号为"' + ids + '"的数据项?')
+                .then(function () {
+                    return delFeedback(ids)
+                })
+                .then(() => {
+                    this.getList()
+                    this.$modal.msgSuccess('删除成功')
+                })
+                .catch(() => {})
+        },
+        /** 导出按钮操作 */
+        handleExport() {
+            this.download(
+                'mapi/app/feedback/export',
+                {
+                    ...this.queryParams
+                },
+                `feedback_${new Date().getTime()}.xlsx`
+            )
+        },
+        checkClose(done) {
+            this.$confirm('是否关闭表单,关闭后数据将丢失?')
+                .then(function () {
+                    done()
+                })
+                .then(() => {})
+                .catch(() => {})
+        },
+        handleStatusChange(row) {
+            let text = row.status === '0' ? '启用' : '停用'
+            this.$confirm('确认要' + text + ' ' + row.name + ' 吗?')
+                .then(function () {
+                    return updateFeedbackStatus(row.id, row.status)
+                })
+                .then(() => {
+                    this.$modal.msgSuccess(text + '成功')
+                })
+                .catch(function () {
+                    row.status = row.status === '0' ? '1' : '0'
+                })
+        }
+    }
+}
 </script>

+ 236 - 312
src/views/app/notify/index.vue

@@ -1,332 +1,256 @@
 <template>
-  <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="标题" prop="title">
-        <el-input
-          v-model="queryParams.title"
-          placeholder="请输入标题"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="跳转类型" prop="clickType">
-        <el-select v-model="queryParams.clickType" placeholder="请选择跳转类型" clearable>
-          <el-option
-            v-for="dict in dict.type.app_notify_click_type"
-            :key="dict.value"
-            :label="dict.label"
-            :value="dict.value"
-          />
-        </el-select>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search"   @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh"   @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-           
-          @click="handleAdd"
-          v-hasPermi="['app:notify:add']"
-        >新增</el-button>
-      </el-col>
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="success"-->
-<!--          plain-->
-<!--          icon="el-icon-edit"-->
-<!--           -->
-<!--          :disabled="single"-->
-<!--          @click="handleUpdate"-->
-<!--          v-hasPermi="['app:notify:edit']"-->
-<!--        >修改</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="danger"-->
-<!--          plain-->
-<!--          icon="el-icon-delete"-->
-<!--           -->
-<!--          :disabled="multiple"-->
-<!--          @click="handleDelete"-->
-<!--          v-hasPermi="['app:notify:remove']"-->
-<!--        >删除</el-button>-->
-<!--      </el-col>-->
-<!--      <el-col :span="1.5">-->
-<!--        <el-button-->
-<!--          type="warning"-->
-<!--          plain-->
-<!--          icon="el-icon-download"-->
-<!--           -->
-<!--          @click="handleExport"-->
-<!--          v-hasPermi="['app:notify:export']"-->
-<!--        >导出</el-button>-->
-<!--      </el-col>-->
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-table v-loading="loading" :data="notifyList" @selection-change="handleSelectionChange">
-      <el-table-column label="序号" align="center" prop="id" width="80"/>
-      <el-table-column label="标题" align="center" prop="title" :show-overflow-tooltip="true"  />
-      <el-table-column label="通知描述" align="center" prop="content"  :show-overflow-tooltip="true" />
-      <el-table-column label="跳转类型" align="center" prop="clickType" width="100">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.app_notify_click_type" :value="scope.row.clickType"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
-      <el-table-column label="创建人" align="center" prop="createBy" width="120"/>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
-        <template slot-scope="scope">
-          <el-button
-             
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-          >明细</el-button>
-<!--          <el-button-->
-<!--             -->
-<!--            type="text"-->
-<!--            icon="el-icon-delete"-->
-<!--            @click="handleDelete(scope.row)"-->
-<!--            v-hasPermi="['app:notify:remove']"-->
-<!--          >删除</el-button>-->
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-
-    <!-- 添加或修改消息通知对话框 -->
-    <el-dialog :title="title" :visible.sync="open" size="30%" append-to-body >
-      <el-row :gutter="15" >
-        <el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="form.id">
-          <el-col :span="24">
-            <el-form-item label="标题" prop="title">
-              <el-input v-model="form.title" placeholder="请输入标题"  maxlength="50"/>
-            </el-form-item>
-            <el-form-item label="通知描述" prop="content">
-              <el-input v-model="form.content" type="textarea" placeholder="请输入通知描述" maxlength="200"
-                        show-word-limit/>
-            </el-form-item>
-            <el-form-item label="跳转类型" prop="clickType">
-              <el-select v-model="form.clickType" placeholder="请选择跳转类型">
-                <el-option
-                  v-for="dict in dict.type.app_notify_click_type"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-            <el-form-item label="跳转页面" v-if="form.clickType == '1'">
-              <el-select v-model="form.redirectContent">
-                <el-option
-                  v-for="dict in dict.type.app_notify_redirect_page"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                />
-              </el-select>
+    <div class="app-container">
+        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+            <el-form-item prop="title">
+                <el-input v-model="queryParams.title" placeholder="请输入标题" clearable @keyup.enter.native="handleQuery" />
             </el-form-item>
-            <el-form-item label="跳转内容" v-if="form.clickType == '2'">
-              <editor v-model="form.redirectContent" :min-height="300"/>
+            <el-form-item prop="clickType">
+                <el-select v-model="queryParams.clickType" placeholder="请选择跳转类型" clearable>
+                    <el-option v-for="dict in dict.type.app_notify_click_type" :key="dict.value" :label="dict.label" :value="dict.value" />
+                </el-select>
             </el-form-item>
-            <el-form-item label="跳转网址" v-if="form.clickType == '3'">
-              <el-input v-model="form.redirectContent" maxlength="200" placeholder="请输入网址">
-                <template slot="prepend">https://</template>
-              </el-input>
+            <el-form-item>
+                <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+                <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
             </el-form-item>
-          </el-col>
         </el-form>
-      </el-row>
 
-      <div slot="footer" class="dialog-footer" v-if="!form.id">
-        <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
+        <el-row :gutter="10" class="mb8">
+            <el-col :span="1.5">
+                <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="['app:notify:add']">新增</el-button>
+            </el-col>
+
+            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+        </el-row>
+
+        <Page uri="/mapi/app/notify/list" :request-params="queryParams" ref="pagination">
+            <el-table-column label="序号" align="center" prop="id" width="80" />
+            <el-table-column label="标题" align="center" prop="title" :show-overflow-tooltip="true" />
+            <el-table-column label="通知描述" align="center" prop="content" :show-overflow-tooltip="true" />
+            <el-table-column label="跳转类型" align="center" prop="clickType" width="100">
+                <template slot-scope="scope">
+                    <dict-tag :options="dict.type.app_notify_click_type" :value="scope.row.clickType" />
+                </template>
+            </el-table-column>
+            <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
+            <el-table-column label="创建人" align="center" prop="createBy" width="120" />
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
+                <template slot-scope="scope">
+                    <el-button type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">明细</el-button>
+                    <!--          <el-button-->
+                    <!--             -->
+                    <!--            type="text"-->
+                    <!--            icon="el-icon-delete"-->
+                    <!--            @click="handleDelete(scope.row)"-->
+                    <!--            v-hasPermi="['app:notify:remove']"-->
+                    <!--          >删除</el-button>-->
+                </template>
+            </el-table-column>
+        </Page>
+
+        <!-- 添加或修改消息通知对话框 -->
+        <el-dialog :title="title" :visible.sync="open" size="30%" append-to-body>
+            <el-row :gutter="15">
+                <el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="form.id > 0">
+                    <el-col :span="24">
+                        <el-form-item label="标题" prop="title">
+                            <el-input v-model="form.title" placeholder="请输入标题" maxlength="50" />
+                        </el-form-item>
+                        <el-form-item label="通知描述" prop="content">
+                            <el-input v-model="form.content" type="textarea" placeholder="请输入通知描述" maxlength="200" show-word-limit />
+                        </el-form-item>
+                        <el-form-item label="跳转类型" prop="clickType">
+                            <el-select v-model="form.clickType" placeholder="请选择跳转类型">
+                                <el-option v-for="dict in dict.type.app_notify_click_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="跳转页面" v-if="form.clickType == '1'">
+                            <el-select v-model="form.redirectContent">
+                                <el-option v-for="dict in dict.type.app_notify_redirect_page" :key="dict.value" :label="dict.label" :value="dict.value" />
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="跳转内容" v-if="form.clickType == '2'">
+                            <editor v-model="form.redirectContent" :min-height="300" />
+                        </el-form-item>
+                        <el-form-item label="跳转网址" v-if="form.clickType == '3'">
+                            <el-input v-model="form.redirectContent" maxlength="200" placeholder="请输入网址">
+                                <template slot="prepend">https://</template>
+                            </el-input>
+                        </el-form-item>
+                    </el-col>
+                </el-form>
+            </el-row>
+
+            <div slot="footer" class="dialog-footer" v-if="!form.id">
+                <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
+                <el-button @click="cancel">取 消</el-button>
+            </div>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
-import { listNotify, getNotify, addNotify  } from "@/api/app/notify";
+import { listNotify, getNotify, addNotify } from '@/api/app/notify'
 
 export default {
-  name: "Notify",
-  dicts: ['app_notify_type', 'app_notify_click_type','app_notify_redirect_page'],
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 消息通知表格数据
-      notifyList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        title: null,
-        clickType: null,
-      },
-      // 表单参数
-      form: {
-        clickType:'0'
-      },
-      // 表单校验
-      rules: {
-        title: [
-          { required: true, message: "标题不能为空", trigger: "blur" }
-        ],
-        content: [
-          { required: true, message: "通知描述不能为空", trigger: "blur" }
-        ],
-        clickType: [
-          { required: true, message: "跳转类型不能为空", trigger: "change" }
-        ],
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询消息通知列表 */
-    getList() {
-      this.loading = true;
-      listNotify(this.queryParams).then(response => {
-        this.notifyList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        title: null,
-        content: null,
-        clickType: '0',
-        redirectContent: null,
-        isAll: 'Y',
-        notifyType: null
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加消息通知";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids
-      getNotify(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "消息通知明细";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          this.$confirm('确定提交吗,提交后消息会以通知形式推送到用户?').then(function() {
-            if (this.form.id != null) {
-              updateNotify(this.form).then(response => {
-                this.$modal.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
-              });
-            } else {
-              addNotify(this.form).then(response => {
-                this.$modal.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
-              });
+    name: 'Notify',
+    dicts: ['app_notify_type', 'app_notify_click_type', 'app_notify_redirect_page'],
+    data() {
+        return {
+            // 遮罩层
+            loading: true,
+            // 选中数组
+            ids: [],
+            // 非单个禁用
+            single: true,
+            // 非多个禁用
+            multiple: true,
+            // 显示搜索条件
+            showSearch: true,
+            // 总条数
+            total: 0,
+            // 消息通知表格数据
+            notifyList: [],
+            // 弹出层标题
+            title: '',
+            // 是否显示弹出层
+            open: false,
+            // 查询参数
+            queryParams: {
+                title: null,
+                clickType: null
+            },
+            // 表单参数
+            form: {
+                clickType: '0'
+            },
+            // 表单校验
+            rules: {
+                title: [{ required: true, message: '标题不能为空', trigger: 'blur' }],
+                content: [{ required: true, message: '通知描述不能为空', trigger: 'blur' }],
+                clickType: [{ required: true, message: '跳转类型不能为空', trigger: 'change' }]
             }
-          }).then(() => {}).catch(() => {});
         }
-      });
-
-
-    },
-    // /** 删除按钮操作 */
-    // handleDelete(row) {
-    //   const ids = row.id || this.ids;
-    //   this.$modal.confirm('是否确认删除消息通知编号为"' + ids + '"的数据项?').then(function() {
-    //     return delNotify(ids);
-    //   }).then(() => {
-    //     this.getList();
-    //     this.$modal.msgSuccess("删除成功");
-    //   }).catch(() => {});
-    // },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('app/notify/export', {
-        ...this.queryParams
-      }, `notify_${new Date().getTime()}.xlsx`)
     },
-    checkClose(done) {
-      this.$confirm('是否关闭表单,关闭后数据将丢失?').then(function() {
-        done()
-      }).then(() => {}).catch(() => {});
+    created() {
+        this.getList()
     },
-
-  }
-};
+    methods: {
+        /** 查询消息通知列表 */
+        getList() {
+            this.$nextTick(() => {
+                this.$refs.pagination.handleSearch(true)
+            })
+        },
+        // 取消按钮
+        cancel() {
+            this.open = false
+            this.reset()
+        },
+        // 表单重置
+        reset() {
+            this.form = {
+                id: null,
+                title: null,
+                content: null,
+                clickType: '0',
+                redirectContent: null,
+                isAll: 'Y',
+                notifyType: null
+            }
+            this.resetForm('form')
+        },
+        /** 搜索按钮操作 */
+        handleQuery() {
+            this.queryParams.pageNum = 1
+            this.getList()
+        },
+        /** 重置按钮操作 */
+        resetQuery() {
+            this.resetForm('queryForm')
+            this.handleQuery()
+        },
+        // 多选框选中数据
+        handleSelectionChange(selection) {
+            this.ids = selection.map((item) => item.id)
+            this.single = selection.length !== 1
+            this.multiple = !selection.length
+        },
+        /** 新增按钮操作 */
+        handleAdd() {
+            this.reset()
+            this.open = true
+            this.title = '添加消息通知'
+        },
+        /** 修改按钮操作 */
+        handleUpdate(row) {
+            this.reset()
+            const id = row.id || this.ids
+            getNotify(id).then((response) => {
+                this.form = response.data
+                this.open = true
+                this.title = '消息通知明细'
+            })
+        },
+        /** 提交按钮 */
+        submitForm() {
+            this.$refs['form'].validate((valid) => {
+                if (valid) {
+                    this.$confirm('确定提交吗,提交后消息会以通知形式推送到用户?')
+                        .then(function () {
+                            if (this.form.id != null) {
+                                updateNotify(this.form).then((response) => {
+                                    this.$modal.msgSuccess('修改成功')
+                                    this.open = false
+                                    this.getList()
+                                })
+                            } else {
+                                addNotify(this.form).then((response) => {
+                                    this.$modal.msgSuccess('新增成功')
+                                    this.open = false
+                                    this.getList()
+                                })
+                            }
+                        })
+                        .then(() => {})
+                        .catch(() => {})
+                }
+            })
+        },
+        // /** 删除按钮操作 */
+        // handleDelete(row) {
+        //   const ids = row.id || this.ids;
+        //   this.$modal.confirm('是否确认删除消息通知编号为"' + ids + '"的数据项?').then(function() {
+        //     return delNotify(ids);
+        //   }).then(() => {
+        //     this.getList();
+        //     this.$modal.msgSuccess("删除成功");
+        //   }).catch(() => {});
+        // },
+        /** 导出按钮操作 */
+        handleExport() {
+            this.download(
+                'app/notify/export',
+                {
+                    ...this.queryParams
+                },
+                `notify_${new Date().getTime()}.xlsx`
+            )
+        },
+        checkClose(done) {
+            this.$confirm('是否关闭表单,关闭后数据将丢失?')
+                .then(function () {
+                    done()
+                })
+                .then(() => {})
+                .catch(() => {})
+        }
+    }
+}
 </script>
 
 <style>
-textarea{
-  min-height: 200px;
+textarea {
+    min-height: 200px;
 }
 </style>

+ 225 - 237
src/views/app/version/index.vue

@@ -1,255 +1,243 @@
 <template>
-  <div class="app-container">
-    <el-tabs v-model="platform" @tab-click="handleQuery">
-      <el-tab-pane v-for="dict in dict.type.app_platform_type" :label="dict.label" :name="dict.value"></el-tab-pane>
-    </el-tabs>
+    <div class="app-container">
+        <el-tabs v-model="platform" @tab-click="handleQuery">
+            <el-tab-pane v-for="dict in dict.type.app_platform_type" :label="dict.label" :name="dict.value"></el-tab-pane>
+        </el-tabs>
+        <el-row :gutter="10" class="mb8">
+            <el-col :span="1.5">
+                <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="['app:version:add']">新增</el-button>
+            </el-col>
+            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+        </el-row>
 
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button type="primary" plain icon="el-icon-plus"  @click="handleAdd" v-hasPermi="['app:version:add']">新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button type="success" plain icon="el-icon-edit"  :disabled="single" @click="handleUpdate" v-hasPermi="['app:version:edit']">修改
-        </el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button type="danger" plain icon="el-icon-delete"  :disabled="multiple" @click="handleDelete"
-          v-hasPermi="['app:version:remove']">删除</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
+        <Page uri="/mapi/app/version/list" :request-params="queryParams" ref="pagination">
+            <el-table-column label="ID" align="center" prop="id" width="80" />
+            <el-table-column label="版本编号" align="center" prop="version" width="150" />
+            <el-table-column label="更新说明" align="center" prop="updateRemark" :show-overflow-tooltip="true" />
+            <el-table-column label="是否强制更新" align="center" prop="isRequire" width="150">
+                <template slot-scope="scope">
+                    <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isRequire" />
+                </template>
+            </el-table-column>
+            <el-table-column label="创建人" align="center" prop="createBy" width="150" />
+            <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
+            <!--      <el-table-column label="安装包地址" align="center" prop="apkUrl" />-->
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
+                <template slot-scope="scope">
+                    <el-button type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['app:version:edit']">修改</el-button>
+                    <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['app:version:remove']">删除</el-button>
+                </template>
+            </el-table-column>
+        </Page>
 
-    <Page  uri="/mapi/app/version/list" :request-params="queryParams" ref="pagination" >
-      <el-table-column label="ID" align="center" prop="id" width="80" />
-      <el-table-column label="版本编号" align="center" prop="version" width="150" />
-      <el-table-column label="更新说明" align="center" prop="updateRemark" :show-overflow-tooltip="true" />
-      <el-table-column label="是否强制更新" align="center" prop="isRequire" width="150">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isRequire" />
-        </template>
-      </el-table-column>
-      <el-table-column label="创建人" align="center" prop="createBy" width="150" />
-      <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
-      <!--      <el-table-column label="安装包地址" align="center" prop="apkUrl" />-->
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150">
-        <template slot-scope="scope">
-          <el-button  type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['app:version:edit']">修改</el-button>
-          <el-button  type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['app:version:remove']">删除</el-button>
-        </template>
-      </el-table-column>
-    </Page>
+        <!-- 添加或修改APP版本管理对话框 -->
+        <el-dialog :title="title" :visible.sync="open" size="30%" append-to-body>
+            <el-row :gutter="15">
+                <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+                    <el-col :span="24">
+                        <el-form-item label="平台" prop="platform">
+                            <el-select v-model="form.platform" placeholder="请选择平台" disabled>
+                                <el-option v-for="dict in dict.type.app_platform_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="版本编号" prop="version">
+                            <el-input v-model="form.version" placeholder="请输入版本编号" prefix="V">
+                                <template slot="prepend">V</template>
+                            </el-input>
+                        </el-form-item>
+                        <el-form-item label="安装包地址" prop="apkUrl" v-if="platform == 'Android'">
+                            <el-input v-model="form.apkUrl" placeholder="请输入安装包地址" prefix="https://">
+                                <template slot="prepend">https://</template>
+                            </el-input>
+                        </el-form-item>
+                        <el-form-item label="更新说明" prop="updateRemark">
+                            <el-input v-model="form.updateRemark" type="textarea" placeholder="请输入内容" />
+                        </el-form-item>
+                        <el-form-item label="是否强制更新" prop="isRequire">
+                            <el-radio-group v-model="form.isRequire">
+                                <el-radio-button v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio-button>
+                            </el-radio-group>
+                        </el-form-item>
+                    </el-col>
+                </el-form>
+            </el-row>
 
-
-    <!-- 添加或修改APP版本管理对话框 -->
-    <el-dialog :title="title" :visible.sync="open" size="30%" append-to-body >
-      <el-row :gutter="15" >
-        <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-          <el-col :span="24">
-            <el-form-item label="平台" prop="platform">
-              <el-select v-model="form.platform" placeholder="请选择平台" disabled>
-                <el-option v-for="dict in dict.type.app_platform_type" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
-              </el-select>
-            </el-form-item>
-            <el-form-item label="版本编号" prop="version">
-              <el-input v-model="form.version" placeholder="请输入版本编号" prefix="V">
-                <template slot="prepend">V</template>
-              </el-input>
-            </el-form-item>
-            <el-form-item label="安装包地址" prop="apkUrl" v-if="platform == 'Android'">
-              <el-input v-model="form.apkUrl" placeholder="请输入安装包地址" prefix="https://">
-                <template slot="prepend">https://</template>
-              </el-input>
-            </el-form-item>
-            <el-form-item label="更新说明" prop="updateRemark">
-              <el-input v-model="form.updateRemark" type="textarea" placeholder="请输入内容" />
-            </el-form-item>
-            <el-form-item label="是否强制更新" prop="isRequire">
-              <el-radio-group v-model="form.isRequire">
-                <el-radio-button v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.value">{{dict.label}}</el-radio-button>
-              </el-radio-group>
-            </el-form-item>
-
-          </el-col>
-        </el-form>
-      </el-row>
-
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
+                <el-button @click="cancel">取 消</el-button>
+            </div>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
-import { listVersion, getVersion, delVersion, addVersion, updateVersion, updateVersionStatus } from "@/api/app/version";
+import { listVersion, getVersion, delVersion, addVersion, updateVersion, updateVersionStatus } from '@/api/app/version'
 
 export default {
-  name: "Version",
-  dicts: ['sys_yes_no', 'app_platform_type'],
-  data() {
-    return {
-      platform: 'Android',
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // APP版本管理表格数据
-      versionList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-      },
-      // 表单参数
-      form: {
-        platform: 'Android',
-        isRequire: 'N'
-      },
-      // 表单校验
-      rules: {
-        platform: [
-          { required: true, message: "平台不能为空", trigger: "change" }
-        ],
-        updateRemark: [
-          { required: true, message: "更新说明不能为空", trigger: "blur" }
-        ],
-        isRequire: [
-          { required: true, message: "是否强制更新不能为空", trigger: "blur" }
-        ],
-        version: [
-          { required: true, message: "版本编号不能为空", trigger: "blur" }
-        ],
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询APP版本管理列表 */
-    getList() {
-      this.$nextTick(() => {
-        this.$refs.pagination.handleSearch(true)
-      })
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        platform: this.platform,
-        apkUrl: null,
-        updateRemark: null,
-        isRequire: "N",
-        version: null,
-        createById: null,
-        createBy: null,
-        createTime: null,
-        updateById: null,
-        updateBy: null,
-        updateTime: null,
-        remark: null
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.$nextTick(() => {
-        this.$refs.pagination.handleSearch(true)
-      })
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length !== 1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加APP版本管理";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids
-      getVersion(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改APP版本管理";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateVersion(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addVersion(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
+    name: 'Version',
+    dicts: ['sys_yes_no', 'app_platform_type'],
+    data() {
+        return {
+            platform: 'Android',
+            // 遮罩层
+            loading: true,
+            // 选中数组
+            ids: [],
+            // 非单个禁用
+            single: true,
+            // 非多个禁用
+            multiple: true,
+            // 显示搜索条件
+            showSearch: true,
+            // 总条数
+            total: 0,
+            // APP版本管理表格数据
+            versionList: [],
+            // 弹出层标题
+            title: '',
+            // 是否显示弹出层
+            open: false,
+            // 查询参数
+            queryParams: {},
+            // 表单参数
+            form: {
+                platform: 'Android',
+                isRequire: 'N'
+            },
+            // 表单校验
+            rules: {
+                platform: [{ required: true, message: '平台不能为空', trigger: 'change' }],
+                updateRemark: [{ required: true, message: '更新说明不能为空', trigger: 'blur' }],
+                isRequire: [{ required: true, message: '是否强制更新不能为空', trigger: 'blur' }],
+                version: [{ required: true, message: '版本编号不能为空', trigger: 'blur' }]
+            }
         }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除APP版本管理编号为"' + ids + '"的数据项?').then(function () {
-        return delVersion(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => { });
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('app/version/export', {
-        ...this.queryParams
-      }, `version_${new Date().getTime()}.xlsx`)
+    created() {
+        this.getList()
     },
-    checkClose(done) {
-      this.$confirm('是否关闭表单,关闭后数据将丢失?').then(function () {
-        done()
-      }).then(() => { }).catch(() => { });
-    },
-
-  }
-};
+    methods: {
+        /** 查询APP版本管理列表 */
+        getList() {
+            this.$nextTick(() => {
+                this.$refs.pagination.handleSearch(true)
+            })
+        },
+        // 取消按钮
+        cancel() {
+            this.open = false
+            this.reset()
+        },
+        // 表单重置
+        reset() {
+            this.form = {
+                id: null,
+                platform: this.platform,
+                apkUrl: null,
+                updateRemark: null,
+                isRequire: 'N',
+                version: null,
+                createById: null,
+                createBy: null,
+                createTime: null,
+                updateById: null,
+                updateBy: null,
+                updateTime: null,
+                remark: null
+            }
+            this.resetForm('form')
+        },
+        /** 搜索按钮操作 */
+        handleQuery() {
+            this.$nextTick(() => {
+                this.$refs.pagination.handleSearch(true)
+            })
+        },
+        /** 重置按钮操作 */
+        resetQuery() {
+            this.resetForm('queryForm')
+            this.handleQuery()
+        },
+        // 多选框选中数据
+        handleSelectionChange(selection) {
+            this.ids = selection.map((item) => item.id)
+            this.single = selection.length !== 1
+            this.multiple = !selection.length
+        },
+        /** 新增按钮操作 */
+        handleAdd() {
+            this.reset()
+            this.open = true
+            this.title = '添加APP版本管理'
+        },
+        /** 修改按钮操作 */
+        handleUpdate(row) {
+            this.reset()
+            const id = row.id || this.ids
+            getVersion(id).then((response) => {
+                this.form = response.data
+                this.open = true
+                this.title = '修改APP版本管理'
+            })
+        },
+        /** 提交按钮 */
+        submitForm() {
+            this.$refs['form'].validate((valid) => {
+                if (valid) {
+                    if (this.form.id != null) {
+                        updateVersion(this.form).then((response) => {
+                            this.$modal.msgSuccess('修改成功')
+                            this.open = false
+                            this.getList()
+                        })
+                    } else {
+                        addVersion(this.form).then((response) => {
+                            this.$modal.msgSuccess('新增成功')
+                            this.open = false
+                            this.getList()
+                        })
+                    }
+                }
+            })
+        },
+        /** 删除按钮操作 */
+        handleDelete(row) {
+            const ids = row.id || this.ids
+            this.$modal
+                .confirm('是否确认删除APP版本管理编号为"' + ids + '"的数据项?')
+                .then(function () {
+                    return delVersion(ids)
+                })
+                .then(() => {
+                    this.getList()
+                    this.$modal.msgSuccess('删除成功')
+                })
+                .catch(() => {})
+        },
+        /** 导出按钮操作 */
+        handleExport() {
+            this.download(
+                'app/version/export',
+                {
+                    ...this.queryParams
+                },
+                `version_${new Date().getTime()}.xlsx`
+            )
+        },
+        checkClose(done) {
+            this.$confirm('是否关闭表单,关闭后数据将丢失?')
+                .then(function () {
+                    done()
+                })
+                .then(() => {})
+                .catch(() => {})
+        }
+    }
+}
 </script>
 
 <style>
 textarea {
-  min-height: 100px;
+    min-height: 100px;
 }
 </style>

+ 229 - 222
src/views/cloth/adjunct/index.vue

@@ -1,237 +1,244 @@
 <template>
-  <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item prop="code">
-        <el-input v-model="queryParams.code" placeholder="请输入编号" clearable @keyup.enter.native="handleQuery" />
-      </el-form-item>
-      <el-form-item prop="name">
-        <el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery" />
-      </el-form-item>
-      <el-form-item prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
-          <el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
-        </el-select>
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="['cloth:adjunct:add']">新增</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <Page uri="/mapi/cloth/adjunct/list" :request-params="queryParams" ref="pagination">
-      <el-table-column label="编号" align="center" prop="code" />
-      <el-table-column label="名称" align="center" prop="name" />
-      <el-table-column label="状态" align="center" prop="status">
-        <template slot-scope="scope">
-          <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
-        </template>
-      </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['cloth:adjunct:edit']">修改</el-button>
-          <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['cloth:adjunct:remove']">删除</el-button>
-        </template>
-      </el-table-column>
-    </Page>
-    <!-- 添加或修改衣服附件对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
-      <el-row :gutter="15" >
-        <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-          <el-col :span="24">
-            <el-form-item label="编号" prop="code">
-              <el-input v-model="form.code" placeholder="请输入编号" />
+    <div class="app-container">
+        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+            <el-form-item prop="code">
+                <el-input v-model="queryParams.code" placeholder="请输入编号" clearable @keyup.enter.native="handleQuery" />
+            </el-form-item>
+            <el-form-item prop="name">
+                <el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery" />
             </el-form-item>
-            <el-form-item label="名称" prop="name">
-              <el-input v-model="form.name" placeholder="请输入名称" />
+            <el-form-item prop="status">
+                <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
+                    <el-option v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" />
+                </el-select>
             </el-form-item>
-            <el-form-item label="状态" prop="status">
-              <el-radio-group v-model="form.status">
-                <el-radio-button v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{dict.label}}</el-radio-button>
-              </el-radio-group>
+            <el-form-item>
+                <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
+                <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
             </el-form-item>
-          </el-col>
         </el-form>
-      </el-row>
 
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
+        <el-row :gutter="10" class="mb8">
+            <el-col :span="1.5">
+                <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="['cloth:adjunct:add']">新增</el-button>
+            </el-col>
+            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+        </el-row>
+
+        <Page uri="/mapi/cloth/adjunct/list" :request-params="queryParams" ref="pagination">
+            <el-table-column label="编号" align="center" prop="code" />
+            <el-table-column label="名称" align="center" prop="name" />
+            <el-table-column label="状态" align="center" prop="status">
+                <template slot-scope="scope">
+                    <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
+                </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                <template slot-scope="scope">
+                    <el-button type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['cloth:adjunct:edit']">修改</el-button>
+                    <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['cloth:adjunct:remove']">删除</el-button>
+                </template>
+            </el-table-column>
+        </Page>
+        <!-- 添加或修改衣服附件对话框 -->
+        <el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
+            <el-row :gutter="15">
+                <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+                    <el-col :span="24">
+                        <el-form-item label="编号" prop="code">
+                            <el-input v-model="form.code" placeholder="请输入编号" />
+                        </el-form-item>
+                        <el-form-item label="名称" prop="name">
+                            <el-input v-model="form.name" placeholder="请输入名称" />
+                        </el-form-item>
+                        <el-form-item label="状态" prop="status">
+                            <el-radio-group v-model="form.status">
+                                <el-radio-button v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio-button>
+                            </el-radio-group>
+                        </el-form-item>
+                    </el-col>
+                </el-form>
+            </el-row>
+
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="submitForm" style="margin-left: 5%">提交</el-button>
+                <el-button @click="cancel">取 消</el-button>
+            </div>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
-import { listAdjunct, getAdjunct, delAdjunct, addAdjunct, updateAdjunct, updateAdjunctStatus } from "@/api/cloth/adjunct";
+import { listAdjunct, getAdjunct, delAdjunct, addAdjunct, updateAdjunct, updateAdjunctStatus } from '@/api/cloth/adjunct'
 
 export default {
-  name: "Adjunct",
-  dicts: ['sys_normal_disable'],
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 衣服附件表格数据
-      adjunctList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        code: null,
-        name: null,
-        status: null,
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        code: [
-          { required: true, message: "编号不能为空", trigger: "blur" }
-        ],
-        name: [
-          { required: true, message: "名称不能为空", trigger: "blur" }
-        ],
-        status: [
-          { required: true, message: "状态不能为空", trigger: "blur" }
-        ],
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询衣服附件列表 */
-    getList() {
-      this.$nextTick(() => {
-        this.$refs.pagination.handleSearch(true)
-      })
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        code: null,
-        name: null,
-        status: "0",
-        delFlag: 0,
-        createById: null,
-        createBy: null,
-        createTime: null,
-        updateById: null,
-        updateBy: null,
-        updateTime: null,
-        remark: null
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length !== 1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加衣服附件";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids
-      getAdjunct(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改衣服附件";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateAdjunct(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addAdjunct(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
+    name: 'Adjunct',
+    dicts: ['sys_normal_disable'],
+    data() {
+        return {
+            // 遮罩层
+            loading: true,
+            // 选中数组
+            ids: [],
+            // 非单个禁用
+            single: true,
+            // 非多个禁用
+            multiple: true,
+            // 显示搜索条件
+            showSearch: true,
+            // 总条数
+            total: 0,
+            // 衣服附件表格数据
+            adjunctList: [],
+            // 弹出层标题
+            title: '',
+            // 是否显示弹出层
+            open: false,
+            // 查询参数
+            queryParams: {
+                code: null,
+                name: null,
+                status: null
+            },
+            // 表单参数
+            form: {},
+            // 表单校验
+            rules: {
+                code: [{ required: true, message: '编号不能为空', trigger: 'blur' }],
+                name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
+                status: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
+            }
         }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除衣服附件编号为"' + ids + '"的数据项?').then(function () {
-        return delAdjunct(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => { });
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('cloth/adjunct/export', {
-        ...this.queryParams
-      }, `adjunct_${new Date().getTime()}.xlsx`)
+    created() {
+        this.getList()
     },
-    checkClose(done) {
-      this.$confirm('是否关闭表单,关闭后数据将丢失?').then(function () {
-        done()
-      }).then(() => { }).catch(() => { });
-    },
-    handleStatusChange(row) {
-      let text = row.status === "0" ? "启用" : "停用";
-      this.$confirm('确认要' + text + ' ' + row.name + ' 吗?').then(function () {
-        return updateAdjunctStatus(row.id, row.status);
-      }).then(() => {
-        this.$modal.msgSuccess(text + "成功");
-      }).catch(function () {
-        row.status = row.status === "0" ? "1" : "0";
-      });
-    },
-
-  }
-};
+    methods: {
+        /** 查询衣服附件列表 */
+        getList() {
+            this.$nextTick(() => {
+                this.$refs.pagination.handleSearch(true)
+            })
+        },
+        // 取消按钮
+        cancel() {
+            this.open = false
+            this.reset()
+        },
+        // 表单重置
+        reset() {
+            this.form = {
+                id: null,
+                code: null,
+                name: null,
+                status: '0',
+                delFlag: 0,
+                createById: null,
+                createBy: null,
+                createTime: null,
+                updateById: null,
+                updateBy: null,
+                updateTime: null,
+                remark: null
+            }
+            this.resetForm('form')
+        },
+        /** 搜索按钮操作 */
+        handleQuery() {
+            this.getList()
+        },
+        /** 重置按钮操作 */
+        resetQuery() {
+            this.resetForm('queryForm')
+            this.handleQuery()
+        },
+        // 多选框选中数据
+        handleSelectionChange(selection) {
+            this.ids = selection.map((item) => item.id)
+            this.single = selection.length !== 1
+            this.multiple = !selection.length
+        },
+        /** 新增按钮操作 */
+        handleAdd() {
+            this.reset()
+            this.open = true
+            this.title = '添加衣服附件'
+        },
+        /** 修改按钮操作 */
+        handleUpdate(row) {
+            this.reset()
+            const id = row.id || this.ids
+            getAdjunct(id).then((response) => {
+                this.form = response.data
+                this.open = true
+                this.title = '修改衣服附件'
+            })
+        },
+        /** 提交按钮 */
+        submitForm() {
+            this.$refs['form'].validate((valid) => {
+                if (valid) {
+                    if (this.form.id != null) {
+                        updateAdjunct(this.form).then((response) => {
+                            this.$modal.msgSuccess('修改成功')
+                            this.open = false
+                            this.getList()
+                        })
+                    } else {
+                        addAdjunct(this.form).then((response) => {
+                            this.$modal.msgSuccess('新增成功')
+                            this.open = false
+                            this.getList()
+                        })
+                    }
+                }
+            })
+        },
+        /** 删除按钮操作 */
+        handleDelete(row) {
+            const ids = row.id || this.ids
+            this.$modal
+                .confirm('是否确认删除衣服附件编号为"' + ids + '"的数据项?')
+                .then(function () {
+                    return delAdjunct(ids)
+                })
+                .then(() => {
+                    this.getList()
+                    this.$modal.msgSuccess('删除成功')
+                })
+                .catch(() => {})
+        },
+        /** 导出按钮操作 */
+        handleExport() {
+            this.download(
+                'cloth/adjunct/export',
+                {
+                    ...this.queryParams
+                },
+                `adjunct_${new Date().getTime()}.xlsx`
+            )
+        },
+        checkClose(done) {
+            this.$confirm('是否关闭表单,关闭后数据将丢失?')
+                .then(function () {
+                    done()
+                })
+                .then(() => {})
+                .catch(() => {})
+        },
+        handleStatusChange(row) {
+            let text = row.status === '0' ? '启用' : '停用'
+            this.$confirm('确认要' + text + ' ' + row.name + ' 吗?')
+                .then(function () {
+                    return updateAdjunctStatus(row.id, row.status)
+                })
+                .then(() => {
+                    this.$modal.msgSuccess(text + '成功')
+                })
+                .catch(function () {
+                    row.status = row.status === '0' ? '1' : '0'
+                })
+        }
+    }
+}
 </script>