This commit is contained in:
KangKang0928 2024-08-22 12:58:30 +08:00
commit 5d4ce160ea
4 changed files with 54 additions and 26 deletions

View File

@ -80,7 +80,7 @@ export default {
components: { AddOrUpdate, AddPrice, addStock, AddDiscount }, components: { AddOrUpdate, AddPrice, addStock, AddDiscount },
data() { data() {
return { return {
activeName: "出售中", activeName: "在售",
dataList: [], dataList: [],
formInline: { formInline: {
user: "", user: "",
@ -171,11 +171,18 @@ export default {
title: "商品图", title: "商品图",
field: "productPhotoList", field: "productPhotoList",
align: "center", align: "center",
width: "160px", width: "80px",
type: "jsx", type: "jsx",
render: ({ row }) => { render: ({ row }) => {
if (row.productPhotoList.length > 0) { if (row.productPhotoList.length > 0) {
return <el-image src={row.productPhotoList[0].url}></el-image>; return (
<el-image
preview-src-list={row.productPhotoList.map((item) => {
return item.url;
})}
src={row.productPhotoList[0].url}
></el-image>
);
} else { } else {
return <span>暂无商品图</span>; return <span>暂无商品图</span>;
} }

View File

@ -29,6 +29,7 @@
</template> </template>
<script> <script>
import { debounce, cloneDeep } from "lodash"; import { debounce, cloneDeep } from "lodash";
import { Divider } from "element-ui";
export default { export default {
components: {}, components: {},
data() { data() {
@ -109,13 +110,21 @@ export default {
type: "jsx", type: "jsx",
render: () => { render: () => {
return ( return (
<el-input <div>
type="number" <el-input-number
min={0} min={0}
max={9.9} max={9.9}
v-model={this.modalData.discount} v-model={this.modalData.discount}
placeholder="请输入≤9.9数字 如:8折=售价*0.8" ></el-input-number>
></el-input> <span> 提示 请输入9.9数字 :8=售价*0.8</span>
</div>
// <el-input
// type="number"
// min={0}
// max={9.9}
// v-model={this.modalData.discount}
// placeholder="9.9 :8=*0.8"
// ></el-input>
); );
}, },
}, },
@ -128,14 +137,16 @@ export default {
type: "jsx", type: "jsx",
render: () => { render: () => {
return ( return (
<el-input <div>
type="number" <el-input-number
step={1}
min={1} min={1}
max={99} max={99}
v-model={this.modalData.limitCount} v-model={this.modalData.limitCount}
placeholder="请输入≤99数字 超出数量以原价购买" step={1}
></el-input> step-strictly
></el-input-number>
<span> 提示 请输入99数字 超出数量以原价购买</span>
</div>
); );
}, },
}, },

View File

@ -9,7 +9,7 @@
:modalHandles="modalHandles" :modalHandles="modalHandles"
> >
<obj-table-plus <obj-table-plus
v-show="modalData.specType == 1" v-show="specType == 1"
style="height: calc(100vh - 120px - 240px)" style="height: calc(100vh - 120px - 240px)"
slot="dialog__after" slot="dialog__after"
ref="oTable" ref="oTable"
@ -50,6 +50,7 @@ export default {
width: "60%", width: "60%",
}, },
modalData: {}, modalData: {},
specType: "",
}; };
}, },
methods: { methods: {
@ -79,14 +80,18 @@ export default {
}; };
}, },
init(row) { init(row) {
this.modalData = row; this.specType = row.specType;
this.modalData = {
id: row.id,
productSpecificationList: row.productSpecificationList,
};
this.tableData = row.productSpecificationList; this.tableData = row.productSpecificationList;
console.log(this.modalData); console.log(this.modalData);
}, },
}, },
computed: { computed: {
modalCols() { modalCols() {
if (this.modalData.specType == 0) { if (this.specType == 0) {
return [ return [
{ {
label: "价格", label: "价格",
@ -154,7 +159,7 @@ export default {
type: "primary", type: "primary",
submit: true, submit: true,
handle: debounce(() => { handle: debounce(() => {
if (this.modalData.specType == 0) { if (this.specType == 0) {
this.$api.mer_admin this.$api.mer_admin
.saveProductBase(this.modalData) .saveProductBase(this.modalData)
.then((res) => { .then((res) => {

View File

@ -9,7 +9,7 @@
:modalHandles="modalHandles" :modalHandles="modalHandles"
> >
<obj-table-plus <obj-table-plus
v-show="modalData.specType == 1" v-show="specType == 1"
style="height: calc(100vh - 120px - 240px)" style="height: calc(100vh - 120px - 240px)"
slot="dialog__after" slot="dialog__after"
ref="oTable" ref="oTable"
@ -50,6 +50,7 @@ export default {
width: "60%", width: "60%",
}, },
modalData: {}, modalData: {},
specType: "",
}; };
}, },
methods: { methods: {
@ -79,14 +80,18 @@ export default {
}; };
}, },
init(row) { init(row) {
this.modalData = row; this.specType = row.specType;
this.modalData = {
id: row.id,
productSpecificationList: row.productSpecificationList,
};
this.tableData = row.productSpecificationList; this.tableData = row.productSpecificationList;
console.log(this.modalData); console.log(this.modalData);
}, },
}, },
computed: { computed: {
modalCols() { modalCols() {
if (this.modalData.specType == 0) { if (this.specType == 0) {
return [ return [
{ {
label: "库存", label: "库存",
@ -154,7 +159,7 @@ export default {
type: "primary", type: "primary",
submit: true, submit: true,
handle: debounce(() => { handle: debounce(() => {
if (this.modalData.specType == 0) { if (this.specType == 0) {
this.$api.mer_admin this.$api.mer_admin
.saveProductBase(this.modalData) .saveProductBase(this.modalData)
.then((res) => { .then((res) => {