Parcourir la source

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
商品上架修改

1004749546@qq.com il y a 4 ans
Parent
commit
30c7685238
1 fichiers modifiés avec 190 ajouts et 193 suppressions
  1. 190 193
      src/views/shop/goodsShelves.vue

+ 190 - 193
src/views/shop/goodsShelves.vue

@@ -1,201 +1,198 @@
 <template>
-  <a-card :bordered="false">
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
-        <a-row :gutter="48">
-          <a-col :span="6">
-            <a-form-item label="企业名称">
-              <a-input allowClear v-model.trim="queryParam.name" placeholder="请输入企业名称" />
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-form-item label="负责人手机">
-              <a-input allowClear v-model.trim="queryParam.contactPhone" placeholder="请输入申请人手机" />
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-form-item label="启用状态">
-              <v-select ref="status" allowClear placeholder="状态" v-model="queryParam.status" code="ENABLE_FLAG"></v-select>
-            </a-form-item>
-          </a-col>
-          <a-col :span="6">
-            <a-button type="primary" style="margin-right: 10px;" @click="$refs.table.refresh(true)">查询</a-button>
-            <a-button type="" @click="reset">重置</a-button>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-    <a-divider />
-    <div class="table-operator">
-      <a-button type="primary" icon="plus" @click="openModal">新增</a-button>
-    </div>
-    <s-table
-      ref="table"
-      size="default"
-      :rowKey="(record) => record.id"
-      :columns="columns"
-      :data="loadData"
-      bordered>
-      <!-- 操作 -->
-      <template slot="action" slot-scope="text, record">
-        <a-icon title="编辑" type="edit" class="actionBtn icon-blues" @click="openModal(record)" />
-        <!-- <a-icon title="删除" type="delete" class="actionBtn icon-red" v-if="record.status == '0'" @click="delect(record)" /> -->
-      </template>
-      <!-- 启用禁用 -->
-      <template slot="enable" slot-scope="text, row">
-        <span :class="[text==1 ? 'green' : 'red']">{{ text==1 ? '已启用' : '已禁用' }}</span>
-      </template>
-    </s-table>
-  </a-card>
+	<a-card :bordered="false">
+		<a-row type="flex">
+			<a-col span="4">
+				<a-menu mode="inline" @click="handleClick">
+					<a-menu-item v-for="item in menuList" :key="item.id" :title="item.name">
+						{{item.name}}
+					</a-menu-item>
+				</a-menu>
+			</a-col>
+			<a-col span="1"></a-col>
+			<!-- <a-divider style="{height: 100%;}" type="vertical" /> -->
+			<a-col span="19">
+				<div class="table-operator">
+					<a-button type="primary" @click="openModal">选择商品</a-button>
+				</div>
+				<s-table ref="table" size="default" :rowKey="(record) => record.id" :columns="columns" :data="loadData" bordered>
+					<!-- 操作 -->
+					<template slot="action" slot-scope="text, record">
+						<a-icon title="编辑" type="edit" class="actionBtn icon-blues" @click="openModal(record)" />
+						<!-- <a-icon title="删除" type="delete" class="actionBtn icon-red" v-if="record.status == '0'" @click="delect(record)" /> -->
+					</template>
+					<!-- 启用禁用 -->
+					<template slot="enable" slot-scope="text, row">
+						<span :class="[text==1 ? 'green' : 'red']">{{ text==1 ? '已启用' : '已禁用' }}</span>
+					</template>
+				</s-table>
+			</a-col>
+		</a-row>
+	</a-card>
 
 </template>
 
 <script>
