提交 e3e42d99 编写于 作者: chendeli's avatar chendeli

接口联调

上级 ad17dc8a
import fetch from '../fetch';
import { getBaseUrl } from '@/utils/index'
let headers = {
'Content-Type': 'application/json;charset=UTF-8',
token: localStorage.getItem('storageToken'),
};
export const getGoodsList = (params) => {
return fetch({
headers,
url: getBaseUrl(`store/goods/query`),
method: 'post',
data: params,
description: '商品列表查询',
})
};
//
export const batchOnOff = (params) => {
return fetch({
headers,
url: getBaseUrl(`store/goods/onoff/sale`),
method: 'post',
data: params,
description: '批量上下架',
})
};
export const updateGoods = (params) => {
return fetch({
headers,
url: getBaseUrl(`store/goods/upsert`),
method: 'post',
data: params,
description: '创建/更新商品',
})
};
///dosage/all
export const dosageAll = (parm) => {
return fetch({
headers,
url: getBaseUrl(`store/dosage/all`),
method: 'get',
// params: params,
description: '剂型',
})
};
export const getDeparts = (parm) => {
return fetch({
headers,
url: getBaseUrl(`api-ws/departments/category`),
method: 'get',
// params: params,
description: '科室',
})
};
//`basic-data/constants?typeCode=P128`
export const updateStock = (parm) => {
return fetch({
headers,
url: getBaseUrl(`trade/order/admin/query/${orderId}`),
method: 'get',
// params: params,
description: '增加/减少库存',
})
};
此差异已折叠。
...@@ -7,22 +7,22 @@ ...@@ -7,22 +7,22 @@
<el-row :gutter="30" type="flex" style="margin-top: 10px"> <el-row :gutter="30" type="flex" style="margin-top: 10px">
<el-col :span="18"> <el-col :span="18">
<el-form-item label="商品名称"> <el-form-item label="商品名称">
<el-input v-model="searchForm.name" size="small" placeholder="请输入商品名称"></el-input> <el-input v-model="searchForm.goodsName" size="small" placeholder="请输入商品名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="商品ID"> <el-form-item label="商品ID">
<el-input v-model="searchForm.id" size="small" placeholder="请输入商品ID"></el-input> <el-input v-model="searchForm.id" size="small" placeholder="请输入商品ID"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="商品类型"> <el-form-item label="商品类型">
<el-select <el-select
v-model="searchForm.type" v-model="searchForm.goodsType"
placeholder="请选择商品类型" placeholder="请选择商品类型"
size="small" size="small"
clearable> clearable>
<el-option <el-option
v-for="(item,index) in typeList" v-for="(item,index) in goodsTypes"
:key="index" :key="index"
:label="item.label" :label="item.categoryName"
:value="item.value" :value="item.id"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
</el-row> </el-row>
<el-row :gutter="30" type="flex" style="margin-top: 10px"> <el-row :gutter="30" type="flex" style="margin-top: 10px">
<el-col :span="18"> <el-col :span="18">
<el-button type="primary" size="small" @click="batchOpt(1)">批量上架</el-button> <el-button type="primary" size="small" @click="batchOpt('on')">批量上架</el-button>
<el-button type="primary" size="small" @click="batchOpt(2)">批量下架</el-button> <el-button type="primary" size="small" @click="batchOpt('off')">批量下架</el-button>
</el-col> </el-col>
<el-col :span="6" style="text-align: right"> <el-col :span="6" style="text-align: right">
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</el-row> </el-row>
</el-form> </el-form>
<el-table :data="tableData" class="item-table" style="width: 100%;margin-top: 10px;" @selection-change="handleSelectionChange"> <el-table ref="multipleTable" :data="tableData" class="item-table" style="width: 100%;margin-top: 10px;" @selection-change="handleSelectionChange">
<el-table-column <el-table-column
type="selection" type="selection"
fixed fixed
...@@ -53,23 +53,23 @@ ...@@ -53,23 +53,23 @@
</el-table-column> </el-table-column>
<el-table-column prop="id" label="商品ID" width="120" align="center"></el-table-column> <el-table-column prop="id" label="商品ID" width="120" align="center"></el-table-column>
<el-table-column prop="name" label="商品名称" min-width="140" align="center"></el-table-column> <el-table-column prop="name" label="商品名称" min-width="140" align="center"></el-table-column>
<el-table-column prop="type" label="商品类型" min-width="100" align="center"> <el-table-column prop="type" label="商品类型" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.type | dynamicFlagStatus }}</span> <span>{{ scope.row.type | dynamicFlagStatus }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" label="商品状态" min-width="100" align="center"> <el-table-column prop="status" label="商品状态" width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.status | rangeStatus }}</span> <span>{{ scope.row.status | rangeStatus }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="num" label="销量" min-width="120" align="center"> <el-table-column prop="num" label="销量" width="120" align="center">
111 111
</el-table-column> </el-table-column>
<el-table-column prop="num" label="规格" min-width="120" align="center"> <el-table-column prop="num" label="规格" width="120" align="center">
111 111
</el-table-column> </el-table-column>
<el-table-column prop="num" label="价格" min-width="120" align="center"> <el-table-column prop="num" label="价格" width="120" align="center">
111 111
</el-table-column> </el-table-column>
<el-table-column prop="createdTime" label="发布时间" width="150" align="center"> <el-table-column prop="createdTime" label="发布时间" width="150" align="center">
...@@ -144,6 +144,7 @@ ...@@ -144,6 +144,7 @@
import { openLoading, closeLoading } from "../../utils/utils"; import { openLoading, closeLoading } from "../../utils/utils";
import BreadCrumb from "@/components/breadcrumb.vue"; import BreadCrumb from "@/components/breadcrumb.vue";
import { getRangeList,updateRangeStatus} from "../../utils/yqrange/yqrangeApi"; import { getRangeList,updateRangeStatus} from "../../utils/yqrange/yqrangeApi";
import { getGoodsList,batchOnOff} from '@/utils/goods';
export default { export default {
components: { components: {
BreadCrumb BreadCrumb
...@@ -155,17 +156,27 @@ ...@@ -155,17 +156,27 @@
showNewFlag: false, showNewFlag: false,
batchDialog:false, batchDialog:false,
searchForm: { searchForm: {
name: '', goodsIdList:[],
id: '', goodsName :'',
type: '', goodsType :0,
pageNo: 1, pageNo:1,
pageSize: 10, pageSize: 10,
},
selectList:[],
batchParm:{
batchUpdateSaleStatusReq: {
goodsIdList: [],
userId: 0
},
onOff: ""
}, },
fileList:[], fileList:[],
totalRows: 0, totalRows: 0,
tableData: [ tableData: [
{} {}
], ],
goodsTypes:[],
typeList: [{ typeList: [{
label: '药品', label: '药品',
value: '1', value: '1',
...@@ -179,20 +190,49 @@ ...@@ -179,20 +190,49 @@
} }
}, },
created() { created() {
// this.initPrivilege(); this.getLists()
// this.searchList(); this.getLever()
}, },
methods: { methods: {
handlePreview(){}, handlePreview(){},
handleRemove(){}, handleRemove(){},
beforeRemove(){}, beforeRemove(){},
handleSelectionChange(){ handleSelectionChange(val){
console.log(val)
this.selectList = val
},
getLever(id=0){
this.GET("store/category/"+id).then(res => {
console.log(res)
this.goodsTypes = res.data
});
},
getLists(){
getGoodsList(this.searchForm).then((res)=>{
})
}, },
//批量 上下架操作 //批量 上下架操作
batchOpt(type){ batchOpt(type){
if(type == 3){//批量导入 if(type == 3){//批量导入
this.batchDialog = true this.batchDialog = true
}else{
if(this.selectList.length == 0){
return this.$message({
message: '请选择商品',
type: 'warning'
});
}
this.batchParm.onOff = type
this.batchParm.batchUpdateSaleStatusReq.goodsIdList =[1] || this.selectList
batchOnOff(this.batchParm).then((res)=>{
if(res.code == '000000'){
this.selectList = []
this.$refs.multipleTable.clearSelection();
this.getLists()
}
})
} }
}, },
edit(row){ edit(row){
...@@ -268,15 +308,19 @@ ...@@ -268,15 +308,19 @@
searchList() { searchList() {
openLoading(this); openLoading(this);
let params = this.searchForm; let params = this.searchForm;
this.getLists()
}, },
resetForm() { resetForm() {
this.searchForm = { this.searchForm = {
name: '', goodsIdList:[],
id: '', goodsName:'',
type: '' goodsType:'',
pageNo:1,
pageSize: 10,
}; };
this.searchList(); this.getLists();
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册