Browse Source

Merge branch 'develop' of http://git.chelingzhu.com/chelingzhu-web/storeCheck-admin-html into develop

lilei 4 years ago
parent
commit
9ff5e1ba38

+ 22 - 9
src/views/SupervisionAuth/role/roleList.vue

@@ -34,8 +34,19 @@
       bordered
     >
       <span slot="status" slot-scope="text, record">
-        <a-switch checkedChildren="启用" unCheckedChildren="禁用" v-model="record.isEnable" @change="changeFlagHandle(text, record)" v-hasPermission="'B_power_role_del'" id="roleList-changeFlagHandle"/>
+        <a-switch
+          checkedChildren="启用"
+          unCheckedChildren="禁用"
+          v-model="record.isEnable"
+          @change="changeFlagHandle(text, record)"
+          v-hasPermission="'B_power_role_del'"
+          id="roleList-changeFlagHandle"/>
       </span>
+      <!-- 角色描述 -->
+      <template slot="remarks" slot-scope="text, record">
+        <span :title="record.remarks" style="display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{{ record.remarks }}</span>
+
+      </template>
       <span slot="action" slot-scope="text, record">
         <a class="action-button menu-text" @click="openMenuModal(record)" v-hasPermission="'M_power_role_menu'" id="roleList-openMenuModal">菜单权限</a>
         <a class="action-button" @click="handleEdit(record)" v-hasPermission="'B_supervision_role_edit'" id="roleList-handleEdit">修改</a>
@@ -75,36 +86,38 @@ export default {
         {
           title: '序号',
           dataIndex: 'no',
-          width: '40',
+          width: 60,
           align: 'center'
         },
         {
           title: '创建时间',
           dataIndex: 'createDate',
-          minWidth: '100',
+          width: 200,
           align: 'center'
         },
         {
           title: '角色名称',
           dataIndex: 'name',
-          minWidth: '100',
+          width: 150,
           align: 'center'
         },
         {
           title: '角色描述',
           dataIndex: 'remarks',
-          minWidth: '100',
-          align: 'center'
+          width: 200,
+		  ellipsis: true, // 内容超过宽度 自动出现省略号
+          align: 'center',
+		  scopedSlots: { customRender: 'remarks' }
         },
         {
           title: '状态',
-          minWidth: '100',
+          width: 150,
           align: 'center',
           scopedSlots: { customRender: 'status' }
         },
         {
           title: '操作',
-          minWidth: '100',
+          width: 200,
           align: 'center',
           scopedSlots: { customRender: 'action' }
         }
@@ -192,7 +205,7 @@ export default {
         if (res.status == 200) {
           this.$message.success('修改成功')
         } else {
-          this.$message.error(res.message)
+          // this.$message.error(res.message)
           record.isEnable = !record.isEnable
         }
       })

+ 4 - 4
src/views/SupervisionAuth/role/roleModal.vue

@@ -6,9 +6,9 @@
         <a-form-item label="角色名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-input
             placeholder="请输入角色名称30个字以内"
-			allowClear
-			id="roleModal-name"
+            allowClear
             :maxLength="30"
