Merge branch 'dev' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into dwb
This commit is contained in:
commit
dbe8167822
|
|
@ -54,7 +54,12 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
//返回现有库存数量
|
//返回现有库存数量
|
||||||
returnNowHasNumbr(row) {
|
returnNowHasNumbr(row) {
|
||||||
return row.stockNumber * 1 + row.number * 1 + row.unitName
|
const subType=this.tableData.detail.subType||1
|
||||||
|
console.log(row)
|
||||||
|
if(!row.hasOwnProperty('number')){
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
return row.stockNumber * 1 + row.number * subType + row.unitName
|
||||||
},
|
},
|
||||||
show(row) {
|
show(row) {
|
||||||
this.dialogVisible = true
|
this.dialogVisible = true
|
||||||
|
|
@ -67,6 +72,7 @@ export default {
|
||||||
const res = await tbProductStockOperateDetail(id)
|
const res = await tbProductStockOperateDetail(id)
|
||||||
this.tableData.loading = false
|
this.tableData.loading = false
|
||||||
this.tableData.detail = res
|
this.tableData.detail = res
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -177,64 +177,62 @@
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
style="margin-bottom: 10px"
|
style="margin-bottom: 10px"
|
||||||
v-for="(haocai, index) in scope.row.haocais"
|
v-for="(haocai, index) in scope.row.haocais"
|
||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<el-input
|
<el-input
|
||||||
disabled
|
disabled
|
||||||
v-model="haocai.conName"
|
v-model="haocai.conName"
|
||||||
style="width: 130px"
|
style="width: 130px"
|
||||||
placeholder="请选择耗材信息"
|
placeholder="请选择耗材信息"
|
||||||
|
></el-input>
|
||||||
></el-input>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="单位耗材值" width="180">
|
<el-table-column label="单位耗材值" width="180">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
style="margin-bottom: 10px; display: flex"
|
style="margin-bottom: 10px; display: flex"
|
||||||
v-for="(haocai, haocaiIndex) in scope.row.haocais"
|
v-for="(haocai, haocaiIndex) in scope.row.haocais"
|
||||||
:key="haocaiIndex"
|
:key="haocaiIndex"
|
||||||
>
|
>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="haocai.surplusStock"
|
v-model="haocai.surplusStock"
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="单位耗材值"
|
placeholder="单位耗材值"
|
||||||
@input="handleKeyUp($event, haocaiIndex)"
|
@input="handleKeyUp($event, haocaiIndex)"
|
||||||
></el-input>
|
></el-input>
|
||||||
<div style="margin-left: 10px">
|
<div style="margin-left: 10px">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.haocais.length > 1"
|
v-if="scope.row.haocais.length > 1"
|
||||||
type="danger"
|
type="danger"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="delGoodsHaocai(scope.row.haocais, haocaiIndex)"
|
@click="
|
||||||
icon="el-icon-delete"
|
delGoodsHaocai(scope.row.haocais, haocaiIndex)
|
||||||
circle
|
"
|
||||||
></el-button>
|
icon="el-icon-delete"
|
||||||
|
circle
|
||||||
|
></el-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作">
|
<el-table-column label="操作">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="selecthaocai(scope.row)"
|
@click="selecthaocai(scope.row)"
|
||||||
>去选择耗材信息</el-button
|
>去选择耗材信息</el-button
|
||||||
>
|
>
|
||||||
<!-- <el-button type="primary" @click="addGoodsHaocai(scope.row.haocais, haocaiIndex)">
|
<!-- <el-button type="primary" @click="addGoodsHaocai(scope.row.haocais, haocaiIndex)">
|
||||||
增加耗材
|
增加耗材
|
||||||
</el-button> -->
|
</el-button> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column label="操作">
|
<!-- <el-table-column label="操作">
|
||||||
|
|
@ -325,7 +323,20 @@
|
||||||
@close="resetHaocaiTable"
|
@close="resetHaocaiTable"
|
||||||
>
|
>
|
||||||
<div class="head-container flex">
|
<div class="head-container flex">
|
||||||
<el-input
|
<el-select
|
||||||
|
v-model="queryinformation.conTypeId"
|
||||||
|
placeholder="请选择耗材分类"
|
||||||
|
style="width: 100%; margin-right: 10px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
:label="item.conTypeName"
|
||||||
|
:value="item.id"
|
||||||
|
v-for="item in consTypeList"
|
||||||
|
:key="item.conTypeId"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
<!-- <el-input
|
||||||
v-model="queryinformation.conTypeId"
|
v-model="queryinformation.conTypeId"
|
||||||
size="small"
|
size="small"
|
||||||
clearable
|
clearable
|
||||||
|
|
@ -333,7 +344,7 @@
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
@keyup.enter.native="getTableDatainformation"
|
@keyup.enter.native="getTableDatainformation"
|
||||||
/>
|
/> -->
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryinformation.conTypeName"
|
v-model="queryinformation.conTypeName"
|
||||||
size="small"
|
size="small"
|
||||||
|
|
@ -365,7 +376,7 @@
|
||||||
<el-button
|
<el-button
|
||||||
style="margin-right: 20px"
|
style="margin-right: 20px"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="getTableDatainformation"
|
@click="haocaiChaxun"
|
||||||
>查询</el-button
|
>查询</el-button
|
||||||
>
|
>
|
||||||
<el-button @click="resetHandleinformation">重置</el-button>
|
<el-button @click="resetHandleinformation">重置</el-button>
|
||||||
|
|
@ -385,12 +396,12 @@
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column prop="id" label="ID" width="50px" />
|
<el-table-column prop="id" label="ID" width="50px" />
|
||||||
<el-table-column label="耗材名称" prop="conName" />
|
<el-table-column label="耗材名称" prop="conName" />
|
||||||
<el-table-column label="耗材代码" prop="conCode" >
|
<el-table-column label="耗材代码" prop="conCode">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<div class="line-1">
|
<div class="line-1">
|
||||||
{{ scope.row.conCode }}
|
{{ scope.row.conCode }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="类型名称" prop="conTypeName" />
|
<el-table-column label="类型名称" prop="conTypeName" />
|
||||||
<el-table-column label="单位" prop="conUnit" />
|
<el-table-column label="单位" prop="conUnit" />
|
||||||
|
|
@ -409,7 +420,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="head-container" style="margin-top: 10px;">
|
<div class="head-container" style="margin-top: 10px">
|
||||||
<el-pagination
|
<el-pagination
|
||||||
:total="tableDatainformation.total"
|
:total="tableDatainformation.total"
|
||||||
:current-page="tableDatainformation.page + 1"
|
:current-page="tableDatainformation.page + 1"
|
||||||
|
|
@ -468,6 +479,7 @@ import dayjs from "dayjs";
|
||||||
import shopList from "../components/shopList";
|
import shopList from "../components/shopList";
|
||||||
import bindHaocai from "./components/specifications_bind_supplies";
|
import bindHaocai from "./components/specifications_bind_supplies";
|
||||||
import { upProSort, tbProduct } from "@/api/shop";
|
import { upProSort, tbProduct } from "@/api/shop";
|
||||||
|
import { gettbConsType } from "@/api/consumable";
|
||||||
import {
|
import {
|
||||||
getviewConSku,
|
getviewConSku,
|
||||||
gettbProductSpec,
|
gettbProductSpec,
|
||||||
|
|
@ -513,6 +525,7 @@ export default {
|
||||||
loading: false,
|
loading: false,
|
||||||
total: 0,
|
total: 0,
|
||||||
},
|
},
|
||||||
|
consTypeList: [],
|
||||||
queryinformation: {
|
queryinformation: {
|
||||||
conTypeId: "",
|
conTypeId: "",
|
||||||
conTypeName: "",
|
conTypeName: "",
|
||||||
|
|
@ -552,12 +565,26 @@ export default {
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
this.getTableDatasku();
|
this.getTableDatasku();
|
||||||
this.getTableDatainformation();
|
this.getTableDatainformation();
|
||||||
|
this.gettbConsType();
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
// this.tableDrag()
|
// this.tableDrag()
|
||||||
// this.$refs.shopList.isselectEvent()
|
// this.$refs.shopList.isselectEvent()
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 获取类型
|
||||||
|
async gettbConsType() {
|
||||||
|
try {
|
||||||
|
const res = await gettbConsType({
|
||||||
|
page: 0,
|
||||||
|
size: 100,
|
||||||
|
shopId: localStorage.getItem("shopId"),
|
||||||
|
});
|
||||||
|
this.consTypeList = res.content;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||||
if (columnIndex === 0) {
|
if (columnIndex === 0) {
|
||||||
let index = this.commodityArr.findIndex((v) => v.id === row.id);
|
let index = this.commodityArr.findIndex((v) => v.id === row.id);
|
||||||
|
|
@ -586,7 +613,7 @@ export default {
|
||||||
haocais.splice(haocaiIndex, 1);
|
haocais.splice(haocaiIndex, 1);
|
||||||
},
|
},
|
||||||
addGoodsHaocai(haocais, haocaiIndex) {
|
addGoodsHaocai(haocais, haocaiIndex) {
|
||||||
haocais.push({...haocaisBasic});
|
haocais.push({ ...haocaisBasic });
|
||||||
},
|
},
|
||||||
//初始化耗材表单选中状态
|
//初始化耗材表单选中状态
|
||||||
initTableSelected() {
|
initTableSelected() {
|
||||||
|
|
@ -616,32 +643,32 @@ export default {
|
||||||
this.informationdialogshow = false;
|
this.informationdialogshow = false;
|
||||||
},
|
},
|
||||||
haocaiConfirm() {
|
haocaiConfirm() {
|
||||||
let hasEmpty=JSON.stringify(haocaiSelectedMap)=='{}'
|
let hasEmpty = JSON.stringify(haocaiSelectedMap) == "{}";
|
||||||
if(!hasEmpty){
|
if (!hasEmpty) {
|
||||||
this.commodityArr.forEach((ele) => {
|
this.commodityArr.forEach((ele) => {
|
||||||
if (ele.skuId == this.ALLisDistribute.skuId) {
|
if (ele.skuId == this.ALLisDistribute.skuId) {
|
||||||
ele.haocais = [];
|
ele.haocais = [];
|
||||||
let index = -1;
|
let index = -1;
|
||||||
for (let key in haocaiSelectedMap) {
|
for (let key in haocaiSelectedMap) {
|
||||||
const item = haocaiSelectedMap[key];
|
const item = haocaiSelectedMap[key];
|
||||||
index++;
|
index++;
|
||||||
this.$set(ele.haocais, index, {
|
this.$set(ele.haocais, index, {
|
||||||
consInfoId: item.id,
|
consInfoId: item.id,
|
||||||
conInfoId: item.id,
|
conInfoId: item.id,
|
||||||
conName: item.conName,
|
conName: item.conName,
|
||||||
skuId: ele.skuId,
|
skuId: ele.skuId,
|
||||||
shopId: ele.shopId,
|
shopId: ele.shopId,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
} else {
|
||||||
}else{
|
|
||||||
//当选中耗材为空,重置耗材
|
//当选中耗材为空,重置耗材
|
||||||
this.commodityArr.forEach((ele) => {
|
this.commodityArr.forEach((ele) => {
|
||||||
if (ele.skuId == this.ALLisDistribute.skuId) {
|
if (ele.skuId == this.ALLisDistribute.skuId) {
|
||||||
ele.haocais = [{...haocaisBasic}];
|
ele.haocais = [{ ...haocaisBasic }];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.informationdialogshow = false;
|
this.informationdialogshow = false;
|
||||||
|
|
@ -683,7 +710,6 @@ export default {
|
||||||
selectShop(res) {
|
selectShop(res) {
|
||||||
const skuArr = [];
|
const skuArr = [];
|
||||||
|
|
||||||
|
|
||||||
res.forEach((ele) => {
|
res.forEach((ele) => {
|
||||||
ele.skuList.forEach((sku) => {
|
ele.skuList.forEach((sku) => {
|
||||||
skuArr.push({
|
skuArr.push({
|
||||||
|
|
@ -752,10 +778,11 @@ export default {
|
||||||
},
|
},
|
||||||
// 选择耗材
|
// 选择耗材
|
||||||
selecthaocai(item) {
|
selecthaocai(item) {
|
||||||
|
console.log(item)
|
||||||
|
console.log(haocaiSelectedMap)
|
||||||
this.ALLisDistribute = item;
|
this.ALLisDistribute = item;
|
||||||
this.commodityArr.forEach((ele) => {
|
this.commodityArr.forEach((ele) => {
|
||||||
if (ele.id == this.ALLisDistribute.id) {
|
if (ele.id == this.ALLisDistribute.id && ele.skuId==item.skuId) {
|
||||||
console.log(ele.haocais);
|
|
||||||
ele.haocais.map((v) => {
|
ele.haocais.map((v) => {
|
||||||
if (v.conInfoId) {
|
if (v.conInfoId) {
|
||||||
haocaiSelectedMap[v.conInfoId] = v;
|
haocaiSelectedMap[v.conInfoId] = v;
|
||||||
|
|
@ -845,6 +872,10 @@ export default {
|
||||||
this.tableDatainformation.page = e - 1;
|
this.tableDatainformation.page = e - 1;
|
||||||
this.getTableDatainformation();
|
this.getTableDatainformation();
|
||||||
},
|
},
|
||||||
|
haocaiChaxun() {
|
||||||
|
this.tableDatainformation.page = 0;
|
||||||
|
this.getTableDatainformation();
|
||||||
|
},
|
||||||
// 获取信息管理
|
// 获取信息管理
|
||||||
async getTableDatainformation() {
|
async getTableDatainformation() {
|
||||||
this.tableDatainformation.loading = true;
|
this.tableDatainformation.loading = true;
|
||||||
|
|
@ -868,9 +899,9 @@ export default {
|
||||||
},
|
},
|
||||||
// 耗材信息的信息
|
// 耗材信息的信息
|
||||||
tableDatainformationtable(item) {
|
tableDatainformationtable(item) {
|
||||||
haocaiSelectedMap[item.id]=item
|
haocaiSelectedMap[item.id] = item;
|
||||||
this.haocaiConfirm()
|
this.haocaiConfirm();
|
||||||
return
|
return;
|
||||||
this.commodityArr.forEach((ele) => {
|
this.commodityArr.forEach((ele) => {
|
||||||
if (ele.skuId == this.ALLisDistribute.skuId) {
|
if (ele.skuId == this.ALLisDistribute.skuId) {
|
||||||
console.log(ele.haocais);
|
console.log(ele.haocais);
|
||||||
|
|
@ -950,16 +981,42 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const newArr = this.commodityArr.map((ele) => {
|
let newArr = [];
|
||||||
return {
|
for (let i of this.commodityArr) {
|
||||||
...ele,
|
//共享库存
|
||||||
consInfoId: ele.consInfoId,
|
console.log(i.haocais)
|
||||||
productId: ele.id,
|
if (i.isDistribute) {
|
||||||
skuInfos: ele.haocais,
|
for (let k of i.haocais) {
|
||||||
surplusStock: ele.surplusStock,
|
newArr.push({
|
||||||
status: ele.status,
|
consInfoId: k.conInfoId,
|
||||||
};
|
productId: i.id,
|
||||||
});
|
surplusStock: k.surplusStock,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 非共享商品 多规格
|
||||||
|
for (let k of i.haocais) {
|
||||||
|
newArr.push({
|
||||||
|
consInfoId: k.conInfoId,
|
||||||
|
productId: i.id,
|
||||||
|
skuInfos:{
|
||||||
|
...k
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// const newArr = this.commodityArr.map((ele) => {
|
||||||
|
// console.log(ele)
|
||||||
|
// return {
|
||||||
|
// consInfoId: ele.consInfoId,
|
||||||
|
// productId: ele.id,
|
||||||
|
// skuInfos: ele.haocais,
|
||||||
|
// surplusStock: ele.surplusStock,
|
||||||
|
// status: ele.status,
|
||||||
|
// };
|
||||||
|
// });
|
||||||
await posttbProskuCons(newArr);
|
await posttbProskuCons(newArr);
|
||||||
|
|
||||||
// for(let data of newArr){
|
// for(let data of newArr){
|
||||||
|
|
@ -1021,10 +1078,11 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.flex{
|
.flex {
|
||||||
display: flex;align-content: center;
|
display: flex;
|
||||||
|
align-content: center;
|
||||||
}
|
}
|
||||||
.head-container .filter-item{
|
.head-container .filter-item {
|
||||||
margin: 0 10px 0 0;
|
margin: 0 10px 0 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -577,8 +577,11 @@ export default {
|
||||||
specInfo[index].realSalesNumber = item.productId;
|
specInfo[index].realSalesNumber = item.productId;
|
||||||
specInfo[index].shopId = item.shopId;
|
specInfo[index].shopId = item.shopId;
|
||||||
specInfo[index].warnLine = item.warnLine;
|
specInfo[index].warnLine = item.warnLine;
|
||||||
|
specInfo[index].suit = item.suit;
|
||||||
|
specInfo[index].stockNumber = item.stockNumber;
|
||||||
return specInfo[index];
|
return specInfo[index];
|
||||||
});
|
});
|
||||||
|
console.log(this.form.skuList);
|
||||||
this.originSkuList = [...this.form.skuList];
|
this.originSkuList = [...this.form.skuList];
|
||||||
this.selectSpecResult = true;
|
this.selectSpecResult = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ export default {
|
||||||
this.form.isShow = 1
|
this.form.isShow = 1
|
||||||
this.form.name = ''
|
this.form.name = ''
|
||||||
this.form.sort = 0
|
this.form.sort = 0
|
||||||
|
this.form.id = null
|
||||||
this.form.productIds = []
|
this.form.productIds = []
|
||||||
this.productIds = []
|
this.productIds = []
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue