货品界面合作公司和主界面更新

master
Eterlaze 8 months ago
parent fda3f14340
commit 79b0f1eaf8

@ -19,7 +19,7 @@ export default {
components: {Aside, Header, Main, Footer}, components: {Aside, Header, Main, Footer},
mounted() { mounted() {
this.$message.success( this.$message.success(
'欢迎管理员 ' + this.$store.state.user.details.email,6, '欢迎 ' + this.$store.state.user.details.email,6,
); );
} }

@ -3,11 +3,11 @@
<div style="display: flex"> <div style="display: flex">
<a-button size="large" class="editable-add-btn" @click="commodityVisible = true"> <a-button size="large" class="editable-add-btn" @click="commodityVisible = true">
<a-icon type="plus"/> <a-icon type="plus"/>
新增商品 新增货物
</a-button> </a-button>
<a-input-search <a-input-search
placeholder="请输入商品名" placeholder="请输入货物名"
enter-button="搜索商品" enter-button="搜索货物"
style="width: 400px;margin-left: 20px" style="width: 400px;margin-left: 20px"
size="large" size="large"
@search="onSearch" @search="onSearch"
@ -18,24 +18,24 @@
</div> </div>
<a-table :loading="loading" :columns="columns" :data-source="data" :sortDirections="['ascend', 'descend']" rowKey="id"> <a-table :loading="loading" :columns="columns" :data-source="data" :sortDirections="['ascend', 'descend']" rowKey="id">
<a slot="name" slot-scope="text">{{ text }}</a> <a slot="name" slot-scope="text">{{ text }}</a>
<span slot="customTitle"><a-icon type="smile-o"/> 商品名称</span> <span slot="customTitle"><a-icon type="smile-o"/> 货物名称</span>
<span slot="action" slot-scope="text, record, index"> <span slot="action" slot-scope="text, record, index">
<a-button @click="handleUpdate(record)" type="link"><a-icon type="edit"/> Update</a-button> <a-button @click="handleUpdate(record)" type="link"><a-icon type="edit"/> 修改</a-button>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-button @click="handleDelete(record,index)" type="link"><a-icon type="delete"/> Delete</a-button> <a-button @click="handleDelete(record,index)" type="link"><a-icon type="delete"/> 删除</a-button>
</span> </span>
</a-table> </a-table>
<a-modal <a-modal
title="商品信息" title="货物信息"
:closable="false" :closable="false"
:visible="commodityVisible" :visible="commodityVisible"
> >
<a-form-model ref="ruleForm" :model="commodity"> <a-form-model ref="ruleForm" :model="commodity">
<a-form-model-item ref="name" label="商品名称" prop="name"> <a-form-model-item ref="name" label="货物名称" prop="name">
<a-input v-model="commodity.name"/> <a-input v-model="commodity.name"/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="品单价" prop="price"> <a-form-model-item label="品单价" prop="price">
<a-input-number id="input" v-model="commodity.price" :min="1"/> <a-input-number id="input" v-model="commodity.price" :min="1"/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="描述信息" prop="description"> <a-form-model-item label="描述信息" prop="description">
@ -44,10 +44,10 @@
</a-form-model> </a-form-model>
<template slot="footer"> <template slot="footer">
<a-button key="back" @click="commodityVisible = false"> <a-button key="back" @click="commodityVisible = false">
Return 取消
</a-button> </a-button>
<a-button key="submit" type="primary" :loading="modalLoading" @click="submitCommodity"> <a-button key="submit" type="primary" :loading="modalLoading" @click="submitCommodity">
Submit 提交
</a-button> </a-button>
</template> </template>
</a-modal> </a-modal>
@ -88,7 +88,7 @@ const columns = [
sortField: 'createAt' sortField: 'createAt'
}, },
{ {
title: '品单价', title: '品单价',
key: 'price', key: 'price',
dataIndex: 'price', dataIndex: 'price',
scopedSlots: {customRender: 'tags'}, scopedSlots: {customRender: 'tags'},
@ -107,7 +107,7 @@ export default {
return { return {
commodity: { commodity: {
name: '', name: '',
description: '商品简介', description: '货物简介',
count: 0, count: 0,
price: 9.99, price: 9.99,
}, },
@ -138,7 +138,7 @@ export default {
}, 600) }, 600)
} else { } else {
setTimeout(() => { setTimeout(() => {
this.$message.success("搜索到" + res.data.length + "个商品") this.$message.success("搜索到" + res.data.length + "个货物")
this.loading = false this.loading = false
this.data = res.data this.data = res.data
}, 600) }, 600)
@ -165,7 +165,7 @@ export default {
setTimeout(() => { setTimeout(() => {
this.modalLoading = false this.modalLoading = false
this.commodityVisible = false this.commodityVisible = false
this.$message.success('商品信息提交成功'); this.$message.success('货物信息提交成功');
this.loadTableData() this.loadTableData()
}, 600) }, 600)
} else { } else {
@ -178,7 +178,7 @@ export default {
handleDelete(r, index) { handleDelete(r, index) {
DeleteCommodityById(r.id).then((res) => { DeleteCommodityById(r.id).then((res) => {
if (res.status) this.$message.success('商品信息删除成功'); if (res.status) this.$message.success('货物信息删除成功');
this.loadTableData() this.loadTableData()
}) })
console.log(index) console.log(index)

@ -2,7 +2,7 @@
<div> <div>
<a-input-search <a-input-search
placeholder="请输入公司名" placeholder="请输入公司名"
enter-button="搜索来往公司" enter-button="搜索合作公司"
style="width: 400px;margin-bottom: 20px" style="width: 400px;margin-bottom: 20px"
size="large" size="large"
@search="onSearch" @search="onSearch"

Loading…
Cancel
Save