Merge branch 'test' of https://e.coding.net/g-cphe0354/yinshoukeguanliduan/management into dwb
This commit is contained in:
commit
9f2af5cf76
|
|
@ -1,6 +1,6 @@
|
|||
<!-- 耗材列表 -->
|
||||
<template>
|
||||
<el-dialog title="选择耗材" :visible.sync="dialogVisible" @open="resetHandle()">
|
||||
<el-dialog title="选择耗材" :visible.sync="dialogVisible">
|
||||
<el-form :model="searchForm" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.conTypeName" placeholder="耗材类型名称" @input="onInput"></el-input>
|
||||
|
|
@ -162,7 +162,6 @@ export default {
|
|||
this.goods = []
|
||||
}
|
||||
this.resetHandle()
|
||||
this.getTableData()
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog title="选择商品" :visible.sync="dialogVisible" @open="resetHandle()" @close="reset" top="5vh">
|
||||
<el-dialog title="选择商品" :visible.sync="dialogVisible" @close="reset" top="5vh">
|
||||
<el-form :model="searhForm" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searhForm.name" placeholder="商品名称" @input="onInput"></el-input>
|
||||
|
|
@ -192,9 +192,8 @@ export default {
|
|||
} else {
|
||||
this.goods = []
|
||||
}
|
||||
this.resetHandle()
|
||||
this.tbShopCategoryGet()
|
||||
this.getTableData()
|
||||
this.resetHandle()
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false
|
||||
|
|
|
|||
|
|
@ -963,6 +963,7 @@ export default {
|
|||
shopId: localStorage.getItem("shopId"),
|
||||
productId: '',//预留耗材id
|
||||
column: this.stockData.column,//列名
|
||||
conName:this.query.conName,
|
||||
createdAt: arr//耗材id
|
||||
})
|
||||
this.stockData.loading = false;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="head-container">
|
||||
<!-- <div class="head-container">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-button
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="head-container" id="table_drag">
|
||||
<el-table
|
||||
ref="table"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
</el-select>
|
||||
</div>
|
||||
<div style="width: 300px;">
|
||||
<el-select v-model="query.sort" placeholder="排序">
|
||||
<el-select v-model="query.sort" placeholder="排序">
|
||||
<el-option label="默认排序" value="false" />
|
||||
<el-option label="库存降序" value="true" />
|
||||
</el-select>
|
||||
|
|
@ -68,14 +68,16 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存" prop="number">
|
||||
<template v-slot="scope" >
|
||||
<span v-if="!scope.row.isStock" :class="[scope.row.stockNumber <= warnLine ? 'colorStyle' : '']">
|
||||
<span v-if="scope.row.stockNumber < 0" style="font-weight: 700;color: #999;font-size: 14px;">-</span>
|
||||
<span >
|
||||
<span> {{ Math.abs(scope.row.stockNumber) }}</span>
|
||||
<template v-slot="scope">
|
||||
<span v-if="!scope.row.isStock"
|
||||
:class="[scope.row.stockNumber <= warnLine ? 'colorStyle' : '']">
|
||||
<span v-if="scope.row.stockNumber < 0"
|
||||
style="font-weight: 700;color: #999;font-size: 14px;">-</span>
|
||||
<span>
|
||||
<span> {{ Math.abs(scope.row.stockNumber) }}</span>
|
||||
<span> {{ scope.row.unitName }}</span>
|
||||
</span>
|
||||
|
||||
|
||||
</span>
|
||||
<span v-else :class="[scope.row.stockNumber <= warnLine ? 'colorStyle' : '']">
|
||||
{{ `${scope.row.stockNumber} ${scope.row.unitName}` }}
|
||||
|
|
@ -399,6 +401,12 @@ export default {
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* flex-direction: row-reverse; */
|
||||
}
|
||||
|
||||
.shop_info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
@ -435,10 +443,3 @@ export default {
|
|||
font-weight: 700;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.cell {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* flex-direction: row-reverse; */
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -275,7 +275,7 @@ export default {
|
|||
remark: '',
|
||||
time: dayjs().format('YYYY-MM-DD'),
|
||||
totalAmount: 0,
|
||||
type: 'purveyor',
|
||||
type: 'out',
|
||||
shopId: localStorage.getItem('shopId')
|
||||
},
|
||||
queryRules: {
|
||||
|
|
@ -503,7 +503,7 @@ export default {
|
|||
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
|
||||
item.stockNumber = 0
|
||||
item.costPrice = item.price
|
||||
item.conInfold = item.id
|
||||
item.conInfoId = item.id
|
||||
return item
|
||||
})
|
||||
this.tableData.list = [...this.tableData.list, ...arr]
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ export default {
|
|||
item.number = formatDecimal(item.stockNumber - item.stockConsume, 2, true)
|
||||
item.stockNumber = 0
|
||||
item.costPrice = item.price
|
||||
item.conInfold = item.id
|
||||
item.conInfoId = item.id
|
||||
return item
|
||||
})
|
||||
this.tableData.list = [...this.tableData.list, ...arr]
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
<div class="item">
|
||||
<div class="t">支付时间</div>
|
||||
<div class="b">
|
||||
{{ detail.createdAt | paidTime | timeFilter }}
|
||||
{{ detail.createdAt | timeFilter }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -50,7 +50,12 @@
|
|||
</div>
|
||||
<div class="head-container">
|
||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
|
||||
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper" @size-change="(e) => {
|
||||
tableData.size = e;
|
||||
tableData.page = 0;
|
||||
getTableData();
|
||||
}
|
||||
"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -16,10 +16,10 @@
|
|||
<div class="name_wrap">
|
||||
<div class="name">商品名:{{ goodsDetail.name }}</div>
|
||||
</div>
|
||||
<el-table :data="tableData.cons">
|
||||
<!-- 绑定到商品 -->
|
||||
<el-table :data="tableData.cons" border v-show="type == 1">
|
||||
<el-table-column label="序号" type="index" width="50"></el-table-column>
|
||||
<el-table-column label="规格名称" prop="specSnap" v-if="type == 2"></el-table-column>
|
||||
<el-table-column label="耗材名称">
|
||||
<el-table-column label="耗材名称" prop="conInfoId">
|
||||
<template v-slot="scope">
|
||||
<el-select v-model="scope.row.conInfoId" filterable remote reserve-keyword placeholder="请输入关键词"
|
||||
:remote-method="remoteMethod" :loading="loading" @change="selectionChange($event, scope.row)">
|
||||
|
|
@ -30,21 +30,21 @@
|
|||
<div class="tips" v-if="scope.row.stockNumber">库存:{{ scope.row.stockNumber }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位">
|
||||
<el-table-column label="单位" prop="conUnit">
|
||||
<template v-slot="scope">
|
||||
<span v-if="scope.row.conInfoId">{{ scope.row.conUnit }}</span>
|
||||
<span v-else>请选择耗材</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="使用数量">
|
||||
<el-table-column label="使用数量" prop="surplusStock">
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.surplusStock" :min="0" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<el-table-column label="操作">
|
||||
<template v-slot="scope">
|
||||
<div class="table_btn_wrap">
|
||||
<div class="btn sub" @click="tableData.cons.splice(scope.$index, 1)">
|
||||
<div class="btn sub" v-if="scope.$index > 0" @click="tableData.cons.splice(scope.$index, 1)">
|
||||
<i class="el-icon-remove-outline"></i>
|
||||
</div>
|
||||
<div class="btn add" @click="createItem(scope.row)">
|
||||
|
|
@ -54,6 +54,58 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 绑定到规格 -->
|
||||
<el-table :data="tableData.cons" border v-show="type == 2">
|
||||
<el-table-column label="序号" type="index" width="100"></el-table-column>
|
||||
<el-table-column label="规格名称" prop="specSnap"></el-table-column>
|
||||
<el-table-column label="耗材" width="600">
|
||||
<el-table-column label="耗材信息">
|
||||
<template v-slot="scope">
|
||||
<div class="sku_table_item" v-for="(item, index) in scope.row.consList" :key="index">
|
||||
<el-select v-model="item.conInfoId" filterable remote reserve-keyword placeholder="请输入关键词"
|
||||
:remote-method="remoteMethod" :loading="loading"
|
||||
@change="skuSelectionChange($event, item)">
|
||||
<el-option v-for="item in options" :key="item.consId" :label="item.conName"
|
||||
:value="item.consId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<div class="tips" v-if="scope.row.stockNumber">库存:{{ scope.row.stockNumber }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="耗材单位">
|
||||
<template v-slot="scope">
|
||||
<div class="sku_table_item" v-for="(item, index) in scope.row.consList" :key="index">
|
||||
<div class="t">
|
||||
<span v-if="item.conInfoId">{{ item.conUnit }}</span>
|
||||
<span v-else>请选择耗材</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="消耗量">
|
||||
<template v-slot="scope">
|
||||
<div class="sku_table_item" v-for="(item, index) in scope.row.consList" :key="index">
|
||||
<el-input-number v-model="item.surplusStock" :min="0" />
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template v-slot="scope">
|
||||
<div class="sku_table_item" v-for="(item, index) in scope.row.consList" :key="index">
|
||||
<div class="table_btn_wrap t">
|
||||
<div class="btn sub" v-if="index > 0" @click="scope.row.consList.splice(index, 1)">
|
||||
<i class="el-icon-remove-outline"></i>
|
||||
</div>
|
||||
<div class="btn add" @click="skuCreateItem(scope.$index)">
|
||||
<i class="el-icon-circle-plus-outline"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" :loading=formLoading @click="onSubmitHandle">确 定</el-button>
|
||||
|
|
@ -98,8 +150,33 @@ export default {
|
|||
// this.$message.error('请完善信息')
|
||||
// return
|
||||
// }
|
||||
|
||||
let res = null
|
||||
this.formLoading = true
|
||||
const res = await tbProskuConV2(this.tableData)
|
||||
if (this.type == 1) {
|
||||
res = await tbProskuConV2(this.tableData)
|
||||
} else if (this.type == 2) {
|
||||
let data = { ...this.tableData }
|
||||
|
||||
let arr = []
|
||||
|
||||
data.cons.map(item => {
|
||||
item.consList.map(val => {
|
||||
if (val.name) {
|
||||
let obj = { ...item }
|
||||
obj.id = val.id
|
||||
obj.name = val.name
|
||||
obj.productSkuId = item.productSkuId
|
||||
obj.conInfoId = val.conInfoId
|
||||
obj.surplusStock = val.surplusStock
|
||||
arr.push(obj)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
data.cons = arr
|
||||
res = await tbProskuConV2(data)
|
||||
}
|
||||
this.formLoading = false
|
||||
this.$message.success('编辑成功')
|
||||
this.dialogVisible = false
|
||||
|
|
@ -109,12 +186,18 @@ export default {
|
|||
this.formLoading = false
|
||||
}
|
||||
},
|
||||
// 选择耗材
|
||||
// 商品选择耗材
|
||||
selectionChange(e, row) {
|
||||
let item = this.options.find(item => item.consId == e)
|
||||
row.name = item.conName
|
||||
row.conUnit = item.conUnit
|
||||
},
|
||||
// 规格选择耗材
|
||||
skuSelectionChange(e, row) {
|
||||
let item = this.options.find(item => item.consId == e)
|
||||
row.name = item.conName
|
||||
row.conUnit = item.conUnit
|
||||
},
|
||||
// 远程搜索耗材
|
||||
remoteMethod(query) {
|
||||
if (query !== '') {
|
||||
|
|
@ -202,9 +285,6 @@ export default {
|
|||
}
|
||||
} else {
|
||||
// 添加至规格
|
||||
if (this.goodsDetail.conInfos.length) {
|
||||
this.tableData.cons = [...this.goodsDetail.conInfos]
|
||||
}
|
||||
this.goodsDetail.skuList.map(val => {
|
||||
let item = {}
|
||||
|
||||
|
|
@ -219,43 +299,59 @@ export default {
|
|||
item.status = 1
|
||||
item.specSnap = val.name
|
||||
|
||||
item.consList = [
|
||||
{
|
||||
surplusStock: 0,
|
||||
conInfoId: '',
|
||||
name: '',
|
||||
conUnit: ''
|
||||
}
|
||||
]
|
||||
|
||||
this.tableData.cons.push(item)
|
||||
})
|
||||
|
||||
if (this.goodsDetail.conInfos.length) {
|
||||
this.tableData.cons.map(val => {
|
||||
this.goodsDetail.conInfos.map(item => {
|
||||
if (item.productSkuId == val.productSkuId) {
|
||||
val.consList.unshift({
|
||||
id: item.id,
|
||||
surplusStock: item.surplusStock,
|
||||
conInfoId: item.conInfoId,
|
||||
name: item.conName,
|
||||
conUnit: item.conUnit
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
// 生成新关系项
|
||||
// 生成新商品绑定耗材关系项
|
||||
createItem(val) {
|
||||
if (this.type == 1) {
|
||||
let item = {}
|
||||
|
||||
let item = {}
|
||||
item.id = ''
|
||||
item.shopId = localStorage.getItem('shopId')
|
||||
item.productId = this.goodsDetail.id
|
||||
item.productSkuId = 0
|
||||
item.conInfoId = ''
|
||||
item.name = ''
|
||||
item.conUnit = ''
|
||||
item.surplusStock = 0
|
||||
item.status = 1
|
||||
|
||||
item.id = ''
|
||||
item.shopId = localStorage.getItem('shopId')
|
||||
item.productId = this.goodsDetail.id
|
||||
item.productSkuId = 0
|
||||
item.conInfoId = ''
|
||||
item.name = ''
|
||||
item.conUnit = ''
|
||||
item.surplusStock = 0
|
||||
item.status = 1
|
||||
|
||||
this.tableData.cons.push(item)
|
||||
} else {
|
||||
let item = {}
|
||||
|
||||
item.id = ''
|
||||
item.shopId = localStorage.getItem('shopId')
|
||||
item.productId = this.goodsDetail.id
|
||||
item.productSkuId = val.productSkuId
|
||||
item.conInfoId = ''
|
||||
item.name = ''
|
||||
item.conUnit = ''
|
||||
item.surplusStock = 0
|
||||
item.status = 1
|
||||
item.specSnap = val.specSnap
|
||||
|
||||
this.tableData.cons.push(item)
|
||||
}
|
||||
this.tableData.cons.push(item)
|
||||
},
|
||||
// 规格生成新关系项
|
||||
skuCreateItem($index) {
|
||||
this.tableData.cons[$index].consList.push({
|
||||
conInfoId: '',
|
||||
name: '',
|
||||
conUnit: '',
|
||||
surplusStock: 0
|
||||
})
|
||||
},
|
||||
reset() {
|
||||
this.goodsDetail = ''
|
||||
|
|
@ -321,4 +417,29 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.cons_list_wrap {
|
||||
.row {
|
||||
display: flex;
|
||||
padding: 10px 0;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
|
||||
.item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sku_table_item {
|
||||
padding: 10px 0;
|
||||
|
||||
.t {
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue