xuhaifeng vor 11 Monaten
Ursprung
Commit
b95c216e11

+ 7 - 7
src/views/cloth/clothItem/index.vue

@@ -88,13 +88,13 @@
                             </el-select>
                         </el-form-item>
                     </el-col>
-                    <el-col :span="12">
-                        <el-form-item label="洗衣方式" prop="washId">
-                            <el-select v-model="form.washId" placeholder="洗衣方式" :style="{ width: '100%' }">
-                                <el-option v-for="item in washModeList" :label="item.name" :value="item.id" :key="item.name"> </el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
+                    <!--                    <el-col :span="12">-->
+                    <!--                        <el-form-item label="洗衣方式" prop="washId">-->
+                    <!--                            <el-select v-model="form.washId" placeholder="洗衣方式" :style="{ width: '100%' }">-->
+                    <!--                                <el-option v-for="item in washModeList" :label="item.name" :value="item.id" :key="item.name"> </el-option>-->
+                    <!--                            </el-select>-->
+                    <!--                        </el-form-item>-->
+                    <!--                    </el-col>-->
 
                     <el-col :span="12">
                         <el-form-item label="是否改变价格" prop="isChangePrice">

+ 89 - 100
src/views/cloth/clothItem/setPrice.vue

@@ -1,117 +1,106 @@
 <template>
-  <div class="app-container">
-    <el-tabs v-model="areaId" @tab-click="getPriceList">
-      <el-tab-pane v-for="item in areaList" :label="item.name" :name="item.code"></el-tab-pane>
-    </el-tabs>
+    <div class="app-container">
+        <el-tabs v-model="areaId" @tab-click="getPriceList">
+            <el-tab-pane v-for="item in areaList" :label="item.name" :name="item.id + ''"></el-tab-pane>
+        </el-tabs>
 
+        <el-form ref="form" :model="form" size="medium" label-width="100px" v-loading="loading">
+            <el-divider content-position="left" style="margin-top: 20px">洗衣方式</el-divider>
+            <el-row :gutter="15">
+                <el-col :span="6" v-for="item in formItems">
+                    <el-form-item :label="item.washModeName" :prop="'w_' + item.washModeId" v-if="item.priceType == '0'">
+                        <el-input-number v-model="form['w_' + item.washModeId]" :placeholder="'请输入' + item.washModeName + '价格'" :style="{ width: '100%' }" :precision="2" :max="9999" :min="0" />
+                    </el-form-item>
+                </el-col>
+            </el-row>
+            <el-divider content-position="left">衣服类型</el-divider>
+            <el-row :gutter="15">
+                <el-col :span="6" v-for="item in formItems">
+                    <el-form-item :label="item.clothTypeName" :prop="'c_' + item.clothTypeCode" v-if="item.priceType == '1'">
+                        <el-input-number v-model="form['c_' + item.clothTypeCode]" :placeholder="'请输入' + item.clothTypeName + '价格'" :style="{ width: '100%' }" :precision="2" :max="9999" :min="0" />
+                    </el-form-item>
+                </el-col>
+            </el-row>
 
-    <el-form ref="form" :model="form" size="medium" label-width="100px" v-loading="loading">
-      <el-divider content-position="left" style="margin-top: 20px">洗衣方式</el-divider>
-      <el-row :gutter="15" >
-        <el-col :span="6" v-for="item in formItems">
-          <el-form-item :label="item.washModeName" :prop="'w_' + item.washModeId" v-if="item.priceType == '0'">
-            <el-input-number v-model="form['w_' + item.washModeId]" :placeholder="'请输入' + item.washModeName + '价格'" :style="{width: '100%'}" :precision="2" :max="9999" :min="0"/>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-divider content-position="left">衣服类型</el-divider>
-      <el-row :gutter="15" >
-        <el-col :span="6" v-for="item in formItems">
-          <el-form-item :label="item.clothTypeName" :prop="'c_' + item.clothTypeCode" v-if="item.priceType == '1'">
-            <el-input-number v-model="form['c_' + item.clothTypeCode]" :placeholder="'请输入' + item.clothTypeName + '价格'" :style="{width: '100%'}" :precision="2" :max="9999" :min="0" />
-          </el-form-item>
-        </el-col>
-      </el-row>
-
-      <el-row :gutter="15" >
-        <el-col :span="24">
-          <el-form-item style="text-align: center;">
-            <el-button type="primary" @click="submitForm">保存价格</el-button>
-          </el-form-item>
-        </el-col>
-      </el-row>
-
-
-    </el-form>
-
-  </div>
+            <el-row :gutter="15">
+                <el-col :span="24">
+                    <el-form-item style="text-align: center">
+                        <el-button type="primary" @click="submitForm">保存价格</el-button>
+                    </el-form-item>
+                </el-col>
+            </el-row>
+        </el-form>
+    </div>
 </template>
 
 <script>
