Merge branch 'dwb' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into gyq

This commit is contained in:
gyq 2024-07-05 14:14:20 +08:00
commit 8dde3eea48
3 changed files with 82 additions and 44 deletions

View File

@ -16,7 +16,7 @@
</el-form-item>
</el-form>
<div class="head-container">
<el-table ref="table" :data="tableData.list" v-loading="tableData.loading">
<el-table ref="table" :data="tableData.list" @select="firstSelectChange" v-loading="tableData.loading">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column label="商品信息">
<template v-slot="scope">
@ -36,11 +36,11 @@
</template>
</el-table-column> <el-table-column label="">
<template v-slot="scope">
{{ scope.row.isPauseSale == 1?'是':'否' }}
{{ scope.row.isPauseSale == 1 ? '是' : '否' }}
</template>
</el-table-column> <el-table-column label="">
<template v-slot="scope">
{{ scope.row.isDistribute == 1?'是':'否' }}
{{ scope.row.isDistribute == 1 ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="售价">
@ -85,16 +85,30 @@ export default {
loading: false,
list: []
},
goods: []
goods: [],
//
isselect: false
}
},
methods: {
firstSelectChange() {
// console.log(selection)
let selection = this.$refs.table.selection
if (selection.length > 1 && this.isselect) {
const del_row = selection.shift();
this.$refs.table.toggleRowSelection(del_row, false);
}
},
//
confirmHandle() {
let res = this.$refs.table.selection
this.$emit('success', res)
this.close()
},
//
isselectEvent() {
this.isselect = true
},
//
resetHandle() {
this.searhForm.name = ''

View File

@ -56,9 +56,9 @@
<!-- <el-table-column label="单位耗材值" prop="surplusStock" /> -->
<!-- <el-table-column label="排序" prop="sort" sortable /> -->
<el-table-column label="更新时间" prop="updateTime">
<template v-slot="scope">
<!-- <template v-slot="scope">
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</template> -->
</el-table-column>
<el-table-column label="操作">
<template v-slot="scope">
@ -271,7 +271,7 @@ export default {
{ required: true, message: '请输入耗材信息名称', trigger: 'blur' }
],
conNames: [
{ required: true, message: '请输入耗材类型', trigger: 'blur' }
{ required: true, message: '请选择耗材类型', trigger: 'blur' }
],
price: [
{ required: true, message: '请输入耗材价格', trigger: 'blur' }
@ -386,7 +386,6 @@ export default {
},
//
tableDatatypetable(item) {
console.log(item, '调试-选择完的数据')
this.ruleForm.conCode = item.conTypeCode
this.ruleForm.conNames = item.conTypeName
this.ruleForm.conTypeId = item.id

View File

@ -38,19 +38,19 @@
<div class="head-container" id="table_drag">
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
<el-table-column prop="id" label="ID" width="50px" />
<el-table-column label="耗材信息ID" prop="conInfoId" />
<el-table-column label="耗材信息名称" prop="conName" />
<!-- <el-table-column label="耗材信息ID" prop="conInfoId" /> -->
<el-table-column label="耗材信息" prop="conName" />
<el-table-column label="商品" prop="name" />
<el-table-column label="规格" prop="specSnap" />
<el-table-column label="单笔消耗数" prop="surplusStock" />
<!-- <el-table-column label="价格" prop="conName" /> -->
<el-table-column label="规格名称" prop="specSnap" />
<el-table-column label="耗材信息代码" prop="conCode" />
<el-table-column label="耗材信息单位" prop="conUnit" />
<el-table-column label="商品名称" prop="name" />
<el-table-column label="库存" prop="stockNumber" />
<el-table-column label="单笔消耗数" prop="surplusStock" />
<el-table-column label="创建时间" prop="createTime">
<template v-slot="scope">
<!-- <template v-slot="scope">
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</template> -->
</el-table-column>
<el-table-column label="状态" prop="status">
<template v-slot="scope">
@ -58,11 +58,11 @@
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag>
</template>
</el-table-column>
<el-table-column label="更新时间" prop="updateTime">
<!-- <el-table-column label="更新时间" prop="updateTime">
<template v-slot="scope">
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="操作" width="200">
<template v-slot="scope">
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
@ -80,9 +80,16 @@
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange" />
</div>
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="50%">
<el-dialog :title="dialogtitle" :visible.sync="dialogshow" width="1000px">
<el-form ref="addSelect" :inline="true">
<el-form-item label="商品名称">
{{ addSelect.length ? addSelect[0].name : '' }}
</el-form-item><br />
<template v-if="addSelect.length">
<!--
isDistribute为1是共享库存展示商品
为0是展示规格
-->
<template v-if="addSelect[0].isDistribute == 1">
<el-form-item label="商品规格">
<el-input v-model="addSelect[0].specSnap" style="width: 130px;" placeholder="请选择商品规格"
@ -103,7 +110,9 @@
<template v-if="addSelect[0]">
<template v-for="(item, i) in addSelect[0].skuList">
<el-form-item label="商品规格">
<el-input v-model="item.specSnap" style="width: 130px;" placeholder="请选择商品规格"
<el-input v-if="addSelect[0].typeEnum == '单规格'" v-model="addSelect[0].specSnap"
style="width: 130px;" placeholder="请选择商品规格" disabled></el-input>
<el-input v-else v-model="item.specSnap" style="width: 130px;" placeholder="请选择商品规格"
disabled></el-input>
</el-form-item>
<el-form-item label="耗材信息" prop="conName">
@ -278,11 +287,13 @@ export default {
this.getTableDatasku()
this.getTableDatainformation()
this.$nextTick(() => {
this.tableDrag()
// this.tableDrag()
this.$refs.shopList.isselectEvent()
})
},
methods: {
selectShop(res) {
console.log(res, '调试1')
this.addSelect = res
res[0]['specSnap'] = res[0].name
this.clickdialogframe('add')
@ -420,6 +431,7 @@ export default {
shopId: localStorage.getItem('shopId'),
specSnap: this.querytableDatasku.specSnap,
name: this.querytableDatasku.name,
sort: 'id.desc',
shopName: this.querytableDatasku.shopName
})
this.tableDatasku.loading = false
@ -460,17 +472,24 @@ export default {
});
this.informationdialogshowedit = false
} else {
let { id, consInfoId, surplusStock } = this.addSelect[0]
// 1
if (this.addSelect[0].isDistribute != 1) {
surplusStock = this.addSelect[0].skuList[0].surplusStock
}
let obj = {
productId: id,
consInfoId: consInfoId,
skuInfos: null,
surplusStock: surplusStock
}
// 1
if (this.addSelect[0].isDistribute != 1) {
let isgongx = false
this.addSelect[0].skuList.forEach(ele => {
ele.skuId = ele.id
ele.conInfoId = consInfoId
// ele.surplusStock = surplusStock
if (!ele.skuId || !ele.surplusStock) {
isgongx = true
} else {
@ -482,17 +501,17 @@ export default {
return
}
obj.skuInfos = this.addSelect[0].skuList
} else {
// } else {
if (!consInfoId) {
this.$message.error('请选择耗材信息')
return
}
if (!surplusStock) {
this.$message.error('请输入耗材值')
return
}
}
// if (!consInfoId) {
// this.$message.error('')
// return
// }
// if (!surplusStock) {
// this.$message.error('')
// return
// }
// }
await posttbProskuCons(obj)
this.$message({
message: '新增成功',
@ -500,6 +519,12 @@ export default {
});
this.ALLisDistribute = null
this.dialogshow = false
}
this.$refs[formName].resetFields()
this.getTableData()