+            id="roleModal-name"
             v-decorator="['formData.name', {
               initialValue: formData.name,
               rules: [{ required: true, message: '请输入角色名称30个字以内!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
@@ -18,7 +18,7 @@
         <a-form-item label="状态" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-radio-group
             name="radioGroup"
-			id="roleModal-isEnable"
+            id="roleModal-isEnable"
             v-decorator="[
               'formData.isEnable',
               {
@@ -33,7 +33,7 @@
 
         <a-form-item label="角色描述" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
           <a-textarea
-			id="roleModal-remarks"
+            id="roleModal-remarks"
             v-decorator="[
               'formData.remarks',
               { initialValue: formData.remarks,

+ 3 - 3
src/views/SupervisionAuth/user/newStoreModal.vue

@@ -70,18 +70,18 @@ export default {
       columns: [{
         title: '序号',
         dataIndex: 'no',
-        minWidth: '100',
+        width: 60,
         align: 'center'
       },
       {
         title: '门店名称',
         dataIndex: 'storeName',
-        minWidth: '100',
+        width: 100,
         align: 'center'
       },
       {
         title: '操作',
-        minWidth: '100',
+        width: 100,
         align: 'center',
         scopedSlots: {
           customRender: 'action'

+ 3 - 3
src/views/SupervisionAuth/user/usedStoreModal.vue

@@ -53,19 +53,19 @@ export default {
       columns: [{
         title: '序号',
         dataIndex: 'no',
-        minWidth: '100',
+         width: 60,
         align: 'center'
       },
       {
         title: '门店名称',
         dataIndex: 'storeName',
-        minWidth: '100',
+        width: 100,
         align: 'center'
       },
       {
         title: '操作',
         key: '操作',
-        minWidth: '100',
+        width: 100,
         align: 'center',
         scopedSlots: {
           customRender: 'action'

+ 9 - 9
src/views/SupervisionAuth/user/userList.vue

@@ -9,7 +9,7 @@
                 allowClear
                 v-model.trim="queryParam.name"
                 id="userList-name"
-				:maxLength="30"
+                :maxLength="30"
                 @pressEnter="$refs.table.refresh(true)"
                 placeholder="请输入员工姓名" />
             </a-form-item>
@@ -20,7 +20,7 @@
                 allowClear
                 v-model.trim="queryParam.phone"
                 id="userList-phone"
-				:maxLength="11"
+                :maxLength="11"
                 @pressEnter="$refs.table.refresh(true)"
                 placeholder="请输入手机号码" />
             </a-form-item>
@@ -121,37 +121,37 @@ export default {
       columns: [{
         title: '序号',
         dataIndex: 'no',
-        minWidth: '100',
+        width: 60,
         align: 'center'
       },
       {
         title: '创建时间',
         dataIndex: 'createDate',
-        minWidth: '100',
+        width: 200,
         align: 'center'
       },
       {
         title: '员工姓名',
         dataIndex: 'name',
-        minWidth: '100',
+        width: 150,
         align: 'center'
       },
       {
         title: '手机号码',
         dataIndex: 'phone',
-        minWidth: '100',
+        width: 150,
         align: 'center'
       },
       {
         title: '角色',
         dataIndex: 'roleNames',
-        minWidth: '100',
+        width: 200,
         align: 'center'
       },
       {
         title: '启用状态',
         dataIndex: 'loginFlag',
-        minWidth: '100',
+        width: 150,
         align: 'center',
         scopedSlots: {
           customRender: 'loginFlag'
@@ -160,7 +160,7 @@ export default {
       {
         title: '操作',
         dataIndex: 'action',
-        minWidth: '100',
+        width: 200,
         align: 'center',
         scopedSlots: {
           customRender: 'action'

+ 1 - 2
src/views/SupervisionAuth/user/userModal.vue

@@ -14,7 +14,6 @@
             <a-form-item label="员工姓名" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder="请输入员工姓名30个字以内"
-                :maxLength="30"
                 id="userModal-name"
                 v-decorator="['formData.name', {
                   initialValue: formData.name,
@@ -59,7 +58,7 @@
             <a-form-item label="角色" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-select
                 id="userModal-roleNames"
-				allowClear
+                allowClear
                 v-decorator="[
                   'formData.roleNames',
                   {

+ 14 - 8
src/views/power/role/roleList.vue

@@ -54,7 +54,11 @@
           @change="changeFlagHandle(record)"
           v-hasPermission="'B_power_role_enable'"/>
       </span>
+      <!-- 角色描述 -->
+      <template slot="remarks" slot-scope="text, record">
+        <span :title="record.remarks" style="display: inline-block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">{{ record.remarks }}</span>
 
+      </template>
       <span slot="action" slot-scope="text, record">
         <template>
           <a class="action-button menu-text" @click="openMenuModal(record)" id="roleList-openMenuModal" v-hasPermission="'M_power_role_menu'">菜单权限</a>
@@ -94,36 +98,38 @@ export default {
         {
           title: '序号',
           dataIndex: 'no',
-          width: '40',
+          width: 60,
           align: 'center'
         },
         {
           title: '角色名称',
           dataIndex: 'name',
-          width: '100',
+          width: 150,
           align: 'center'
         },
         {
           title: '角色描述',
           dataIndex: 'remarks',
-          width: '100',
-          align: 'center'
+          width: 200,
+          ellipsis: true, // 内容超过宽度 自动出现省略号
+          align: 'center',
+          scopedSlots: { customRender: 'remarks' }
         },
         {
           title: '状态',
-          width: '100',
+          width: 150,
           align: 'center',
           scopedSlots: { customRender: 'status' }
         },
         {
           title: '创建时间',
           dataIndex: 'createDate',
-          width: '120',
+          width: 200,
           align: 'center'
         },
         {
           title: '操作',
-          width: '100',
+          width: 200,
           align: 'center',
           scopedSlots: { customRender: 'action' }
         }
@@ -218,7 +224,7 @@ export default {
         if (res.status == 200) {
           this.$message.success('修改成功')
         } else {
-          this.$message.error(res.message)
+          // this.$message.error(res.message)
           record.isEnable = !record.isEnable
         }
       })

+ 150 - 153
src/views/power/role/roleModal.vue

@@ -1,173 +1,170 @@
 <template>
-  <div>
-    <a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel" width="45%">
-      <a-form :form="form" @submit="handleSubmit">
-        <!-- 用户名称 -->
-        <a-form-item label="角色名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-          <a-input
-            placeholder="请输入角色名称30个字以内"
-			allowClear
-			id="roleModal-name"
-            :maxLength="30"
-            v-decorator="['formData.name', {
+	<div>
+		<a-modal class="modalBox" :title="titleText" v-model="isshow" @cancle="cancel" width="45%">
+			<a-form :form="form" @submit="handleSubmit">
+				<!-- 用户名称 -->
+				<a-form-item label="角色名称" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+					<a-input 
+					placeholder="请输入角色名称30个字以内"allowClear :maxLength="30" 
+					id="roleModal-name" v-decorator="['formData.name', {
               initialValue: formData.name,
-              rules: [{ required: true, message: '请输入角色名称30个字以内!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]"
-          />
-        </a-form-item>
-        <!-- 状态 -->
-        <a-form-item label="状态" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-          <a-radio-group
-            name="radioGroup"
-			id="roleModal-isEnable"
-            v-decorator="[
+              rules: [{ required: true, message: '请输入角色名称30个字以内!' },{pattern:'^[^<|>]{1,30}$',message:'请输入不含<或>的字符,最多30个字符'}] }]" />
+				</a-form-item>
+				<!-- 状态 -->
+				<a-form-item label="状态" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+					<a-radio-group name="radioGroup" id="roleModal-isEnable" v-decorator="[
               'formData.isEnable',
               {
                 initialValue: formData.isEnable,
                 rules: [{ required: true, message: '请选择状态!' }] },
-            ]"
-          >
-            <a-radio :value="1">启用</a-radio>
-            <a-radio :value="0">禁用</a-radio>
-          </a-radio-group>
-        </a-form-item>
-        <a-form-item label="角色描述" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
-          <a-textarea
-			id="roleModal-remarks"
-            v-decorator="[
+            ]">
+						<a-radio :value="1">启用</a-radio>
+						<a-radio :value="0">禁用</a-radio>
+					</a-radio-group>
+				</a-form-item>
+				<a-form-item label="角色描述" :label-col="{ span: 5 }" :wrapper-col="{ span: 14 }">
+					<a-textarea id="roleModal-remarks" v-decorator="[
               'formData.remarks',
               { initialValue: formData.remarks,
                 rules: [] },
             ]"
-            style="min-height: 60px;"
-            placeholder="输入内容512个字以内"
-            :maxLength="512"
-            autosize />
-        </a-form-item>
+					 style="min-height: 60px;" placeholder="输入内容512个字以内" :maxLength="512" autosize />
+				</a-form-item>
 
-        <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
-          <a-button type="primary" @click="handleSubmit()" id="roleModal-handleSubmit">
-            保存
-          </a-button>
-          <a-button :style="{ marginLeft: '8px' }" @click="handleCancel()" id="roleModal-handleCancel">
-            取消
-          </a-button>
-        </a-form-item>
-      </a-form>
+				<a-form-item :wrapper-col="{ span: 12, offset: 5 }">
+					<a-button type="primary" @click="handleSubmit()" id="roleModal-handleSubmit">
+						保存
+					</a-button>
+					<a-button :style="{ marginLeft: '8px' }" @click="handleCancel()" id="roleModal-handleCancel">
+						取消
+					</a-button>
+				</a-form-item>
+			</a-form>
 
-    </a-modal>
-  </div>
+		</a-modal>
+	</div>
 </template>
 
 <script>
-import { STable, VSelect } from '@/components'
-import { saveRolePower } from '@/api/power-role.js'
-export default {
-  name: 'RoleModal',
-  components: {
-    STable, VSelect
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    data: {
-      type: Object,
-      default: function () {
-        return {}
-      }
-    }
-  },
-  data () {
-    return {
-      titleText: '添加角色',
-      isshow: this.visible,
-      formLayout: 'horizontal',
-      form: this.$form.createForm(this, { name: 'roleModal' }),
-      formData: {
-        name: '',
-        isEnable: '', // 活动状态
-        remarks: ''
-      }
+	import {
+		STable,
+		VSelect
+	} from '@/components'
+	import {
+		saveRolePower
+	} from '@/api/power-role.js'
+	export default {
+		name: 'RoleModal',
+		components: {
+			STable,
+			VSelect
+		},
+		props: {
+			visible: {
+				type: Boolean,
+				default: false
+			},
+			data: {
+				type: Object,
+				default: function() {
+					return {}
+				}
+			}
+		},
+		data() {
+			return {
+				titleText: '添加角色',
+				isshow: this.visible,
+				formLayout: 'horizontal',
+				form: this.$form.createForm(this, {
+					name: 'roleModal'
+				}),
+				formData: {
+					name: '',
+					isEnable: '', // 活动状态
+					remarks: ''
+				}
 
-    }
-  },
-  methods: {
-    cancel (e) {
-      this.clear()
-      this.$emit('close')
-    },
-    // 保存提交
-    handleSubmit () {
-      const _this = this
-      this.form.validateFields((err, values) => {
-        if (!err) {
-          saveRolePower(Object.assign(this.formData, values.formData)).then(res => {
-            if (res.status == 200) {
-              this.$message.success(res.message ? res.message : '保存成功')
-              this.$emit('refresh')
-              setTimeout(function () {
-                _this.cancel()
-              }, 300)
-            } else {
-              // this.$message.error(res.message)
-            }
-          })
-        }
-      })
-    },
-    // 取消
-    handleCancel () {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '确定取消吗?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          _this.clear()
-          _this.cancel()
-        }
-      })
-    },
-    clear () {
-      this.form.resetFields()
-      delete this.formData.id
-      this.formData.name = ''
-      this.formData.isEnable = ''
-      this.formData.remarks = ''
-    }
+			}
+		},
+		methods: {
+			cancel(e) {
+				this.clear()
+				this.$emit('close')
+			},
+			// 保存提交
+			handleSubmit() {
+				const _this = this
+				this.form.validateFields((err, values) => {
+					if (!err) {
+						saveRolePower(Object.assign(this.formData, values.formData)).then(res => {
+							if (res.status == 200) {
+								this.$message.success(res.message ? res.message : '保存成功')
+								this.$emit('refresh')
+								setTimeout(function() {
+									_this.cancel()
+								}, 300)
+							} else {
+								// this.$message.error(res.message)
+							}
+						})
+					}
+				})
+			},
+			// 取消
+			handleCancel() {
+				const _this = this
+				this.$confirm({
+					title: '提示',
+					content: '确定取消吗?',
+					okText: '确定',
+					cancelText: '取消',
+					onOk() {
+						_this.clear()
+						_this.cancel()
+					}
+				})
+			},
+			clear() {
+				this.form.resetFields()
+				delete this.formData.id
+				this.formData.name = ''
+				this.formData.isEnable = ''
+				this.formData.remarks = ''
+			}
 
-  },
-  beforeCreate () {
-    this.form = this.$form.createForm(this, { name: 'roleModal' })
-  },
-  watch: {
-    visible (newValue, oldValue) {
-      this.isshow = newValue
-    },
-    isshow (newValue, oldValue) {
-      if (newValue) {
-        if (this.data.id) { // 编辑
-          this.titleText = '编辑角色'
-          this.formData = Object.assign({}, this.data)
-          delete this.formData.no
-          this.formData.isEnable = Number(this.formData.isEnable)
-        } else {
-          this.titleText = '添加角色'
-        }
-      } else {
-        this.cancel()
-      }
-    }
-  }
-}
+		},
+		beforeCreate() {
+			this.form = this.$form.createForm(this, {
+				name: 'roleModal'
+			})
+		},
+		watch: {
+			visible(newValue, oldValue) {
+				this.isshow = newValue
+			},
+			isshow(newValue, oldValue) {
+				if (newValue) {
+					if (this.data.id) { // 编辑
+						this.titleText = '编辑角色'
+						this.formData = Object.assign({}, this.data)
+						delete this.formData.no
+						this.formData.isEnable = Number(this.formData.isEnable)
+					} else {
+						this.titleText = '添加角色'
+					}
+				} else {
+					this.cancel()
+				}
+			}
+		}
+	}
 </script>
 
-<style >
-  .modalBox{
-  }
-  .ant-modal-footer {
-    display: none;
-  }
+<style>
+	.modalBox {}
+
+	.ant-modal-footer {
+		display: none;
+	}
 </style>

+ 7 - 7
src/views/power/user/userList.vue

@@ -100,43 +100,43 @@ export default {
         {
           title: '序号',
           dataIndex: 'no',
-          width: '40',
+          width: 60,
           align: 'center'
         },
         {
           title: '用户名称',
           dataIndex: 'name',
-          width: '100',
+          width: 150,
           align: 'center'
         },
         {
           title: '手机号码',
           dataIndex: 'phone',
-          width: '100',
+          width: 150,
           align: 'center'
         },
         {
           title: '角色',
-          width: '100',
+          width: 200,
           align: 'center',
           scopedSlots: { customRender: 'roleNames' }
         },
         {
           title: '状态',
-          width: '100',
+          width: 150,
           align: 'center',
           scopedSlots: { customRender: 'status' }
         },
         {
           title: '创建时间',
           dataIndex: 'createDate',
-          width: '120',
+          width: 200,
           align: 'center'
         },
         {
           title: '操作',
-          width: '100',
           align: 'center',
+          width: 200,
           scopedSlots: { customRender: 'action' }
         }
       ],

+ 2 - 3
src/views/power/user/userModal.vue

@@ -8,8 +8,7 @@
             <a-form-item label="用户名称" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder="请输入用户名称30个字以内"
-				allowClear
-                :maxLength="30"
+                allowClear
                 id="userModal-name"
                 v-decorator="['formData.name', {
                   initialValue: formData.name,
@@ -21,7 +20,7 @@
             <a-form-item label="手机号码" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
               <a-input
                 placeholder="请输入手机号码"
-				allowClear
+                allowClear
                 :maxLength="11"
                 id="userModal-phone"
                 v-decorator="['formData.phone', {