-import {
-  STable,
-  VSelect
-} from '@/components'
-import {
-  getTenantsList,
-  tenantsDelete
-} from '@/api/tenants.js'
-import moment from 'moment'
-export default {
-  name: 'GoodsList',
-  components: {
-    STable,
-    VSelect
-  },
-  data () {
-    return {
-      moment,
-      pageNo: 1,
-      pageSize: 10,
-      openTenantsModal: false, // 打开授权弹窗
-      itemId: '', // 要编辑的租户id
-      // 查询参数
-      queryParam: {
-        name: '',
-        contactPhone: '',
-        status: '' // 状态
-      },
-      // 表头
-      columns: [{
-        title: '序号',
-        dataIndex: 'no',
-        width: '40',
-        align: 'center'
-      },
-      {
-        title: '创建时间',
-        dataIndex: 'createDate',
-        width: '200',
-        align: 'center'
-      },
-      {
-        title: '企业名称',
-        dataIndex: 'name',
-        align: 'center'
-      },
-      {
-        title: '负责人名称',
-        dataIndex: 'contactName',
-        width: '120',
-        align: 'center',
-        customRender: (text) => {
-		  return text || '--'
-        }
-      },
-      {
-        title: '负责人手机',
-        width: '120',
-        align: 'center',
-        dataIndex: 'contactPhone'
-      },
-      {
-        title: '有效期至',
-        width: '200',
-        align: 'center',
-        dataIndex: 'expireDate'
-      },
-      {
-        title: '启用状态',
-        width: '200',
-        align: 'center',
-        dataIndex: 'status',
-        scopedSlots: {
-          customRender: 'enable'
-        }
-      },
-      {
-        title: '操作',
-        width: '200',
-        align: 'center',
-        scopedSlots: {
-          customRender: 'action'
-        }
-      }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
-          console.log(res, 'rrrrrrr')
-          if (res.status == 200) {
-            const no = (res.data.pageNo - 1) * res.data.pageSize
-            for (let i = 0; i < res.data.list.length; i++) {
-              const _item = res.data.list[i]
-              _item.no = no + i + 1
-              _item.status = _item.status + '' === '1'
-            }
-            return res.data
-          }
-        })
-      }
-    }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {
-      vm.reset()
-    })
-  },
-  methods: {
-    // 打开新增/编辑 弹窗
-    openModal (row) {
-      this.itemId = row ? row.id : ''
-      this.openTenantsModal = true
-    },
-    // 删除
-    delect (row) {
-      const _this = this
-      this.$confirm({
-        title: '警告',
-        centered: true,
-        content: '删除后原数据不可恢复,是否删除?',
-        okText: '确定',
-        cancelText: '取消',
-        onOk () {
-          tenantsDelete({
-          	id: row.id
-          }).then(res => {
-          	if (res.status == 200) {
-          		_this.$message.success('res.message')
-          		_this.$refs.table.refresh()
-          	}
-          })
-        }
-      })
-    },
-    // 重置
-    reset () {
-      this.queryParam = {
-        name: '',
-        contactPhone: '',
-        status: '' // 状态
-      }
-      this.$refs.table.refresh(true)
-    }
-  }
-}
+	import {
+		STable,
+		VSelect
+	} from '@/components'
+	import {
+		getTenantsList,
+		tenantsDelete
+	} from '@/api/tenants.js'
+	import moment from 'moment'
+	export default {
+		name: 'GoodsList',
+		components: {
+			STable,
+			VSelect
+		},
+		data() {
+			return {
+				moment,
+				pageNo: 1,
+				pageSize: 10,
+				menuList: [{
+						id: 1,
+						name: '人气零食'
+					},
+					{
+						id: 12,
+						name: '居家生活'
+					},
+					{
+						id: 13,
+						name: '个护清洁'
+					}
+				],
+				openTenantsModal: false, // 打开授权弹窗
+				itemId: '', // 要编辑的租户id
+				// 查询参数
+				queryParam: {
+					name: '',
+					contactPhone: '',
+					status: '' // 状态
+				},
+				// 表头
+				columns: [{
+						title: '序号',
+						dataIndex: 'no',
+						width: '40',
+						align: 'center'
+					},
+					{
+						title: '创建时间',
+						dataIndex: 'createDate',
+						width: '200',
+						align: 'center'
+					},
+					{
+						title: '企业名称',
+						dataIndex: 'name',
+						align: 'center'
+					},
+					{
+						title: '负责人名称',
+						dataIndex: 'contactName',
+						width: '120',
+						align: 'center',
+						customRender: (text) => {
+							return text || '--'
+						}
+					},
+					{
+						title: '负责人手机',
+						width: '120',
+						align: 'center',
+						dataIndex: 'contactPhone'
+					},
+					{
+						title: '有效期至',
+						width: '200',
+						align: 'center',
+						dataIndex: 'expireDate'
+					},
+					{
+						title: '启用状态',
+						width: '200',
+						align: 'center',
+						dataIndex: 'status',
+						scopedSlots: {
+							customRender: 'enable'
+						}
+					},
+					{
+						title: '操作',
+						width: '200',
+						align: 'center',
+						scopedSlots: {
+							customRender: 'action'
+						}
+					}
+				],
+				// 加载数据方法 必须为 Promise 对象
+				loadData: parameter => {
+					return getTenantsList(Object.assign(parameter, this.queryParam)).then(res => {
+						console.log(res, 'rrrrrrr')
+						if (res.status == 200) {
+							const no = (res.data.pageNo - 1) * res.data.pageSize
+							for (let i = 0; i < res.data.list.length; i++) {
+								const _item = res.data.list[i]
+								_item.no = no + i + 1
+								_item.status = _item.status + '' === '1'
+							}
+							return res.data
+						}
+					})
+				}
+			}
+		},
+		beforeRouteEnter(to, from, next) {
+			next(vm => {
+				vm.reset()
+			})
+		},
+		methods: {
+			handleClick() {
+
+			},
+			// 打开新增/编辑 弹窗
+			openModal(row) {
+				this.itemId = row ? row.id : ''
+				this.openTenantsModal = true
+			},
+			// 删除
+			delect(row) {
+				const _this = this
+				this.$confirm({
+					title: '警告',
+					centered: true,
+					content: '删除后原数据不可恢复,是否删除?',
+					okText: '确定',
+					cancelText: '取消',
+					onOk() {
+						tenantsDelete({
+							id: row.id
+						}).then(res => {
+							if (res.status == 200) {
+								_this.$message.success('res.message')
+								_this.$refs.table.refresh()
+							}
+						})
+					}
+				})
+			},
+			// 重置
+			reset() {
+				this.queryParam = {
+					name: '',
+					contactPhone: '',
+					status: '' // 状态
+				}
+				this.$refs.table.refresh(true)
+			}
+		}
+	}
 </script>
 <style>
 	.table-page-search-wrapper,