diff --git a/application/admin/view/shopro/goods/goods/select.html b/application/admin/view/shopro/goods/goods/select.html
index ca3d1d5..d64fae9 100755
--- a/application/admin/view/shopro/goods/goods/select.html
+++ b/application/admin/view/shopro/goods/goods/select.html
@@ -126,9 +126,10 @@
placeholder="请输入搜索内容">
-
-
+
+
+
+
diff --git a/public/assets/js/backend/shopro/config.js b/public/assets/js/backend/shopro/config.js
index c92bf38..f9cfe3a 100755
--- a/public/assets/js/backend/shopro/config.js
+++ b/public/assets/js/backend/shopro/config.js
@@ -156,9 +156,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}
// 物流配置
- const area = reactive({
- select: []
- })
+ // const area = reactive({
+ // select: []
+ // })
function getAreaSelect() {
Fast.api.ajax({
url: 'shopro/data/area/select',
diff --git a/public/assets/js/backend/shopro/goods/goods.js b/public/assets/js/backend/shopro/goods/goods.js
index 82d26b5..fd39844 100755
--- a/public/assets/js/backend/shopro/goods/goods.js
+++ b/public/assets/js/backend/shopro/goods/goods.js
@@ -1071,6 +1071,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
setup() {
const { proxy } = getCurrentInstance();
+ const { ElMessage } = ElementPlus
+
const state = reactive({
data_type: new URLSearchParams(location.search).get('data_type'),
multiple: new URLSearchParams(location.search).get('multiple') || false,
@@ -1091,7 +1093,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
tools: {},
},
})
- state.ids = state.ids ? state.ids.split(',') : []
+ // state.ids = state.ids ? state.ids.split(',') : []
+ state.ids = state.ids ? state.ids : ''
const category = reactive({
id: '',
@@ -1158,10 +1161,15 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
nextTick(() => {
state.data.forEach((l) => {
- if (state.ids?.includes(l.id + '')) {
- proxy.$refs['multipleTableRef']?.toggleRowSelection(l, true);
- toggleRowSelection('row', [l], l);
+ // if (state.ids?.includes(l.id + '')) {
+ // proxy.$refs['multipleTableRef']?.toggleRowSelection(l, true);
+ // toggleRowSelection('row', [l], l);
+ // }
+ if (state.ids == l.id) {
+ console.log(l)
+ proxy.$refs['singleTableRef'].setCurrentRow(l)
}
+
});
});
return false
@@ -1185,10 +1193,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
console.log('selection', selection)
console.log('row', row.id)
console.log('max', state.max)
- if (
- !state.max ||
- (state.max && state.max > state.ids.length)
- ) {
+ console.log('ids:', state.ids)
+ if (!state.max ||(state.max && state.max > state.ids.length)) {
if (state.ids.includes(row.id + '')) {
let index = state.ids.findIndex((id) => id == row.id);
state.ids.splice(index, 1);
@@ -1235,18 +1241,25 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
}
ElMessage({
type: 'warning',
- message: '已到选择上限',
+ // message: '已到选择上限',
+ message: '只能绑定一个商品',
});
return false;
}
}
- function onSingleSelect(item) {
- Fast.api.close(item)
+ function onSingleSelect(currentRow, oldRow) {
+ state.ids = currentRow.id ?? 0
+ // console.log('row', currentRow.id)
+ // console.log('oldRow', oldRow.id)
+ // console.log('max', state.max)
+ // console.log('ids:', state.ids)
}
function onConfirm() {
- let ids = state.ids.join(',')
+ console.log(state.ids)
+ // let ids = state.ids.join(',')
+ let ids = state.ids
Fast.api.ajax({
url: 'shopro/goods/goods/select',
type: 'GET',