-import {listStoreArea} from "@/api/system/storeArea";
-import {listPrice,setPrice} from "@/api/cloth/price";
+import { listStoreArea } from '@/api/system/storeArea'
+import { listPrice, setPrice } from '@/api/cloth/price'
 
 export default {
-  name: "setClothPrice",
-  data(){
-    return {
-      areaId:'',
-      areaList:[],
-      form:{},
-      formItems:[],
-      clothId:'',
-      loading:false
-    }
-  },
-  created() {
-    this.clothId = this.$route.params && this.$route.params.clothId;
-    this.getAreaList()
-
-  },
-  methods: {
-    getAreaList(){
-      this.loading = true
-      listStoreArea({pageSize:10000,pageNum:1,status:'0'}).then(res => {
-        this.areaList = res.rows
-        if(this.areaList.length > 0){
-          this.areaId = this.areaList[0].id
+    name: 'setClothPrice',
+    data() {
+        return {
+            areaId: '1',
+            areaList: [],
+            form: {},
+            formItems: [],
+            clothId: '',
+            loading: false
         }
-        this.getPriceList()
-      })
     },
-    getPriceList(){
-      this.form = {}
-      this.loading = true
-      listPrice({storeAreaId:this.areaId,clothId:this.clothId}).then(res => {
-        this.formItems = res.data
-        this.loading = false
-        this.formItems.forEach(item => {
-          if(item.price == undefined){
-            return
-          }
-          if(item.priceType == '0'){
-            this.form['w_' + item.washModeId] = item.price
-          }else{
-            this.form['c_' + item.clothTypeCode] = item.price
-          }
-        })
-        this.$forceUpdate()
-      })
+    created() {
+        this.clothId = this.$route.params && this.$route.params.clothId
+        this.getAreaList()
     },
-    submitForm(){
-      var list = []
-      for(var key in this.form)
-      {
-        if(this.form[key] == undefined || this.form[key] == 0){
-          continue
-        }
+    methods: {
+        getAreaList() {
+            this.loading = true
+            listStoreArea({ pageSize: 10000, pageNum: 1, status: '0' }).then((res) => {
+                this.areaList = res.rows
+                this.getPriceList()
+            })
+        },
+        getPriceList() {
+            this.form = {}
+            this.loading = true
+            listPrice({ storeAreaId: this.areaId, clothId: this.clothId }).then((res) => {
+                this.formItems = res.data
+                this.loading = false
+                this.formItems.forEach((item) => {
+                    if (item.price == undefined) {
+                        return
+                    }
+                    if (item.priceType == '0') {
+                        this.form['w_' + item.washModeId] = item.price
+                    } else {
+                        this.form['c_' + item.clothTypeCode] = item.price
+                    }
+                })
+                this.$forceUpdate()
+            })
+        },
+        submitForm() {
+            var list = []
+            for (var key in this.form) {
+                if (this.form[key] == undefined || this.form[key] == 0) {
+                    continue
+                }
 
-        if(key.split('_')[0] == 'w'){
-          list.push({washModeId:key.split('_')[1],priceType:'0',price:this.form[key]})
-        }else{
-          list.push({clothType:key.split('_')[1],priceType:'1',price:this.form[key]})
-        }
-      }
+                if (key.split('_')[0] == 'w') {
+                    list.push({ washModeId: key.split('_')[1], priceType: '0', price: this.form[key] })
+                } else {
+                    list.push({ clothType: key.split('_')[1], priceType: '1', price: this.form[key] })
+                }
+            }
 
-      console.log(JSON.stringify(list))
-      setPrice({clothId:this.clothId,storeAreaId:this.areaId,clothPriceItemDTOS:list}).then(res => {
-        this.$message.success('保存成功')
-      })
+            console.log(JSON.stringify(list))
+            setPrice({ clothId: this.clothId, storeAreaId: this.areaId, clothPriceItemDTOS: list }).then((res) => {
+                this.$message.success('保存成功')
+            })
+        }
     }
-  }
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 8 - 18
src/views/system/factory/index.vue

@@ -1,22 +1,22 @@
 <template>
     <div class="app-container">
         <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-            <el-form-item label="工厂名称" prop="factoryName">
+            <el-form-item prop="factoryName">
                 <el-input v-model="queryParams.factoryName" placeholder="请输入工厂名称" clearable @keyup.enter.native="handleQuery" />
             </el-form-item>
 
-            <el-form-item label="省份" style="margin-left: 10px">
+            <el-form-item style="margin-left: 10px">
                 <el-select size="small" style="width: 200px" v-model="province" placeholder="请选择省份(直辖市)" v-on:change="changeProvince()">
                     <el-option v-for="item in provinces" :label="item.areaName" :value="item.areaId" :key="item.areaName"> </el-option>
                 </el-select>
             </el-form-item>
 
-            <el-form-item label="城市" style="margin-left: 10px">
+            <el-form-item style="margin-left: 10px">
                 <el-select size="small" style="width: 200px" v-model="city" placeholder="请选择城市" v-on:change="changeCity">
                     <el-option v-for="item in citys" :label="item.areaName" :value="item.areaId" :key="item.areaName"> </el-option>
                 </el-select>
             </el-form-item>
-            <el-form-item label="区县" prop="area" style="margin-left: 10px">
+            <el-form-item prop="area" style="margin-left: 10px">
                 <el-select size="small" style="width: 200px" v-model="area" placeholder="请选择区(县)">
                     <el-option v-for="item in areas" :label="item.areaName" :value="item.areaId" :key="item.areaName"> </el-option>
                 </el-select>
@@ -32,11 +32,9 @@
             <el-col :span="1.5">
                 <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="['system:factory:add']">新增 </el-button>
             </el-col>
-
             <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
-
-        <el-table v-loading="loading" fit highlight-current-row border stripe :data="factoryList">
+        <Page uri="/system/factory/list" :request-params="queryParams" ref="pagination">
             <el-table-column label="id" align="center" prop="id" />
             <el-table-column label="工厂名称" align="center" prop="factoryName" />
             <el-table-column label="负责人名称" align="center" prop="applyName" />
@@ -61,9 +59,7 @@
                     <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:factory:remove']" v-if="scope.row.id !== 1">删除 </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" />
+        </Page>
 
         <el-dialog :title="title" :visible.sync="open" direction="rtl" size="50%" append-to-body @opened="onDialogOpened" destroy-on-close>
             <Add_factory ref="AddFactory" @closeDialog="closeDialog" />
@@ -112,8 +108,6 @@ export default {
             open: false,
             // 查询参数
             queryParams: {
-                pageNum: 1,
-                pageSize: 10,
                 factoryName: null,
                 applyName: null,
                 applyIdCard: null,
@@ -171,11 +165,8 @@ export default {
             this.queryParams.provinceId = this.province
             this.queryParams.cityId = this.city
             this.queryParams.areaId = this.area
-            this.loading = true
-            listFactory(this.queryParams).then((response) => {
-                this.factoryList = response.rows
-                this.total = response.total
-                this.loading = false
+            this.$nextTick(() => {
+                this.$refs.pagination.handleSearch(true)
             })
         },
         // 工厂状态修改
@@ -262,7 +253,6 @@ export default {
         },
         /** 搜索按钮操作 */
         handleQuery() {
-            this.queryParams.pageNum = 1
             this.getList()
         },
         /** 重置按钮操作 */

+ 7 - 21
src/views/system/notice/index.vue

@@ -1,13 +1,13 @@
 <template>
     <div class="app-container">
         <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-            <el-form-item label="公告标题" prop="noticeTitle">
+            <el-form-item prop="noticeTitle">
                 <el-input v-model="queryParams.noticeTitle" placeholder="请输入公告标题" clearable @keyup.enter.native="handleQuery" />
             </el-form-item>
-            <el-form-item label="操作人员" prop="createBy">
+            <el-form-item prop="createBy">
                 <el-input v-model="queryParams.createBy" placeholder="请输入操作人员" clearable @keyup.enter.native="handleQuery" />
             </el-form-item>
-            <el-form-item label="类型" prop="noticeType">
+            <el-form-item prop="noticeType">
                 <el-select v-model="queryParams.noticeType" placeholder="公告类型" clearable>
                     <el-option v-for="dict in dict.type.sys_notice_type" :key="dict.value" :label="dict.label" :value="dict.value" />
                 </el-select>
@@ -22,16 +22,10 @@
             <el-col :span="1.5">
                 <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="['system:notice: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="['system:notice: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="['system:notice:remove']">删除</el-button>
-            </el-col>
             <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
-        <el-table v-loading="loading" fit highlight-current-row border stripe :data="noticeList" @selection-change="handleSelectionChange">
+        <Page uri="/system/notice/list" :request-params="queryParams" ref="pagination">
             <el-table-column type="selection" width="55" align="center" />
             <!--      <el-table-column label="序号" align="center" prop="noticeId" width="100" />-->
             <el-table-column label="公告标题" align="center" prop="noticeTitle" :show-overflow-tooltip="true" />
@@ -57,9 +51,7 @@
                     <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:notice: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" />
+        </Page>
 
         <!-- 添加或修改公告对话框 -->
         <el-dialog :title="title" :visible.sync="open" width="780px" append-to-body>
@@ -135,8 +127,6 @@ export default {
             open: false,
             // 查询参数
             queryParams: {
-                pageNum: 1,
-                pageSize: 10,
                 noticeTitle: undefined,
                 createBy: undefined,
                 status: undefined
@@ -167,11 +157,8 @@ export default {
     methods: {
         /** 查询公告列表 */
         getList() {
-            this.loading = true
-            listNotice(this.queryParams).then((response) => {
-                this.noticeList = response.rows
-                this.total = response.total
-                this.loading = false
+            this.$nextTick(() => {
+                this.$refs.pagination.handleSearch(true)
             })
         },
         // 取消按钮
@@ -192,7 +179,6 @@ export default {
         },
         /** 搜索按钮操作 */
         handleQuery() {
-            this.queryParams.pageNum = 1
             this.getList()
         },
         /** 重置按钮操作 */

+ 9 - 17
src/views/system/store/index.vue

@@ -1,27 +1,27 @@
 <template>
     <div class="app-container">
         <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-            <el-form-item label="门店名称" prop="name">
+            <el-form-item prop="name">
                 <el-input v-model="queryParams.name" placeholder="请输入门店名称" clearable @keyup.enter.native="handleQuery" />
             </el-form-item>
-            <el-form-item label="所属工厂" style="margin-left: 10px" v-if="userInfoVO.userType == '00'">
+            <el-form-item style="margin-left: 10px" v-if="userInfoVO.userType == '00'">
                 <el-select size="small" style="width: 200px" v-model="queryParams.factoryId" placeholder="请选择所属工厂" clearable>
                     <el-option v-for="item in factorys" :label="item.factoryName" :value="item.id" :key="item.factoryName"> </el-option>
                 </el-select>
             </el-form-item>
-            <el-form-item label="门店类型" style="margin-left: 10px">
+            <el-form-item style="margin-left: 10px">
                 <el-select v-model="queryParams.storeType" placeholder="请选择门店类型" clearable>
                     <el-option v-for="dict in dict.type.sys_store_type" :key="dict.value" :label="dict.label" :value="dict.value" />
                 </el-select>
             </el-form-item>
 
-            <el-form-item label="省份">
+            <el-form-item>
                 <el-select size="small" style="width: 200px" v-model="province" placeholder="请选择省份(直辖市)" v-on:change="changeProvince()">
                     <el-option v-for="item in provinces" :label="item.areaName" :value="item.areaId" :key="item.areaName"> </el-option>
                 </el-select>
             </el-form-item>
 
-            <el-form-item label="城市">
+            <el-form-item>
                 <el-select size="small" style="width: 200px" v-model="city" placeholder="请选择城市">
                     <el-option v-for="item in citys" :label="item.areaName" :value="item.areaId" :key="item.areaName"> </el-option>
                 </el-select>
@@ -41,7 +41,7 @@
             <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
-        <el-table v-loading="loading" fit highlight-current-row border stripe :data="storeList">
+        <Page uri="/system/store/list" :request-params="queryParams" ref="pagination">
             <el-table-column label="" align="center" prop="id" v-if="false" />
             <el-table-column label="门店编号" align="center" prop="code" />
             <el-table-column label="门店名称" align="center" prop="name" />
@@ -83,9 +83,7 @@
                     <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:store: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" />
+        </Page>
 
         <el-dialog :title="title" :visible.sync="open" direction="rtl" size="50%" append-to-body @opened="onDialogOpened" destroy-on-close>
             <Add_store ref="AddStore" @closeDialog="closeDialog" />
@@ -129,8 +127,6 @@ export default {
             open: false,
             // 查询参数
             queryParams: {
-                pageNum: 1,
-                pageSize: 10,
                 name: null,
                 factoryId: null,
                 storeType: null,
@@ -222,13 +218,10 @@ export default {
         },
         /** 查询门店列表 */
         getList() {
-            this.loading = true
             this.queryParams.provinceId = this.province
             this.queryParams.cityId = this.city
-            listStore(this.queryParams).then((response) => {
-                this.storeList = response.rows
-                this.total = response.total
-                this.loading = false
+            this.$nextTick(() => {
+                this.$refs.pagination.handleSearch(true)
             })
         },
         // 取消按钮
@@ -289,7 +282,6 @@ export default {
         },
         /** 搜索按钮操作 */
         handleQuery() {
-            this.queryParams.pageNum = 1
             this.getList()
         },
         /** 重置按钮操作 */

+ 12 - 19
src/views/system/storeArea/index.vue

@@ -1,10 +1,10 @@
 <template>
     <div class="app-container">
         <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-            <el-form-item label="区域名称" prop="name">
+            <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="sort">
+            <el-form-item prop="sort">
                 <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>
@@ -19,12 +19,12 @@
             <el-col :span="1.5">
                 <el-button type="primary" plain icon="el-icon-plus" @click="handleAdd" v-hasPermi="['system:storeArea: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="['system:storeArea: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="['system:storeArea:remove']">删除</el-button>
-            </el-col>
+            <!--            <el-col :span="1.5">-->
+            <!--                <el-button type="success" plain icon="el-icon-edit" :disabled="single" @click="handleUpdate" v-hasPermi="['system:storeArea: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="['system:storeArea:remove']">删除</el-button>-->
+            <!--            </el-col>-->
             <!--      <el-col :span="1.5">-->
             <!--        <el-button-->
             <!--          type="warning"-->
@@ -38,7 +38,7 @@
             <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
-        <el-table v-loading="loading" fit highlight-current-row border stripe :data="storeAreaList" @selection-change="handleSelectionChange">
+        <Page uri="/mapi/system/storeArea/list" :request-params="queryParams" ref="pagination">
             <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="name" />
@@ -58,9 +58,7 @@
                     <el-button type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:storeArea: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" />
+        </Page>
 
         <!-- 添加或修改门店区域对话框 -->
         <el-dialog :title="title" :visible.sync="open" width="500px">
@@ -122,8 +120,6 @@ export default {
             open: false,
             // 查询参数
             queryParams: {
-                pageNum: 1,
-                pageSize: 10,
                 name: null,
                 sort: null,
                 status: null
@@ -140,11 +136,8 @@ export default {
     methods: {
         /** 查询门店区域列表 */
         getList() {
-            this.loading = true
-            listStoreArea(this.queryParams).then((response) => {
-                this.storeAreaList = response.rows
-                this.total = response.total
-                this.loading = false
+            this.$nextTick(() => {
+                this.$refs.pagination.handleSearch(true)
             })
         },
         // 取消按钮