Commit 56fbbc0d by cwq0219

路由传参

1 parent 26dab281
...@@ -153,7 +153,7 @@ export default { ...@@ -153,7 +153,7 @@ export default {
computed: {}, computed: {},
mounted() { mounted() {
this.routeInfo = this.$route.query this.routeInfo = this.$route.params
this.title = this.titleObj[this.routeInfo.addOrEdit] this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : '' this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
this.editFormData[0].isDisabled = this.routeInfo.addOrEdit == 3 this.editFormData[0].isDisabled = this.routeInfo.addOrEdit == 3
......
...@@ -140,7 +140,7 @@ export default { ...@@ -140,7 +140,7 @@ export default {
computed: {}, computed: {},
mounted() { mounted() {
this.routeInfo = this.$route.query this.routeInfo = this.$route.params
this.title = this.titleObj[this.routeInfo.addOrEdit] this.title = this.titleObj[this.routeInfo.addOrEdit]
this.routeInfo.addOrEdit != 1 ? this.getInfo() : '' this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
this.editFormData[0].isDisabled = this.routeInfo.addOrEdit == 3 this.editFormData[0].isDisabled = this.routeInfo.addOrEdit == 3
...@@ -216,7 +216,7 @@ export default { ...@@ -216,7 +216,7 @@ export default {
goodsId: item.id, goodsId: item.id,
merchantId: item.merchantId, merchantId: item.merchantId,
merchantName: item.merchantName, merchantName: item.merchantName,
livePrice: item.livePrice * 100 livePrice: (item.livePrice * 100).toFixed(0)
}) })
}) })
console.log(params) console.log(params)
......
...@@ -109,21 +109,23 @@ export default { ...@@ -109,21 +109,23 @@ export default {
handleEdit(addOrEdit, row) { handleEdit(addOrEdit, row) {
this.$router.push({ this.$router.push({
// name: 'editProduct', // name: 'editProduct',
path: '/cmmodityLibrary/editProduct', // path: '/cmmodityLibrary/editProduct',
query: { name: 'ServicesCmmodityLibraryEditProduct',
params: {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
id: row ? row.id : '' id: row ? row.id : -1
} }
}) })
}, },
// 1-新增;2-编辑;3-查看 // 1-新增;2-编辑;3-查看;4-修改价格
handleEditGroup(addOrEdit, row) { handleEditGroup(addOrEdit, row) {
this.$router.push({ this.$router.push({
// name: 'editProductGroup', // name: 'editProductGroup',
path: '/cmmodityLibrary/editProductGroup', // path: '/cmmodityLibrary/editProductGroup',
query: { name: 'ServicesCmmodityLibraryEditProductGroup',
params: {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
id: row ? row.id : '' id: row ? row.id : -1
} }
}) })
}, },
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<!-- 表格区域 end --> <!-- 表格区域 end -->
<!-- 修改价格弹框 开始 --> <!-- 修改价格弹框 开始 -->
<glsx-dialog title="修改价格" width="620px" :isVisible="showPriceDialog" @closeDialog="closePriceDialog" @confirmDialog="closePriceDialog"> <!-- <glsx-dialog title="修改价格" width="620px" :isVisible="showPriceDialog" @closeDialog="closePriceDialog" @confirmDialog="closePriceDialog">
<el-form ref="priceForm" :rules="formRules" :model="form" label-width="120px"> <el-form ref="priceForm" :rules="formRules" :model="form" label-width="120px">
<el-form-item label="商品价格:" prop="price"> <el-form-item label="商品价格:" prop="price">
<el-input v-model="form.price" maxlength="8" style="width:400px" /> <el-input v-model="form.price" maxlength="8" style="width:400px" />
...@@ -35,18 +35,18 @@ ...@@ -35,18 +35,18 @@
<el-button type="primary" @click="resetPrice()">提交</el-button> <el-button type="primary" @click="resetPrice()">提交</el-button>
<el-button @click="showPriceDialog = false">取消</el-button> <el-button @click="showPriceDialog = false">取消</el-button>
</div> </div>
</glsx-dialog> </glsx-dialog> -->
<!-- 修改价格弹框 end --> <!-- 修改价格弹框 end -->
</div> </div>
</template> </template>
<script> <script>
import { getWarehousListApi, deleteGoodApi } from '@/api/modules/cmmodityLibrary' import { getWarehousListApi, deleteGoodApi } from '@/api/modules/cmmodityLibrary'
import glsxDialog from '@/components/glsx-dialog' // import glsxDialog from '@/components/glsx-dialog'
export default { export default {
components: { // components: {
glsxDialog // glsxDialog
}, // },
data() { data() {
return { return {
size: 'small', size: 'small',
...@@ -86,29 +86,29 @@ export default { ...@@ -86,29 +86,29 @@ export default {
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableData: [ // tableData: [
{ // {
id: 1, // id: 1,
pic: 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF', // pic: 'https://t7.baidu.com/it/u=4162611394,4275913936&fm=193&f=GIF',
title: '商品标题', // title: '商品标题',
price: 999, // price: 999,
merchant: 'xxx' // merchant: 'xxx'
} // }
], // ],
pageTotal: 0, // pageTotal: 0,
userInfo: {}, // userInfo: {},
currentPage: 1, // currentPage: 1,
pageSizes: [10, 20, 30, 40], // pageSizes: [10, 20, 30, 40],
pageSize: 10, // pageSize: 10,
tdWidth: 170, // tdWidth: 170,
DATEFORMATE: (str, type) => { // DATEFORMATE: (str, type) => {
return this.$Util.dateFormate(str, type) // return this.$Util.dateFormate(str, type)
}, // }
showPriceDialog: false, // showPriceDialog: false,
form: {}, // form: {},
formRules: { // formRules: {
price: [{ required: true, message: '请输入价格', trigger: 'blur' }] // price: [{ required: true, message: '请输入价格', trigger: 'blur' }]
} // }
} }
}, },
created() {}, created() {},
...@@ -146,14 +146,23 @@ export default { ...@@ -146,14 +146,23 @@ export default {
} }
}) })
}, },
// 1-新增;2-编辑;3-查看;4-修改价格
handleEdit: function() { handleEdit: function(row) {
this.showPriceDialog = true // this.showPriceDialog = true
this.$router.push({
// name: 'editProductGroup',
// path: '/cmmodityLibrary/editProductGroup',
name: 'ServicesCmmodityLibraryEditProductGroup',
params: {
addOrEdit: 4,
id: row ? row.id : -1
}
})
}, },
closePriceDialog: function() { // closePriceDialog: function() {
this.showPriceDialog = false // this.showPriceDialog = false
} // }
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!