Commit 4f2a01c4 by fuqiang

Merge remote-tracking branch 'origin/master'

parents 359897d0 a1037b82
import request from '@/router/axios'
export function getMerchantByAccount(parameter) {
return request({
url: '/admin/merchantMallGoods/getMerchantByAccount',
......
......@@ -72,7 +72,7 @@ export const tableOption = {
"prop": "state",
"search": true,
"showColumn":false,
dicUrl: "/general/mallGoods/getStateOptions",
dicUrl: "/admin/merchantMallGoods/getStateOptions",
},
{
"type": "input",
......@@ -85,7 +85,7 @@ export const tableOption = {
"prop": "auditState",
"search": true,
"showColumn":false,
dicUrl: "/general/mallGoods/getAuditStateOptions",
dicUrl: "/admin/merchantMallGoods/getAuditStateOptions",
},
{
"type": "input",
......
......@@ -32,7 +32,7 @@ export const tableOption = {
"label": "状态",
"prop": "state",
"search": true,
"dicUrl": "/general/mallOrder/getOrderStateOptions",
"dicUrl": "/admin/merchantMallOrder/getOrderStateOptions",
},
{
"type": "input",
......
......@@ -33,7 +33,7 @@ export function getGoodsDetails(query) {
export function addOrEditGoods(data) {
return request({
url: '/admin/mallGoodsSpec/addOrEditGoods',
url: '/admin/merchantMallGoods/addOrEditGoods',
method: 'post',
data
})
......
......@@ -192,6 +192,8 @@
<script>
import {getMerchantByAccount} from "@/api/mall/merchantMallgoods";
let DBG = true
import {
ZmMixin
......@@ -206,6 +208,7 @@
getGoodsDetails,
addOrEditGoods
} from './goods_api.js'
import {fetchList} from "@/api/mall/merchantMallorder";
export default {
mixins: [ZmMixin],
components: {
......@@ -681,30 +684,25 @@
doSubmit: function () {
let id = this.id
if(JSON.stringify(id)==='{}'||id===undefined){
// 根据当前登陆用户id 获取商家id
let userId = JSON.parse(sessionStorage.getItem("linshenxs-userInfo")).content.userId
this.$axios.get("/admin/merchantMallGoods/getMerchantByUserId",{
params:{id:userId},
}).then(response => {
// 1.获取当前登陆用户ID
let userInfo= JSON.parse(sessionStorage.getItem("linshenxs-userInfo"))
let account=userInfo.content.username
getMerchantByAccount(
{account: account}
).then(response => {
this.form.merchantId=response.data.data.id
const {data: res} = this.$http.post(
"/general/mallGoods/addOrEditGoods",
this.form).then(r => {
this.loading = false
this.$emit('success')
addOrEditGoods(this.form).then(data => {
this.$message.success('添加成功')
// this.$router.go(-1)
}).catch(e => {
this.loading = false
})
}, error => {
console.log('错误', error.message)
done()
}).catch(() => {
});
}).catch(() => {
this.tableLoading = false
})
}else{
addOrEditGoods(this.form).then(data => {
this.$message.success('修改成功')
done()
// this.$router.go(-1)
}).catch(() => {
});
}
......
......@@ -270,9 +270,7 @@
fetchList(Object.assign({
current: page.currentPage,
size: page.pageSize,
// merchantId:response.data.data.id
merchantId:47
merchantId:response.data.data.id
}, params, this.searchForm)).then(response => {
this.tableData = response.data.data.records
this.page.total = response.data.data.total
......@@ -283,21 +281,6 @@
}).catch(() => {
this.tableLoading = false
})
//
// this.tableLoading = true
// if(page.currentPage=1){
// page.currentPage=0
// }
// fetchList(Object.assign({
// current: page.currentPage,
// size: page.pageSize
// }, params, this.searchForm )).then(response => {
// this.tableData = response.data.data.records
// this.page.total = response.data.data.total
// this.tableLoading = false
// }).catch(() => {
// this.tableLoading=false
// })
},
// 删除
handleDel: function (row, index) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment