Commit 56fbbc0d by cwq0219

路由传参

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