Merge branch 'dwb' of e.coding.net:g-cphe0354/yinshoukeguanliduan/management into gyq
This commit is contained in:
commit
8dde3eea48
|
|
@ -16,7 +16,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="head-container">
|
<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 type="selection" width="55" align="center"></el-table-column>
|
||||||
<el-table-column label="商品信息">
|
<el-table-column label="商品信息">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
@ -36,11 +36,11 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> <el-table-column label="是否售罄">
|
</el-table-column> <el-table-column label="是否售罄">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ scope.row.isPauseSale == 1?'是':'否' }}
|
{{ scope.row.isPauseSale == 1 ? '是' : '否' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column> <el-table-column label="是否分销">
|
</el-table-column> <el-table-column label="是否分销">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
{{ scope.row.isDistribute == 1?'是':'否' }}
|
{{ scope.row.isDistribute == 1 ? '是' : '否' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="售价">
|
<el-table-column label="售价">
|
||||||
|
|
@ -85,16 +85,30 @@ export default {
|
||||||
loading: false,
|
loading: false,
|
||||||
list: []
|
list: []
|
||||||
},
|
},
|
||||||
goods: []
|
goods: [],
|
||||||
|
// 是否单选
|
||||||
|
isselect: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
confirmHandle() {
|
||||||
let res = this.$refs.table.selection
|
let res = this.$refs.table.selection
|
||||||
this.$emit('success', res)
|
this.$emit('success', res)
|
||||||
this.close()
|
this.close()
|
||||||
},
|
},
|
||||||
|
// 是否单选
|
||||||
|
isselectEvent() {
|
||||||
|
this.isselect = true
|
||||||
|
},
|
||||||
// 重置查询
|
// 重置查询
|
||||||
resetHandle() {
|
resetHandle() {
|
||||||
this.searhForm.name = ''
|
this.searhForm.name = ''
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,9 @@
|
||||||
<!-- <el-table-column label="单位耗材值" prop="surplusStock" /> -->
|
<!-- <el-table-column label="单位耗材值" prop="surplusStock" /> -->
|
||||||
<!-- <el-table-column label="排序" prop="sort" sortable /> -->
|
<!-- <el-table-column label="排序" prop="sort" sortable /> -->
|
||||||
<el-table-column label="更新时间" prop="updateTime">
|
<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') }}
|
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||||
</template>
|
</template> -->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作">
|
<el-table-column label="操作">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
@ -271,7 +271,7 @@ export default {
|
||||||
{ required: true, message: '请输入耗材信息名称', trigger: 'blur' }
|
{ required: true, message: '请输入耗材信息名称', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
conNames: [
|
conNames: [
|
||||||
{ required: true, message: '请输入耗材类型', trigger: 'blur' }
|
{ required: true, message: '请选择耗材类型', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
price: [
|
price: [
|
||||||
{ required: true, message: '请输入耗材价格', trigger: 'blur' }
|
{ required: true, message: '请输入耗材价格', trigger: 'blur' }
|
||||||
|
|
@ -386,7 +386,6 @@ export default {
|
||||||
},
|
},
|
||||||
// 选择的类型
|
// 选择的类型
|
||||||
tableDatatypetable(item) {
|
tableDatatypetable(item) {
|
||||||
console.log(item, '调试-选择完的数据')
|
|
||||||
this.ruleForm.conCode = item.conTypeCode
|
this.ruleForm.conCode = item.conTypeCode
|
||||||
this.ruleForm.conNames = item.conTypeName
|
this.ruleForm.conNames = item.conTypeName
|
||||||
this.ruleForm.conTypeId = item.id
|
this.ruleForm.conTypeId = item.id
|
||||||
|
|
|
||||||
|
|
@ -38,19 +38,19 @@
|
||||||
<div class="head-container" id="table_drag">
|
<div class="head-container" id="table_drag">
|
||||||
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
|
<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 prop="id" label="ID" width="50px" />
|
||||||
<el-table-column label="耗材信息ID" prop="conInfoId" />
|
<!-- <el-table-column label="耗材信息ID" prop="conInfoId" /> -->
|
||||||
<el-table-column label="耗材信息名称" prop="conName" />
|
<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="conName" /> -->
|
||||||
<el-table-column label="规格名称" prop="specSnap" />
|
|
||||||
<el-table-column label="耗材信息代码" prop="conCode" />
|
<el-table-column label="耗材信息代码" prop="conCode" />
|
||||||
<el-table-column label="耗材信息单位" prop="conUnit" />
|
<el-table-column label="耗材信息单位" prop="conUnit" />
|
||||||
<el-table-column label="商品名称" prop="name" />
|
|
||||||
<el-table-column label="库存" prop="stockNumber" />
|
<el-table-column label="库存" prop="stockNumber" />
|
||||||
<el-table-column label="单笔消耗数" prop="surplusStock" />
|
|
||||||
<el-table-column label="创建时间" prop="createTime">
|
<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') }}
|
{{ dayjs(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
|
||||||
</template>
|
</template> -->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" prop="status">
|
<el-table-column label="状态" prop="status">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
|
@ -58,11 +58,11 @@
|
||||||
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag>
|
<el-tag type="danger" v-if="scope.row.status == '0'">禁用</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="更新时间" prop="updateTime">
|
<!-- <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') }}
|
{{ dayjs(scope.row.createdAt).format('YYYY-MM-DD HH:mm:ss') }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="操作" width="200">
|
<el-table-column label="操作" width="200">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<!-- <el-button type="text" icon="el-icon-rank">排序</el-button> -->
|
<!-- <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"
|
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
||||||
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange" />
|
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange" />
|
||||||
</div>
|
</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 ref="addSelect" :inline="true">
|
||||||
|
<el-form-item label="商品名称">
|
||||||
|
{{ addSelect.length ? addSelect[0].name : '' }}
|
||||||
|
</el-form-item><br />
|
||||||
<template v-if="addSelect.length">
|
<template v-if="addSelect.length">
|
||||||
|
<!--
|
||||||
|
isDistribute为1是共享库存,展示商品
|
||||||
|
为0是展示规格
|
||||||
|
-->
|
||||||
<template v-if="addSelect[0].isDistribute == 1">
|
<template v-if="addSelect[0].isDistribute == 1">
|
||||||
<el-form-item label="商品规格">
|
<el-form-item label="商品规格">
|
||||||
<el-input v-model="addSelect[0].specSnap" style="width: 130px;" placeholder="请选择商品规格"
|
<el-input v-model="addSelect[0].specSnap" style="width: 130px;" placeholder="请选择商品规格"
|
||||||
|
|
@ -103,7 +110,9 @@
|
||||||
<template v-if="addSelect[0]">
|
<template v-if="addSelect[0]">
|
||||||
<template v-for="(item, i) in addSelect[0].skuList">
|
<template v-for="(item, i) in addSelect[0].skuList">
|
||||||
<el-form-item label="商品规格">
|
<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>
|
disabled></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="耗材信息" prop="conName">
|
<el-form-item label="耗材信息" prop="conName">
|
||||||
|
|
@ -278,11 +287,13 @@ export default {
|
||||||
this.getTableDatasku()
|
this.getTableDatasku()
|
||||||
this.getTableDatainformation()
|
this.getTableDatainformation()
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.tableDrag()
|
// this.tableDrag()
|
||||||
|
this.$refs.shopList.isselectEvent()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
selectShop(res) {
|
selectShop(res) {
|
||||||
|
console.log(res, '调试1')
|
||||||
this.addSelect = res
|
this.addSelect = res
|
||||||
res[0]['specSnap'] = res[0].name
|
res[0]['specSnap'] = res[0].name
|
||||||
this.clickdialogframe('add')
|
this.clickdialogframe('add')
|
||||||
|
|
@ -420,6 +431,7 @@ export default {
|
||||||
shopId: localStorage.getItem('shopId'),
|
shopId: localStorage.getItem('shopId'),
|
||||||
specSnap: this.querytableDatasku.specSnap,
|
specSnap: this.querytableDatasku.specSnap,
|
||||||
name: this.querytableDatasku.name,
|
name: this.querytableDatasku.name,
|
||||||
|
sort: 'id.desc',
|
||||||
shopName: this.querytableDatasku.shopName
|
shopName: this.querytableDatasku.shopName
|
||||||
})
|
})
|
||||||
this.tableDatasku.loading = false
|
this.tableDatasku.loading = false
|
||||||
|
|
@ -460,17 +472,24 @@ export default {
|
||||||
});
|
});
|
||||||
this.informationdialogshowedit = false
|
this.informationdialogshowedit = false
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
||||||
let { id, consInfoId, surplusStock } = this.addSelect[0]
|
let { id, consInfoId, surplusStock } = this.addSelect[0]
|
||||||
|
// 1为共享库存
|
||||||
|
if (this.addSelect[0].isDistribute != 1) {
|
||||||
|
surplusStock = this.addSelect[0].skuList[0].surplusStock
|
||||||
|
}
|
||||||
let obj = {
|
let obj = {
|
||||||
productId: id,
|
productId: id,
|
||||||
consInfoId: consInfoId,
|
consInfoId: consInfoId,
|
||||||
skuInfos: null,
|
skuInfos: null,
|
||||||
surplusStock: surplusStock
|
surplusStock: surplusStock
|
||||||
}
|
}
|
||||||
// 1为共享库存
|
|
||||||
if (this.addSelect[0].isDistribute != 1) {
|
|
||||||
let isgongx = false
|
let isgongx = false
|
||||||
this.addSelect[0].skuList.forEach(ele => {
|
this.addSelect[0].skuList.forEach(ele => {
|
||||||
|
ele.skuId = ele.id
|
||||||
|
ele.conInfoId = consInfoId
|
||||||
|
// ele.surplusStock = surplusStock
|
||||||
if (!ele.skuId || !ele.surplusStock) {
|
if (!ele.skuId || !ele.surplusStock) {
|
||||||
isgongx = true
|
isgongx = true
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -482,17 +501,17 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
obj.skuInfos = this.addSelect[0].skuList
|
obj.skuInfos = this.addSelect[0].skuList
|
||||||
} else {
|
// } else {
|
||||||
|
|
||||||
if (!consInfoId) {
|
// if (!consInfoId) {
|
||||||
this.$message.error('请选择耗材信息')
|
// this.$message.error('请选择耗材信息')
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
if (!surplusStock) {
|
// if (!surplusStock) {
|
||||||
this.$message.error('请输入耗材值')
|
// this.$message.error('请输入耗材值')
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
await posttbProskuCons(obj)
|
await posttbProskuCons(obj)
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '新增成功',
|
message: '新增成功',
|
||||||
|
|
@ -500,6 +519,12 @@ export default {
|
||||||
});
|
});
|
||||||
this.ALLisDistribute = null
|
this.ALLisDistribute = null
|
||||||
this.dialogshow = false
|
this.dialogshow = false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
this.$refs[formName].resetFields()
|
this.$refs[formName].resetFields()
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue