This commit is contained in:
qiaopengfei 2024-08-02 08:56:45 +08:00
parent 4c4c44ce88
commit cf81f2265e
17 changed files with 1925 additions and 2006 deletions

View File

@ -1,6 +1,6 @@
VITE_MODE = 'development' VITE_MODE = 'development'
VITE_APP_BASE_API = 'https://122.228.26.226:12025' VITE_APP_BASE_API = 'http://192.168.2.5:9999'
# VITE_APP_BASE_API = 'https://pre-api.aiguoerp.com' # VITE_APP_BASE_API = 'https://pre-api.aiguoerp.com'
# VITE_APP_BASE_API = 'http://localhost:80' # VITE_APP_BASE_API = 'http://localhost:80'

View File

@ -0,0 +1,57 @@
import request from '@axioshooks';
// 获取商品管理列表
export function select_by_conditions(data) {
return request({
url: 'xy_openapi/commodity_info/select_by_conditions',
method: 'post',
data
})
}
// 编辑商品(查询)
export function get_commodity_id(data) {
return request({
url: `xy_openapi/commodity_info/get_commodity_id/${data}`,
method: 'get',
data
})
}
// 编辑商品
export function edit_product(data) {
return request({
url: `xy_openapi/commodity_info/edit_product`,
method: 'put',
data
})
}
// 复制商品
export function get_commodity(data) {
return request({
url: `xy_openapi/commodity_info/get_commodity`,
method: 'get',
data
})
}
// 上架
export function publish(data) {
return request({
url: `xy_openapi/commodity_info/publish/${data}`,
method: 'get',
data
})
}
// 下架
export function pull_off(data) {
return request({
url: `xy_openapi/commodity_info/pull_off/${data}`,
method: 'get',
data
})
}
// 删除
export function delete_one(data) {
return request({
url: `xy_openapi/commodity_info/delete_one/${data}`,
method: 'delete',
data
})
}

View File

@ -28,6 +28,9 @@ export function uploadImage(data) {
return request({ return request({
url: 'xy_openapi/publish/uploadImage', url: 'xy_openapi/publish/uploadImage',
method: 'file', method: 'file',
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data data
}) })
} }
@ -39,3 +42,27 @@ export function region(data) {
data data
}) })
} }
//获取成色
export function qualityList(data) {
return request({
url: 'xy_openapi/quality/list',
method: 'get',
data
})
}
//获取发布默认地址
export function address_default(data) {
return request({
url: `xy_openapi/sender/default/${data}`,
method: 'get',
data
})
}
//商品发布
export function publish_shelve(data) {
return request({
url: 'xy_openapi/publish/shelve',
method: 'post',
data
})
}

View File

@ -0,0 +1,57 @@
<template>
<div>
<div v-for="(item, index) in props.ButtonList" :key="index">
<el-link
v-if="item.show && item.AssemblyName === 'el-link'"
:type="item.type"
:icon="item.icon"
:href="item.href"
:target="item.target"
:disabled="item.disabled"
:underline="item.underline ? true : false"
@click="item.confirm(props.row, item)"
>{{ item.name }}</el-link
>
<el-popconfirm
v-if="item.show && item.AssemblyName === 'el-popconfirm'"
:title="item.title"
:confirm-button-text="item.confirmText"
:cancel-button-text="item.cancelText"
:confirm-button-type="item.confirmType"
:cancel-button-type="item.cancelType"
:icon="item.popconfirmIcon"
:icon-color="item.iconColor"
:hide-icon="item.hideIcon"
@confirm="item.confirm(props.row, item)"
@cancel="item.cancel(props.row, item)"
>
<template #reference>
<el-link
:type="item.type"
:icon="item.icon"
:underline="item.underline ? true : false"
>{{ item.name }}</el-link
>
</template>
</el-popconfirm>
</div>
</div>
</template>
<script setup>
import { defineProps } from "vue";
const props = defineProps({
ButtonList: {
type: Array,
default: [],
},
row: {
type: Object,
default: {},
},
});
</script>
<style scoped lang='scss'>
</style>

View File

@ -0,0 +1,54 @@
<template>
<div class="calculation">
<div>
<!-- <span style="font-weight: bold; padding: 0 10px">本页信息:</span>
<span style="padding: 0 10px">总定价:{{ total_cost }}</span> -->
</div>
<div class="block">
<el-pagination
v-bind="attrs"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
></el-pagination>
</div>
</div>
</template>
<script setup>
import { defineEmits, computed, useAttrs } from "vue";
const $emit = defineEmits(["handleSizeChange", "handleCurrentChange"]);
const $attrs = useAttrs();
const attrs = computed(() => {
return {
"page-size": 20,
"page-sizes": [20, 50, 100, 200],
layout: "total, sizes, prev, pager, next, jumper",
...$attrs,
};
});
//
const handleSizeChange = () => {
$emit("handleSizeChange");
};
//
const handleCurrentChange = () => {
$emit("handleCurrentChange");
};
</script>
<style scoped lang='scss'>
.calculation {
height: 50px;
border: 1px solid #ebeef5;
padding: 10px;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
background: #fff;
::v-deep .el-pagination .el-input__suffix {
right: -18px;
}
}
</style>

View File

@ -0,0 +1,175 @@
<template>
<div class="text-msg-pic-upload">
<el-upload
ref="upload"
list-type="picture-card"
:class="{ display: data.uploadDisabled }"
v-model:file-list="tempFileList"
:multiple="props.multiple"
:auto-upload="props.autoUpload"
:on-exceed="handleExceed"
:on-change="onChange"
:show-file-list="props.limit > 1 || !props.limit"
accept="image/jpeg,image/png,image/gif,image/jpg"
>
<el-icon v-if="props.limit > 1 || tempFileList.length == 0"
><Plus
/></el-icon>
<img
:src="tempFileList[0].url"
v-if="props.limit == 1 && tempFileList.length > 0"
class="showimg"
/>
<template #file="{ file }">
<div>
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
<span class="el-upload-list__item-actions">
<span
class="el-upload-list__item-preview"
@click="hImgPreview(file)"
>
<el-icon><zoom-in /></el-icon>
</span>
<span
class="el-upload-list__item-delete"
@click="handleRemove(file)"
>
<el-icon><Delete /></el-icon>
</span>
</span>
</div>
</template>
</el-upload>
<el-dialog v-model="data.dialogVisible" append-to-body>
<img width="100%" :src="data.dialogImageUrl" alt="" />
</el-dialog>
<!-- <div class="Upload_pictures">
<ul class="el-upload__tip cBBBDBF" style="color: #bbbdbf">
<li>支持PNGJEPG格式 不超过2MB</li>
</ul>
</div> -->
</div>
</template>
<script setup>
import { ref, reactive, watch, computed } from "vue";
import { ElMessage } from "element-plus";
import { Delete, Download, Plus, ZoomIn } from "@element-plus/icons-vue";
const $emit = defineEmits(["onSuccessFiles"]);
const props = defineProps({
limitType: {
type: Array,
default: ["jpeg", "jpg", "gif", "png"],
}, //
autoUpload: Boolean,
limit: Number, //
imgList: Array, //
multiple: Boolean, //
});
const data = reactive({
// el-upload使
uploadDisabled: false,
dialogImageUrl: "",
dialogVisible: false,
});
const tempFileList = ref([]);
watch(
props,
(newval) => {
if (Array.isArray(props.imgList)) {
tempFileList.value = props.imgList;
}
},
{ deep: true, immediate: true }
);
computed(() => {
return props.autoUpload ? "上传文件" : "选择文件";
});
//
const hImgPreview = (file) => {
data.dialogImageUrl = file.url;
data.dialogVisible = true;
};
//
const handleRemove = (file) => {
if (tempFileList.value) {
const list = tempFileList.value.filter((f) => f.url != file.url);
$emit("onSuccessFiles", list);
} else {
$emit("onSuccessFiles", []);
}
return true;
};
const onChange = (file) => {
if (!file || !file.raw) {
return;
}
let types = props.limitType;
const isImage = types.find((f) => file.raw.type.includes(f));
const isLt20M = file.raw.size / 1024 / 1024 < 2;
if (!isImage && props.limit > 1) {
ElMessage(
types.length == 0
? "上传图片只能是 PNG 格式!"
: "上传图片只能是 JPG、PNG 格式!"
);
return false;
}
if (!isLt20M) {
ElMessage("上传图片大小不能超过 2MB!");
return false;
}
if (props.limit == 1) {
tempFileList.value = [];
}
handleUpload({ file: file });
return false;
};
//
const handleUpload = (op, filelist) => {
if (props.limit == 1) {
tempFileList.value = [];
setTimeout(() => {
tempFileList.value = [op.file];
}, 100);
}
$emit("onSuccessFiles", op.file);
};
const handleExceed = (files, fileList) => {
ElMessage(
`当前限制选择 ${props.limit} 个文件,本次选择了 ${
files.length
} 个文件共选择了 ${files.length + fileList.length} 个文件`
);
};
</script>
<style lang="scss">
.text-msg-pic-upload .el-upload--picture-card,
.text-msg-pic-upload .el-upload-list--picture-card .el-upload-list__item {
width: 62px;
height: 62px;
line-height: 72px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 10px 0 0;
}
.showimg {
width: 60px;
height: 60px;
}
.display .el-upload--picture-card {
display: none;
}
.el-upload-list__item-delete {
margin-left: 10px !important;
}
</style>

View File

@ -1,32 +1,25 @@
<template> <template>
<div class="text-msg-pic-upload"> <div class="upload_box">
<el-upload <el-upload
ref="upload" action="#"
list-type="picture-card" list-type="picture-card"
:class="{ display: data.uploadDisabled }" v-model:file-list="fileList"
v-model:file-list="tempFileList" :class="{ display: fileList.length >= props.limit }"
:http-request="handleUpload"
:multiple="props.multiple" :multiple="props.multiple"
:auto-upload="props.autoUpload" :before-upload="beforeUpload"
:on-exceed="handleExceed" :limit="props.limit"
:on-change="onChange" :on-exceed="onExceed"
:show-file-list="props.limit > 1 || !props.limit" :accept="props.limitType"
accept="image/jpeg,image/png,image/gif,image/jpg"
> >
<el-icon v-if="props.limit > 1 || tempFileList.length == 0" <el-icon><Plus /></el-icon>
><Plus
/></el-icon>
<img
:src="tempFileList[0].url"
v-if="props.limit == 1 && tempFileList.length > 0"
class="showimg"
/>
<template #file="{ file }"> <template #file="{ file }">
<div> <div>
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" /> <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
<span class="el-upload-list__item-actions"> <span class="el-upload-list__item-actions">
<span <span
class="el-upload-list__item-preview" class="el-upload-list__item-preview"
@click="hImgPreview(file)" @click="handlePreview(file)"
> >
<el-icon><zoom-in /></el-icon> <el-icon><zoom-in /></el-icon>
</span> </span>
@ -40,119 +33,157 @@
</div> </div>
</template> </template>
</el-upload> </el-upload>
<el-dialog v-model="data.dialogVisible" append-to-body> <el-dialog v-model="data.dialogVisible">
<img width="100%" :src="data.dialogImageUrl" alt="" /> <img
w-full
style="width: 100%; height: 100%"
:src="data.dialogImageUrl"
alt="Preview Image"
/>
</el-dialog> </el-dialog>
<!-- <div class="Upload_pictures">
<ul class="el-upload__tip cBBBDBF" style="color: #bbbdbf">
<li>支持PNGJEPG格式 不超过2MB</li>
</ul>
</div> -->
</div> </div>
</template> </template>
<script setup> <script setup>
import { ref, reactive, watch, computed } from "vue";
import { ElMessage } from "element-plus";
import { Delete, Download, Plus, ZoomIn } from "@element-plus/icons-vue"; import { Delete, Download, Plus, ZoomIn } from "@element-plus/icons-vue";
const $emit = defineEmits(["onSuccessFiles"]); import { ref, reactive } from "vue";
import { ElMessage } from "element-plus";
import { Form } from "vant";
const $emit = defineEmits([""]);
const upload = ref(null);
const props = defineProps({ const props = defineProps({
multiple: {
//
type: Boolean,
default: false,
},
autoUpload: {
//
type: Boolean,
default: true,
},
limitType: { limitType: {
//
type: Array, type: Array,
default: ["jpeg", "jpg", "gif", "png"], default: ["jpeg", "jpg", "gif", "png"],
}, // },
autoUpload: Boolean, limit: {
limit: Number, // //
imgList: Array, // type: Number,
multiple: Boolean, // default: 10,
},
imgList: {
//
type: Array,
default: [],
},
style: {
type: Object,
default: {},
},
}); });
const data = reactive({ const data = reactive({
// el-upload使
uploadDisabled: false,
dialogImageUrl: "", dialogImageUrl: "",
dialogVisible: false, dialogVisible: false,
uploadDisabled: false,
}); });
const params = ref([]); //
const tempFileList = ref([]); const fileList = ref(props.imgList); //
const uploadingPromises = ref([]);
watch( // fileList
props, const beforeUpload = (file) => {
(newval) => { const isAllowedType = props.limitType.includes(
if (Array.isArray(props.imgList)) { file.type.split("/")[1].toLowerCase()
tempFileList.value = props.imgList; );
} const isLt30M = file.size / 1024 / 1024 < 2;
}, if (!isAllowedType) {
{ deep: true, immediate: true } ElMessage.warning(
); `${file.name}图片格式不正确请上传jpeg/jpg/png格式的图片`
computed(() => {
return props.autoUpload ? "上传文件" : "选择文件";
});
//
const hImgPreview = (file) => {
data.dialogImageUrl = file.url;
data.dialogVisible = true;
};
//
const handleRemove = (file) => {
if (tempFileList.value) {
const list = tempFileList.value.filter((f) => f.url != file.url);
$emit("onSuccessFiles", list);
} else {
$emit("onSuccessFiles", []);
}
return true;
};
const onChange = (file) => {
if (!file || !file.raw) {
return;
}
let types = props.limitType;
const isImage = types.find((f) => file.raw.type.includes(f));
const isLt20M = file.raw.size / 1024 / 1024 < 2;
if (!isImage && props.limit > 1) {
ElMessage(
types.length == 0
? "上传图片只能是 PNG 格式!"
: "上传图片只能是 JPG、PNG 格式!"
); );
return false; return false;
} }
if (!isLt20M) { if (!isLt30M) {
ElMessage("上传图片大小不能超过 2MB!"); ElMessage.warning(`${file.name}上传图片大小不能超过 3MB!`);
return false; return false;
} }
if (props.limit == 1) { //
tempFileList.value = []; return true; //
}
handleUpload({ file: file });
return false;
}; };
// const handlePreview = (uploadFile) => {
const handleUpload = (op, filelist) => { data.dialogImageUrl = uploadFile.url;
if (props.limit == 1) { data.dialogVisible = true;
tempFileList.value = [];
setTimeout(() => {
tempFileList.value = [op.file];
}, 100);
}
$emit("onSuccessFiles", op.file);
}; };
const handleRemove = (file) => {
const handleExceed = (files, fileList) => { if (fileList.value && Array.isArray(fileList.value)) {
ElMessage( const deleteList = fileList.value.filter((f) => f.url === file.url);
const updatedList = fileList.value.filter((f) => f.url !== file.url);
fileList.value = updatedList;
$emit("handleRemove", deleteList);
} else {
$emit("handleRemove", []);
}
return true;
};
const onExceed = (files, fileList) => {
ElMessage.warning(
`当前限制选择 ${props.limit} 个文件,本次选择了 ${ `当前限制选择 ${props.limit} 个文件,本次选择了 ${
files.length files.length
} 个文件共选择了 ${files.length + fileList.length} 个文件` } 个文件共选择了 ${files.length + fileList.length} 个文件`
); );
}; };
//
const handleUpload = (file) => {
//
const uploadPromise = new Promise((resolve, reject) => {
setTimeout(() => {
//
//
resolve(file);
//
// reject(new Error(''));
}, 500); // 1
});
// Promise便
uploadingPromises.value.push(uploadPromise);
//
uploadPromise
.then(() => {
// Promise
const index = uploadingPromises.value.indexOf(uploadPromise);
if (index !== -1) {
uploadingPromises.value.splice(index, 1);
}
//
if (uploadingPromises.value.length === 0) {
//
allFilesUploaded();
}
})
.catch((error) => {
console.error("上传失败:", error);
//
// Promise
});
};
//
const allFilesUploaded = () => {
params.value = [];
for (var i = 0; i < fileList.value.length; i++) {
params.value.push(fileList.value[i].raw);
}
$emit("onSuccessFiles", params.value);
};
</script> </script>
<style lang="scss"> <style scoped lang='scss'>
.text-msg-pic-upload .el-upload--picture-card, ::v-deep {
.text-msg-pic-upload .el-upload-list--picture-card .el-upload-list__item { .el-upload--picture-card,
.el-upload-list--picture-card .el-upload-list__item {
width: 62px; width: 62px;
height: 62px; height: 62px;
line-height: 72px; line-height: 72px;
@ -160,16 +191,16 @@ const handleExceed = (files, fileList) => {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin: 0 10px 0 0; margin: 0 10px 0 0;
} }
.showimg { .showimg {
width: 60px; width: 60px;
height: 60px; height: 60px;
} }
.display .el-upload--picture-card { .display .el-upload--picture-card {
display: none; display: none;
} }
.el-upload-list__item-delete { .el-upload-list__item-delete {
margin-left: 10px !important; margin-left: 10px !important;
}
} }
</style> </style>

View File

@ -1,68 +1,113 @@
<template> <template>
<div class="saletopbox"> <div class="saletopbox">
<div class="inputbox" v-for="item,index in inputdatas" :key="String(index)"> <div
class="inputbox"
v-for="(item, index) in inputdatas"
:key="String(index)"
>
<el-input <el-input
clearable clearable
v-if="item.type=='el-input'" v-if="item.type == 'el-input'"
v-model="item.value" v-model="item.value"
size="large"
class="topinput" class="topinput"
:placeholder="item.placeholder" :placeholder="item.placeholder"
> >
<template #suffix v-if="item.popover"> <template #suffix v-if="item.popover">
<el-popover <el-popover
placement="bottom-start" placement="bottom-start"
:visible="imeipopover[index]" :visible="imeipopover[index]"
:width="200" :width="200"
trigger="click"> trigger="click"
>
<template #reference> <template #reference>
<i <i
class="iconfont icon-icon-piliangcaozuo imeiicondefault" class="iconfont icon-icon-piliangcaozuo imeiicondefault"
:class="imeipopover ? 'imeiiconActive' : 'imeiicon'" :class="imeipopover ? 'imeiiconActive' : 'imeiicon'"
style="font-size: 12px;" style="font-size: 12px"
@click.prevent="imeiiconClick(index)" @click.prevent="imeiiconClick(index)"
></i> ></i>
</template> </template>
<el-input placeholder="一行一项,最多支持200行" type="textarea" :rows="12" style="border:none" v-model="item.value"/> <el-input
placeholder="一行一项,最多支持200行"
type="textarea"
:rows="12"
style="border: none"
v-model="item.value"
/>
<div class="popoverfooter"> <div class="popoverfooter">
<el-button size="small" @click.stop="imeipopover[index]=false">关闭</el-button> <el-button size="small" @click.stop="imeipopover[index] = false"
<el-button size="small" @click.stop="item.value=''">清空</el-button> >关闭</el-button
<el-button size="small" type="primary" @click.stop="onSearch">查询</el-button> >
<el-button size="small" @click.stop="item.value = ''"
>清空</el-button
>
<el-button size="small" type="primary" @click.stop="onSearch"
>查询</el-button
>
</div> </div>
</el-popover > </el-popover>
</template> </template>
</el-input> </el-input>
<el-select
style="width: 155px"
v-if="item.type === 'el-select'"
v-model="item.value"
:clearable="true"
:placeholder="item.placeholder"
><el-option
v-for="item in item.options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option
></el-select>
</div> </div>
<el-button type="primary" @click.stop="onSearch">查询</el-button> <el-button type="primary" @click.stop="onSearch">查询</el-button>
<el-button @click.stop="onRest">重置</el-button> <el-button @click.stop="onRest">重置</el-button>
<el-popover <el-popover
v-if="extrainputs.length>0" v-if="extrainputs.length > 0"
placement="bottom-start" placement="bottom-start"
:visible="extrapopover" :visible="extrapopover"
:width="450" width=""
trigger="click"> trigger="click"
>
<template #reference> <template #reference>
<el-button @click="extrapopover = !extrapopover">更多选项</el-button> <el-button @click="extrapopover = !extrapopover">更多选项</el-button>
</template> </template>
<div class="extrabox"> <div class="extrabox">
<div v-for="item,index in extrainputs" :key="String(index)" class="extraitem"> <div
<div class="extraitemtitle">{{item.title}}</div> v-for="(item, index) in extrainputs"
:key="String(index)"
class="extraitem"
>
<div class="extraitemtitle">{{ item.title }}</div>
<el-input <el-input
clearable clearable
v-if="item.type=='el-input'" v-if="item.type == 'el-input'"
v-model="item.value" v-model="item.value"
size="large"
class="topinput" class="topinput"
:placeholder="item.placeholder" :placeholder="item.placeholder"
> >
</el-input> </el-input>
<el-select
v-if="item.type === 'el-select'"
v-model="item.value"
:clearable="true"
:placeholder="item.placeholder"
><el-option
v-for="item in item.options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option
></el-select>
<el-date-picker <el-date-picker
v-if="item.type=='el-date-picker'" v-if="item.type == 'el-date-picker'"
v-model="item.value" v-model="item.value"
:style="{ width: item.width }" :style="{ width: item.width }"
size="large" type="daterange"
type="datetimerange"
start-placeholder="开始时间" start-placeholder="开始时间"
end-placeholder="结束时间" end-placeholder="结束时间"
range-separator="至" range-separator="至"
@ -70,99 +115,101 @@
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
:default-time="[ :default-time="[
new Date(0, 0, 0, 0, 0, 0), new Date(0, 0, 0, 0, 0, 0),
new Date(0, 0, 0, 23, 59, 59) new Date(0, 0, 0, 23, 59, 59),
]" ]"
/> />
</div> </div>
</div> </div>
<div class="extrafooter"> <div class="extrafooter">
<el-button size="small" @click.stop="onCancelExtra">取消</el-button> <el-button @click.stop="onCancelExtra">取消</el-button>
<el-button type="primary" size="small" @click.stop="onSearch">查询</el-button> <el-button type="primary" @click.stop="onSearch">查询</el-button>
</div> </div>
</el-popover> </el-popover>
</div> </div>
</template> </template>
<script setup> <script setup>
import {markRaw,ref,computed} from 'vue'; import { markRaw, ref, computed } from "vue";
import {ElInput} from "element-plus"; import { ElInput } from "element-plus";
const props=defineProps(['inputs']); const props = defineProps(["inputs"]);
const $emit=defineEmits(['onSrarch','onRest']); const $emit = defineEmits(["onSrarch", "onRest"]);
const extrapopover=ref(false); const extrapopover = ref(false);
const extrainputs=ref([]); const extrainputs = ref([]);
const inputdatas=computed(()=>{ const inputdatas = computed(() => {
if(props.inputs.length>2){ if (props.inputs.length > 2) {
const filters=props.inputs.slice(2,props.inputs.length); const filters = props.inputs.slice(2, props.inputs.length);
extrainputs.value=filters; extrainputs.value = filters;
return props.inputs.slice(0,2); return props.inputs.slice(0, 2);
} }
return props.inputs; return props.inputs;
}); });
const imeipopover=ref([false]); const imeipopover = ref([false]);
const imeiiconClick=(index)=>{ const imeiiconClick = (index) => {
imeipopover.value[index]=true; imeipopover.value[index] = true;
} };
const defaultTime1 = new Date(2000, 1, 1, 12, 0, 0) const defaultTime1 = new Date(2000, 1, 1, 12, 0, 0);
const onSearch=()=>{ const onSearch = () => {
const result={}; const result = {};
console.log(inputdatas.value,extrainputs.value); inputdatas.value.map((h) => {
inputdatas.value.map((h)=>{ if (h.type == "el-input") {
result[h.name]=h.value.replace('\n',','); result[h.name] = h.value.replace("\n", ",");
}); } else {
extrainputs.value.map((h)=>{ result[h.name] = h.value;
if(h.type == 'el-input'){ console.log(result[h.name], "result[h.name]", h.value);
result[h.name]=h.value.replace('\n',',');
}else if (h.type == 'el-date-picker'){
result[h.name]=h.value;
} }
}); });
console.log(result,'result'); extrainputs.value.map((h) => {
$emit('onSearch',result); if (h.type == "el-input") {
extrapopover.value = !extrapopover; result[h.name] = h.value.replace("\n", ",");
} } else {
result[h.name] = h.value;
const onRest=()=>{ }
const result={};
extrainputs.value.map((h)=>{
h.value="";
result[h.name]='';
}); });
inputdatas.value.map((h)=>{ $emit("onSearch", result);
h.value="";
result[h.name]='';
});
$emit('onRest',result);
}
const onCancelExtra=()=>{
extrapopover.value = !extrapopover; extrapopover.value = !extrapopover;
} };
const onRest = () => {
const result = {};
extrainputs.value.map((h) => {
h.value = "";
result[h.name] = "";
});
inputdatas.value.map((h) => {
h.value = "";
result[h.name] = "";
});
$emit("onRest", result);
};
const onCancelExtra = () => {
extrapopover.value = !extrapopover;
};
</script> </script>
<style lang="scss"> <style lang="scss">
.saletopbox{ .saletopbox {
background: #fff; background: #fff;
padding:20px; padding: 5px 20px 20px;
box-sizing: border-box; box-sizing: border-box;
display:flex; display: flex;
align-items:center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
gap: 10px; gap: 10px;
} }
.inputbox{ .inputbox {
display:flex; display: flex;
align-items:center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
} }
.imeiicondefault{ .imeiicondefault {
height:26px; height: 20px;
width:26px; width: 20px;
box-sizing: border-box; box-sizing: border-box;
border-radius: 4px; border-radius: 4px;
background: #f0f2f5; background: #f0f2f5;
@ -170,30 +217,29 @@ const onCancelExtra=()=>{
align-items: center; align-items: center;
justify-content: center; justify-content: center;
cursor: pointer; cursor: pointer;
}
.extraitem {
.extraitemtitle {
font-size: 13px;
margin-bottom: 5px;
color: #101010;
} }
.extraitem{ }
.extrabox {
.extraitemtitle{
font-size:13px;
margin-bottom:5px;
color:#101010;
}
}
.extrabox{
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
grid-gap: 10px; grid-gap: 10px;
} }
.extrafooter{ .extrafooter {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
margin-top:12px; margin-top: 12px;
} }
.popoverfooter{ .popoverfooter {
margin-top:15px; margin-top: 15px;
display: grid; display: grid;
grid-template-columns: 1fr 1fr 1fr; grid-template-columns: 1fr 1fr 1fr;
grid-gap:5px; grid-gap: 5px;
} }
</style> </style>

View File

@ -1,707 +1,362 @@
<template> <template>
<div class="tabblebox"> <div class="table-box">
<vxe-table
ref="Table"
<el-table size="large" :data="tabledata" :span-method="colspanMethod" :loading="props.loading" :width="1046" :height="height" @selection-change="handleSelectionChange" > height="auto"
<el-table-column type="selection" width="55" v-if="selectState"> :data="newtableData"
<template #default="scope"> :loading="props.TabLoading"
<span v-if="!scope.row.render"> </span> :span-method="colspanMethod"
</template> :checkbox-config="{
</el-table-column> checkField: 'checked',
<el-table-column v-for="item,index in tablecolumns" :key="String(index)" :fixed="item.fixed" :fit="true" table-layout="fixed" :sortable="item?.sortable" :prop="item?.dataKey" :label="item?.title" :width="item?.width" style="width: 100%" > checkMethod: checkMethodEvent,
visibleMethod: visibleMethodEvent,
<template #default="scope"> }"
<span v-if="scope.row.render" class="firstspan"> row-class-name="table_row"
<span v-if="scope.row.quality_inspection_code"> header-row-class-name="tablehead"
<span > 质检码{{ scope.row.quality_inspection_code }} </span> @checkbox-all="selectAllEvent"
</span> @checkbox-change="selectEvent"
<span v-if="scope.row.sales_order_number">销售单号{{ scope.row.sales_order_number }}</span> >
<span v-if="scope.row.after_sales_order_number">售后订单号{{ scope.row.after_sales_order_number }}</span> <vxe-column type="checkbox" width="50" :border="false"></vxe-column>
<span v-if=" <vxe-column
scope.row.publish_time && /^\d{10}$|^\d{13}$/.test(scope.row.publish_time) v-for="(item, index) in props.TableLabel"
">发布时间{{ :key="index"
scope.row.publish_time :title="item.label"
}}</span> :field="item.param"
<span v-if="scope.row.last_truename">最近翻库人{{ scope.row.last_truename }}</span> :fixed="item.fixed"
<span v-if="scope.row.last_publish_time">最近翻库日期{{ :min-width="item.minwidth"
scope.row.last_publish_time :visible="item.show && !item.hasOwnProperty('display')"
}}</span> align="center"
<span v-if="scope.row.buyer_nick">买家昵称{{ scope.row.buyer_nick }}</span> >
</span> <template #default="{ row }">
<span v-else-if="!scope.row.render"> <div v-if="row.render" class="Top-box">
<div v-if="item.title === '机器信息'" class="machineinfo"> <div class="box" style="flex-wrap: wrap">
<p v-if="scope.row.brand_name||scope.row.model_name||scope.row.rom_name||scope.row.color_name"> <div
{{ scope.row.brand_name }} {{ scope.row.model_name }} {{ scope.row.rom_name }} v-for="(el, io) in headerData.left"
{{ scope.row.color_name }} :key="io"
</p> class="box_item"
<p>{{scope.row.machine_name}}</p> >
<div class="info"> <ul v-if="row[el.param] && el.show">
<div class="info-left"> <li v-if="el.link">
<el-popover v-if="scope.row['goods_img']" placement="right" width="375" trigger="click"> <span>{{ el.label }}:</span>{{ row[el.param] }}
<template #reference> </li>
<img v-if="scope.row['goods_img']" style="float: left; height: 70px" :src="scope.row['goods_img']" /> <li v-else>
</template> <span>{{ el.label }}:</span>{{ row[el.param] }}
<img v-if="scope.row['goods_img']" style="height: 350px" :src="scope.row['goods_img']" />
</el-popover>
<img v-else style="float: left; height: 70px" src="./../assets/noimg.jpg" />
</div>
<ul class="info-right">
<li>
<span v-if="item.link" style="display: flex; align-items: center">
机器编号
<el-link :underline="false" type="primary" @dblclick.stop="jump(scope.row, '机器编号')">{{
scope.row.serial_number }}</el-link>
</span>
<span v-else> 机器编号{{ scope.row.serial_number }} </span>
</li> </li>
<li>IMEI{{ scope.row.imei1 }}</li>
<li>IMEI2{{ scope.row.imei2 }}</li>
<li>SN:{{ scope.row.sn }}</li>
</ul> </ul>
</div> </div>
</div> </div>
<span v-else-if="item.title === '机器成色'"> <div class="box" style="flex-shrink: 0">
{{ <div v-for="(el, io) in headerData.right" :key="io">
Number(scope.row.stuff_status) > 0 <div class="op_status" v-if="el.label == '创建时间'">
? scope.row.stuff_status + "新" <span class="circular">{{ "在库状态" }}</span>
: scope.row.stuff_status
}}
</span>
<span v-else-if="
item.title === '机器状态' ||
item.title === '订单状态' ||
item.title === '商品状态'
">
<el-tag>{{ scope.row[item.dataKey] || "/" }}</el-tag>
</span>
<span v-else-if="item.title === '订单价格\n(利润)'">
<span style="display: block">{{ scope.row.payment / 100 }}</span>
<span :class="scope.row.payment / 100 - scope.row.total_cost > 0 ? 'red' : 'green'
">{{
(scope.row.payment / 100 - Number(scope.row.total_cost)).toFixed(2)
}}</span>
</span>
<span v-else-if="item.title == '质检报告'" class="look">
<el-link :underline="false" type="primary" @click="lookquily(scope.row, '0')">质检报告</el-link>
<el-link v-if="item.detailshow" :underline="false" type="primary"
@click="lookquily(scope.row, '1')">商品详情</el-link>
</span>
<span v-else-if="item.title == '预计结算价'">
<span :style="6 ? 'color:#ff6b81' : 'color:#2ed573'">{{
Number((scope.row.price * 0.99) / 100).toFixed(2)
}}</span>
</span>
<span v-else-if="item.title == '预估利润'">
<span :style="6 ? 'color:#2ed573' : 'color:#ff6b81'">{{
Number(
(scope.row.price * 0.99) / 100 - scope.row.total_cost - scope.row.ag_server_fee
).toFixed(2)
}}</span>
</span>
<span v-if="item.title=='买家信息'">
<div class="buynametext">{{scope.row.consignee_name||"-"}}</div>
<div class="buynametext"> {{scope.row.consignee_phone}}</div>
<div>{{scope.row.consignee_address}}</div>
</span>
<span v-if="item.title=='收货人/收货时间'">
<div class="buynametext">{{scope.row.receiver||"-"}}</div>
<div > {{scope.row.receive_time}}</div>
</span>
<span v-else-if=" item.title === '订单价格'">
<span>{{ Number(scope.row[item.dataKey].replace(',','')).toFixed(2) }}</span>
</span>
<span v-else-if="
item.title == '退款金额' ||
item.title == '申请退款金额' ||
item.title == '定价' ||
item.title == '保底价'">
<span>{{ Number(scope.row[item.dataKey].replace(',','') / 100).toFixed(2) }}</span>
</span>
<span
v-else-if="
scope.row[item.dataKey] &&
((/^\d{10}$|^\d{13}$/.test(scope.row[item.dataKey]) &&
item.title == '交易成功时间') ||
item.title == '关闭时间' ||
item.title == '退款时间' ||
item.title == '订单创建时间' ||
item.title == '付款时间' ||
item.title == '发货时间' ||
item.title == '首次发布时间' ||
item.title == '申请退款时间')
"
>{{ scope.row[item.dataKey] }}</span>
<div v-else-if="item.title === '快递单号'">
<div>{{ scope.row.refund_post_company }}</div>
<div>{{ scope.row[item.dataKey] }}</div>
</div> </div>
<span v-else-if="item.title == '售前质检报告'"> </div>
<el-button text v-if="scope?.row?.inspect_report?.indexOf('http')>-1" type="primary" @click.stop="jump(scope.row,'质检报告')">质检报告</el-button> </div>
</span> </div>
<span v-else-if="item.title == '质检员'"> <div v-else>
<div>{{ scope.row.quality_inspector_name }}</div> <div v-if="item.label === '商品'">
<el-link :underline="false" type="primary" @click.stop="jump(scope.row,'质检员')" v-if="scope.row.quality_report_id">售后质检报告</el-link> <div class="row_box machineinfo">
<div>{{ scope.row.sale_after_quality_inspection_code }}</div> <div>
</span> <div class="machine_title">
<span v-else-if="item.title == '判责情况'"> <p class="row_text">
<div class="buynametext">{{ scope.row[item.dataKey]?scope.row[item.dataKey]=='2'?'买家责任':'卖家责任':null }}</div> {{ row.title }}
<div>{{scope.row.responsibility_explanation }}</div> </p>
<div v-if="scope.row.responsibility_img"><img :src="scope.row.responsibility_img" style="width:60px;height:60px;"/></div> </div>
</span> <div class="info">
<div class="info-left">
<span v-else-if="item.title == '售后原因'"> <el-popover
<div class="buynametext">{{scope.row.buyer_apply_reason||"-"}}</div> width="250"
<span>{{scope.row.buyer_apply_sub_reason||'-'}}</span> v-if="row.commodityImg"
</span> ref="popoverRef"
<span v-else-if="item.title == '售后状态'"> trigger="click"
<div class="buynametext">{{getStatus(scope.row)}}</div> >
</span> <img style="height: 210px" :src="row.commodityImg" />
<span v-else-if="item.title == '质检员/售后质检报告'"> <template #reference
<el-button text v-if="scope?.row?.inspect_report?.indexOf('http')>-1" type="primary" @click.stop="jump(scope.row,'质检报告')">质检报告</el-button> ><img
</span> :src="row.commodityImg"
<!-- <span v-else-if="item.title == '处理结果'"> style="width: 70px"
{{scope?.row==1 ? "符合" : "不符合"}} alt=""
</span> --> />
<!-- 操作 -->
<span v-else-if="item.title === '操作'" class="operate">
<el-link v-if="
item?.status?.includes('AgreeReturn') &&
scope.row.refund_status === 1 &&
scope.row.need_return_goods === 'true'
" :underline="false" type="primary" @click="operate('AgreeReturn',scope.row)">同意退货</el-link>
<el-link v-if="
item?.status?.includes('AgreeRefund') &&
scope.row.refund_status === 1 &&
scope.row.need_return_goods === 'false'
" :underline="false" type="success" @click="operate('AgreeRefund',scope.row)">同意退款</el-link>
<el-link v-if="
(item?.status?.includes('ConfirmReceipt') &&
scope.row.refund_status === 3) ||
(scope.row.refund_status === 2 && scope.row.need_return_goods === 'true')
" :underline="false" type="primary" @click="operate('ConfirmReceipt',scope.row)">确认收货</el-link>
<el-link v-if="
(item?.status?.includes('RefusalReceipt') &&
scope.row.refund_status === 3) ||
(scope.row.refund_status === 2 && scope.row.need_return_goods === 'true')
" :underline="false" type="danger" @click="operate('RefusalReceipt',scope.row)">拒绝收货</el-link>
<el-popconfirm title="是否拒绝退款?" v-if="
(item?.status?.includes('RefundRefused') &&
scope.row.refund_status === 1) ||
scope.row.refund_status === 3
" @confirm="operate('RefundRefused',scope.row)">
<template #reference>
<el-link type="danger" :underline="false">拒绝退款</el-link>
</template> </template>
</el-popconfirm> </el-popover>
<el-popconfirm title="请确认?" v-if="item?.status?.includes('Agree')" @confirm="operate('Agree',scope.row)"> <img
<template #reference> v-else
<el-link type="primary" :underline="false">同意</el-link> src="../assets/noimg.jpg"
</template> style="width: 70px"
</el-popconfirm> alt=""
<el-link
type="danger"
v-if="item?.status?.includes('Reject')"
@click="operate('Reject',scope.row)"
:underline="false"
>驳回</el-link
>
<el-popconfirm
title="是否重新发布?"
v-if="item?.status?.includes('Republish')"
@confirm="operate('Republish',scope.row)"
>
<template #reference>
<el-link type="primary" :underline="false"
>重新发布</el-link
>
</template>
</el-popconfirm>
<el-button text type="primary" v-if="scope.row?.sale_after_additional_status==2" :underline="false" @click="operate('ConfirmReceipt',scope.row)"
> 手动收货</el-button>
<el-button text type="primary" v-if="scope.row?.sale_after_additional_status==4 && !scope.row.responsibility" :underline="false" @click="operate('Judgment',scope.row)"
> 判责</el-button>
<!-- <el-popconfirm
title="是否人工处理?"
v-if="scope.row?.sale_after_additional_status==7"
@confirm="operate('Processing',scope.row)"
>
<template #reference>
<el-link type="danger" :underline="false"
>人工处理</el-link
>
</template>
</el-popconfirm> -->
<el-link
type="danger"
:underline="false"
v-if="scope.row?.sale_after_additional_status==7"
@click="operate('Processing',scope.row)"
>人工处理</el-link
>
<el-popconfirm
title="是否无实物质检?"
v-if="scope.row?.sale_after_additional_status==3"
@confirm="operate('Quality',scope.row)"
>
<template #reference>
<el-link type="warning" :underline="false"
>无实物质检</el-link
>
</template>
</el-popconfirm>
<el-popconfirm title="是否删除?" v-if="item?.status?.includes('Deletegoods')"
@confirm="operate('Deletegoods',scope.row)">
<template #reference>
<el-link type="danger" :underline="false">删除</el-link>
</template>
</el-popconfirm>
<el-link type="danger" :underline="false" v-if="item?.status?.includes('OffShelf')"
@click="operate('OffShelf',scope.row)">下架</el-link>
<el-link v-if="item?.status?.includes('ChangePrice')" :underline="false" type="primary"
@click="operate('ChangePrice',scope.row)">改价</el-link>
<el-link v-if="item?.status?.includes('AddOrder')" :underline="false" type="primary"
@click="operate('AddOrder',scope.row)">补订单</el-link>
<el-link v-if="item?.status?.includes('CloseTrade')" :underline="false" type="success"
@click="operate('CloseTrade',scope.row)">关闭交易</el-link>
<el-link v-if="item?.status?.includes('Delivery')&&scope.row?.sale_after_additional_status==5" :underline="false" type="primary" @click="operate('Delivery',scope.row)">立即发货</el-link>
<el-link v-if="item?.status?.includes('LogisticsInfo')" :underline="false" type="primary"
@click="operate('LogisticsInfo',scope.row)">物流信息</el-link>
<el-link v-if="item?.status?.includes('Intercept')" :underline="false" type="primary"
@click="operate('Intercept',scope.row)">快递拦截</el-link>
<el-link v-if="item?.status?.includes('Print')" :underline="false" type="primary"
@click="operate('Print',scope.row)">打印面单</el-link>
<el-link type="warning" :underline="false" v-if="item?.status?.includes('Logs')"
@click="operate('Logs',scope.row)">日志</el-link>
<el-link type="success" :underline="false" v-if="item?.status?.includes('GoAudit')"
@click="operate('GoAudit',scope.row)">审核</el-link>
</span>
<span v-else-if="item.title == '备注' && item.fixed == 'right'">
<el-button type="text" icon="vxe-icon-edit" @click="editEvent(scope.row)" />
<span>{{ scope.row.remark }}</span>
</span>
<span v-else-if="item.dataKey!='machine_name'">
{{ scope.row[item.dataKey] ? scope.row[item.dataKey] : "-" }}
</span>
</span>
</template>
</el-table-column>
</el-table>
<div class="tablepagination">
<el-pagination
v-model:current-page="curpage"
v-model:page-size="props.pageSize"
:page-sizes="[10,50,100, 200, 400, 800]"
:disabled="tableloading"
layout="total, sizes, prev, pager, next, jumper"
:total="props.total"
@size-change="props.handleSizeChange"
@current-change="props.handleCurrentChange"
/> />
</div> </div>
<el-dialog v-model="inspect_report.state" title="质检报告" width="30%"> <ul class="info-right">
<div :style="{marginBottom:'10px'}"> <li>{{ row.commodityDes }}</li>
<el-button text type="primary" @click.stop="onCopy(inspect_report.data)">复制链接</el-button> </ul>
</div>
</div> </div>
<iframe :src="inspect_report.data" :height="height1" class="iframbox"/>
</el-dialog>
<el-dialog v-model="afterinspect_report.state" title="质检报告" width="30%">
<div :style="{marginBottom:'10px'}">
<el-button text type="primary" @click.stop="onCopy(baseurl+'/#/qualityreport?quality_report_id='+afterinspect_report.id)">复制链接</el-button>
</div> </div>
<iframe :src="baseurl+'/#/qualityreport?quality_report_id='+afterinspect_report.id" :height="height1" class="iframbox"/>
</el-dialog>
</div> </div>
<div v-else-if="item.label === '操作'" class="row_box operate">
<slot name="OperateButton" :row="row"></slot>
</div>
<div v-else>
<div class="row_box">
{{ row[item.param] ? row[item.param] : "-" }}
</div>
</div>
</div>
</template>
</vxe-column>
</vxe-table>
</div>
</template> </template>
<script setup> <script setup>
import { useRouter } from 'vue-router'; import { ref, defineEmits, defineProps, computed } from "vue";
import { ref, shallowRef, computed,reactive } from 'vue' ; import { Picture as IconPicture } from "@element-plus/icons-vue";
import {copytext} from "@services/commont"; ; const Table = ref(null);
import Qc from "@components/qc/index.vue"; const $emit = defineEmits(["selectAllEvent", "selectEvent"]);
const props = defineProps({
const emit = defineEmits(['Agree', 'Reject','OffShelf','looksLogs','Republish','ChangePrice','Deletegoods','AddOrder','Print','ConfirmReceipt','GoAudit', TableData: {
'AgreeReturn','CloseTrade','delivery','RefundRefused','LogisticsInfo','Intercept','AgreeRefund','RefusalReceipt','quality','processing','judgment','onSelect']) type: Array,
default: [],
const router=useRouter(); },
const inspect_report=reactive({ TableLabel: {
data:"", type: Array,
state:false default: [],
}); },
const afterinspect_report=reactive({ TabLoading: {
data:"", type: Boolean,
state:false, default: false,
url:"/qc.html", },
id:""
});
const props=defineProps(['data','select','spanMethod','columns','spanMethod','currentPage','pageSize','handleSizeChange','handleCurrentChange','disabled','total','loading']);
const selectState=computed(()=>{
return props.select;
});
const tablecolumns = computed(()=>{
return props?.columns||[];
}); });
const curpage=computed(()=>{ const newtableData = computed(() => {
return props.cpage||1; if (props.TableData.length == 0) return;
});
const height=computed(()=>{
return (document.body.clientHeight-300)+'px';
});
const height1=computed(()=>{
return (document.body.clientHeight-400)+'px';
});
const baseurl=ref(import.meta.env.VITE_APP_BASE_SITE);
const tabledata=computed(()=>{
if(props.data&&props.spanMethod){
let tableDate=props.data;
if (tableDate.length == 0) return;
let result = []; let result = [];
const arr = Object.assign([],tableDate); const arr = Object.assign([], props.TableData);
result = arr.map((item) => [{ ...item }, { ...item }]).flat(); result = arr.map((item) => [{ ...item }, { ...item }]).flat();
result.map((e, i) => { result.map((e, i) => {
if (i % 2 === 0) { if (i % 2 === 0) {
e.render=true; e.render = true;
e.checked=false; e.checked = false;
} else { } else {
e.render=false; e.render = false;
} }
}); });
return result; return result;
}else{
return props.data;
}
}); });
const tablelabelLen = computed(() => {
const tablelabelLen=computed(()=>{
let num = 0; let num = 0;
if(props.columns){ props.TableLabel.forEach((item) => {
props.columns.forEach((item) => { if (item.show) {
if (item.show){
num++; num++;
} }
}); });
}
return num; return num;
}); });
const headerData = computed(() => {
const tableloading=computed(()=>{ if (props.TableLabel.length === 0) return;
if(props.loading){ const left = [];
return props.loading; const right = [];
for (const item of props.TableLabel) {
if (item.display === "top_left") {
left.push(item);
} else if (item.display === "top_right") {
right.push(item);
} }
return false; }
}); if (left.length > 0 || right.length > 0) {
const colspanMethod=({ return { left, right };
row, } else {
column, return null;
rowIndex, }
columnIndex, });
})=>{ const colspanMethod = ({ _rowIndex, _columnIndex }) => {
if(props.spanMethod){ if (_rowIndex % 2 === 0) {
if (rowIndex % 2 === 0) { if (_columnIndex === 0) {
if (columnIndex === 0) { return { rowspan: 1, colspan: 1 };
return { rowspan: 0, colspan: 0 }; } else if (_columnIndex === 1) {
} else if (columnIndex === 1) { return { rowspan: 1, colspan: tablelabelLen };
return { rowspan:1, colspan: tablelabelLen.value+2};
} else { } else {
return { rowspan: 0, colspan: 0 }; return { rowspan: 0, colspan: 0 };
} }
} }
}else{ };
return { rowspan: 0, colspan: 0 }; const checkMethodEvent = ({ row }) => {
} return row.render == true;
};
const visibleMethodEvent = ({ row }) => {
return row.render == true;
};
}
const jump=(row, name)=>{
switch (name) {
case "机器编号":
router.push({
path: "/",
query: { xy_product_id: row.xy_product_id },
});
break;
case "质检码":
router.push({
path: "/",
query: { xy_product_id: row.xy_product_id },
});
break;
case "质检员":
afterinspect_report.state=true;
afterinspect_report.data=row;
afterinspect_report.id=row.quality_report_id;
break;
case "质检报告":
inspect_report.state=true;
inspect_report.data=row.inspect_report;
break;
default:
break;
}
}
const onCopy=(str)=>{ //
console.log(str,"str"); const selectAllEvent = (val) => {
copytext(str); $emit("selectAllEvent", val.records);
} };
//
const operate=(val, item)=>{ const selectEvent = (val) => {
let data=item; $emit("selectEvent", val.records);
switch (val) { };
case "Agree": //
emit("Agree", data); const clearCheckboxRow = () => {
break; Table.value.clearCheckboxRow();
case "Reject": };
emit("Reject", data); //
break; const scrollHeight = () => {
case "OffShelf": setTimeout(() => {
emit("OffShelf", data); this.$refs.Table?.scrollTo(0, 0);
break; }, 500);
case "Logs": };
emit("looksLogs", data);
break;
case "ChangePrice":
emit("ChangePrice", data);
break;
case "Republish":
emit("Republish", data);
break;
case "Deletegoods":
emit("Deletegoods", data);
break;
case "AddOrder":
emit("AddOrder", data);
break;
case "CloseTrade":
emit("CloseTrade", data);
break;
case "Delivery":
emit("delivery", data);
break;
case "LogisticsInfo":
emit("LogisticsInfo", data);
break;
case "Intercept":
emit("Intercept", data);
break;
case "AgreeReturn":
emit("AgreeReturn", data);
break;
case "RefundRefused":
emit("RefundRefused", data);
break;
case "AgreeRefund":
emit("AgreeRefund", data);
break;
case "ConfirmReceipt":
emit("ConfirmReceipt", data);
break;
case "RefusalReceipt":
emit("RefusalReceipt", data);
break;
case "Print":
let params = {
tracking_number: data.express_no,
express_company_id: data.express_company_id,
};
emit("Print", params);
break;
case "GoAudit":
emit("GoAudit", data);
break;
case "Quality":
emit('quality',data);
break;
case 'Processing':
emit('processing',data);
break;
case 'Judgment':
emit('judgment',data);
break;
default:
break;
}
}
const getStatus=(item)=>{
let status="-";
switch(item.sale_after_additional_status){
case 1:
status= "等待寄出";
break;
case 2:
status= "待售后收货";
break;
case 3:
status= "待质检";
break;
case 4:
status= "质检完成";
break;
case 5:
status= "判责完成";
break;
case 6:
status= "已寄出待收货";
break;
case 7:
status= "售后异常订单";
break;
case 8:
status= "售后异常订单-已处理";
break;
};
return status;
}
const handleSelectionChange=(value,rel)=>{
const filter=value.filter((f)=>f.render);
console.log(filter,'filter');
emit('onSelect',filter);
}
const lookquily=(row, type)=>{
// xylogdialogVisible.value = true;
// if (type == "0") {
// this.xylogtype = "0";
// this.xylogid = row.id;
// } else {
// this.xylogtype = "1";
// this.xylogid = row.item_id;
// }
}
const editEvent=(row)=>{
const dataToEdit = row.remark;
}
</script> </script>
<style scoped lang="scss">
.tabblebox{
background: #f1f1f1;
padding:20px;
color:#333;
flex:1;
flex-direction: column;
display:flex;
.el-table{
flex:1;
}
}
.tabletitle{
font-size:16px;
color:rgb(96, 98, 102);
<style lang="scss" scoped>
.table-box {
height: calc(100vh - 250px);
} }
.tableheader{
background: #fff; ul,
dl {
margin: 0;
li {
margin-right: 15px;
} }
.tablepagination{
padding:20px; dt {
background: #fff; margin-bottom: 5px;
display:flex;
justify-content: flex-end;
} }
.firstspan {
dd {
margin: 0;
}
}
p {
margin-bottom: 5px;
}
.Top-box {
width: calc(100vw - 340px);
display: flex; display: flex;
align-items: center;
justify-content: space-between;
.box {
display: flex;
flex-wrap: nowrap;
span { .el-link {
margin-right: 20px; vertical-align: baseline !important;
} }
} }
}
.row_box {
padding: 10px;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
min-height: 100px;
}
.row_text {
font-weight: bold;
}
.machineinfo {
justify-content: start;
width: 100%;
.machineinfo { .machine_title {
text-align: left !important; display: flex;
font-weight: 500; align-items: center;
justify-content: space-between;
p {
margin-bottom: 0px;
} }
.info { .info {
display: flex; display: flex;
align-items: center;
margin-top: 5px; .info-left {
width: 70px;
height: 70px;
margin-right: 10px;
}
.info-right { .info-right {
display: flex; color: #606266;
flex-direction: column;
justify-content: center;
margin: 0 0 0 15px;
}
}
} }
.look { li {
display: flex; margin-right: 0px;
flex-direction: column;
} }
}
.operate { }
.operate {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
}
::v-deep {
.tablehead {
height: 50px;
color: #606266;
span { th {
line-height: 20px; border: 1px solid #e8e8e8;
border-right: none;
}
th:last-child {
border-right: 1px solid #e8e8e8;
} }
} }
.vxe-table--body .vxe-cell--checkbox:nth-child(odd) :after { .table_row:nth-child(odd) {
content: ""; td {
position: absolute; background: #ffffff;
top: 0px;
right: -5px;
display: inline-block;
width: 20px;
height: calc(100% - 1px);
background-color: #ffffff;
}
.vxe-body--row.row--hover {
.vxe-cell--checkbox:nth-child(odd) :after {
background-color: #f5f7fa;
} }
} }
/*调整表格 单元格背景颜色*/ .table_row:nth-child(even) {
.vxe-table .vxe-table--body-wrapper, vertical-align: top;
.vxe-table .vxe-table--footer-wrapper {
border: none; td {
background-color: rgba(255, 255, 255); padding: 0;
border: 1px solid #e8eaec;
border-right: none;
background: #f8f8f9;
text-align: left !important;
vertical-align: middle;
.vxe-cell {
padding: 0;
}
} }
.vxe-cell--checkbox:nth-child(odd) { td:last-child {
display: flex; border-right: 1px solid #e8e8e8;
align-items: center; }
justify-content: center;
} }
.vxe-body--row:nth-child(even) { .table_row:nth-child(even):hover {
background-color: rgb(248 248 249); td {
} background: #f5f7fa;
.buynametext{
color:#101010;
font-weight:bold;
}
.iframbox{
border: none;
width:100%;
&::-webkit-scrollbar {
display: none;
} }
} }
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background: #aaaaaa;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 10px;
}
}
</style> </style>

View File

@ -1,5 +1,5 @@
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router' import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import Saleorder from './views/saleorder/index.vue'; import CommodityManagement from './views/CommodityManagement/index.vue';
import NewlyBuiltGoods from './views/NewlyBuiltGoods/index.vue'; import NewlyBuiltGoods from './views/NewlyBuiltGoods/index.vue';
import Home from './views/Home.vue'; import Home from './views/Home.vue';
import QualityWork from './views/qualityWork/index.vue'; import QualityWork from './views/qualityWork/index.vue';
@ -40,11 +40,11 @@ export const routes = [
children: [ children: [
{ {
meta: { meta: {
label: "新建商品", label: "商品管理",
icon: markRaw(Location) icon: markRaw(Location)
}, },
path: '/saleorder', path: '/CommodityManagement',
component: Saleorder, component: CommodityManagement,
}, },
{ {
meta: { meta: {

View File

@ -2,6 +2,7 @@
import axios, * as defaultAxios from 'axios'; import axios, * as defaultAxios from 'axios';
import { getStorage, deloneStorage, jsonurldata } from "./commont"; import { getStorage, deloneStorage, jsonurldata } from "./commont";
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { deepClone } from '../services/commont'
@ -51,7 +52,7 @@ export default ({
// const {promise, resolve, reject} =Promise.withResolvers(); // const {promise, resolve, reject} =Promise.withResolvers();
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const params = new FormData(); const params = new FormData();
let newdatas = typeof (data) == "string" ? data : deepClone(data);
let outerTrigger = trigger; let outerTrigger = trigger;
try { try {
outerTrigger = JSON.stringify(trigger); outerTrigger = JSON.stringify(trigger);
@ -71,12 +72,12 @@ export default ({
var axiosfn = { var axiosfn = {
"delete": (url, paramdata, config) => { "delete": (url, paramdata, config) => {
let newurl = url let newurl = url
let str = data && Object.keys(data).length > 0 ? "/" + jsonurldata(data) : "" let str = newdatas && Object.keys(newdatas).length > 0 ? "/" + jsonurldata(newdatas) : ""
newurl = url + str newurl = url + str
return axios.delete(newurl, config) return axios.delete(newurl, config)
}, "post": axios.post, "get": (url, paramdata, config) => { }, "post": axios.post, "get": (url, paramdata, config) => {
let newurl = url let newurl = url
let str = data && Object.keys(data).length > 0 ? "/" + jsonurldata(data) : "" let str = newdatas && Object.keys(newdatas).length > 0 ? "/" + jsonurldata(newdatas) : ""
newurl = url + str newurl = url + str
return axios.get(newurl, config) return axios.get(newurl, config)
}, "put": axios.put }, "put": axios.put
@ -130,7 +131,6 @@ export default ({
} }
axioshooks = axiosfn[method] ? axiosfn[method] : axios.post axioshooks = axiosfn[method] ? axiosfn[method] : axios.post
// console.log(config,"config") // console.log(config,"config")
if (!url || !dispatchEffect()) return; if (!url || !dispatchEffect()) return;
// ONLY trigger by query // ONLY trigger by query
if (outerTrigger && !innerTrigger) { if (outerTrigger && !innerTrigger) {
@ -139,42 +139,49 @@ export default ({
let paramsdata = null; let paramsdata = null;
if (data) { if (newdatas) {
if (method && method == 'file') { if (method && method == 'file') {
_Object.values(data).map((d, index) => { let filekey = "";
if ((d && d != '') || typeof d == 'number') { const fileindex = _Object.keys(newdatas).find((f) => f == "filekey");
if (Object.keys(data)[index] == 'file') { if (fileindex) {
d.map((h)=>{ filekey = newdatas["filekey"];
params.append('file', h, h.name);
})
} else if (Object.keys(data)[index] == 'filekey') {
params.append(d, data[d]);
} else {
params.append(Object.keys(data)[index], d);
} }
console.log(newdatas,'newdatas',filekey);
_Object.values(data).map((d, index) => {
if (filekey != "" && Object.keys(data)[index] == filekey) {
if (d && Array.isArray(d)) {
console.log(d,'ddd');
d.map((h, index) => {
console.log(h,'file');
params.append(filekey,h, h.name);
})
} else {
params.append(filekey, d, d.name);
}
} else {
params.append(Object.keys(newdatas)[index], d);
} }
}); });
paramsdata = params; paramsdata = params;
} else if (method && method == 'get') { } else if (method && method == 'get') {
const getmethoddata = {}; const getmethoddata = {};
_Object.values(data).map((h, index) => { _Object.values(newdatas).map((h, index) => {
if ((h && h != '') || typeof h == 'number') { if ((h && h != '') || typeof h == 'number') {
getmethoddata[Object.keys(data)[index]] = h; getmethoddata[Object.keys(newdatas)[index]] = h;
} }
}); });
paramsdata = { params: getmethoddata }; paramsdata = { params: getmethoddata };
} else { } else {
if (data && data != '' && parse_param) { if (newdatas && newdatas != '' && parse_param) {
data = parse_param(data); newdatas = parse_param(newdatas);
} }
for (const p in data) { for (const p in newdatas) {
if (!data[p]) { if (!newdatas[p]) {
data[p] = ''; newdatas[p] = '';
} }
if (data[p]) { if (newdatas[p]) {
params.append(p, data[p]); params.append(p, newdatas[p]);
} }
} }

View File

@ -0,0 +1,420 @@
<template>
<div class="Special_offer_box">
<div class="table_box_header">
<el-tabs class="demo-tabs" v-model="activeName" @tab-change="TabChange">
<el-tab-pane
v-for="item in tabs"
:key="item.value"
:label="item.label"
:name="item.value"
></el-tab-pane>
</el-tabs>
<SearchForm :inputs="Inputs" @onSearch="onSearch" @onRest="onRest" />
</div>
<div class="table_box_center">
<Table
ref="TableRef"
:key="TableKey"
:TabLoading="TabLoading"
:TableData="TableData"
:TableLabel="TableLabel"
>
<template #OperateButton="{ row }">
<OperateButton
:ButtonList="row.ButtonGroup"
:row="row"
></OperateButton></template
></Table>
<PaginaTion
:total="totalNumbel"
v-model:current-page="commodityInfoDto.pageNo"
v-model:page-size="commodityInfoDto.pageSize"
@handleSizeChange="handleSizeChange"
@handleCurrentChange="getDatas"
></PaginaTion>
</div>
</div>
</template>
<script setup>
import { ref, unref, computed, reactive, onMounted } from "vue";
import { router } from "@/router.js";
import { Plus } from "@element-plus/icons-vue";
import { ElMessage } from "element-plus";
import SearchForm from "@components/searchForm/index.vue";
import Table from "@components/table.vue";
import OperateButton from "@/components/OperateButton.vue";
import PaginaTion from "@components/Pagination.vue";
import {
select_by_conditions,
get_commodity_id,
publish,
pull_off,
delete_one,
} from "@/api/CommodityManagement";
import { getshopInfo } from "@/api/newlybuiltgoods";
const activeName = ref("");
const tabs = ref([
{ label: "全部", value: "", total: 0 },
{ label: "草稿箱", value: "1", total: 0 },
{ label: "待发布", value: "2", total: 0 },
{ label: "发布成功", value: "-3", total: 0 },
{ label: "发布失败", value: "-4", total: 0 },
{ label: "手动下架", value: "-2", total: 0 },
{ label: "已售出", value: "3", total: 0 },
{ label: "其他", value: "99", total: 0 },
]);
const Inputs = ref([
{
type: "el-input",
placeholder: "查询闲鱼商品ID",
title: "闲鱼商品ID",
name: "commodityId",
value: "",
popover: true,
},
{
type: "el-select",
placeholder: "请选择闲鱼店铺",
title: "闲鱼店铺",
name: "xyId",
value: "",
options: [],
},
{
type: "el-select",
placeholder: "请输入商品类型",
title: "商品类型",
name: "auctionType",
value: "",
options: [
{ label: "一口价", value: "a" },
{ label: "拍卖", value: "b" },
],
},
{
type: "el-select",
placeholder: "请选择分类",
title: "商品分类",
name: "itemBizType",
value: "",
options: [
{ label: "普通商品", value: "2" },
{ label: "特卖商品", value: "24" },
],
},
{
type: "el-input",
placeholder: "请输入商品名称",
name: "title",
value: "",
title: "商品名称",
},
{
type: "el-date-picker",
title: "创建时间",
placeholder: "",
name: "createTime",
value: [],
width: "215px",
},
{
type: "el-date-picker",
title: "上架时间",
placeholder: "",
name: "shelfTime",
value: [],
width: "215px",
},
]);
const TableRef = ref(null);
const TableKey = ref(new Date().getTime());
const TabLoading = ref(false);
const TableData = ref([]);
const TableLabel = ref([
{
label: "闲鱼商品ID",
param: "commodityId",
align: "center",
show: true,
display: "top_left",
},
{
label: "创建时间",
param: "createTime",
align: "center",
show: true,
display: "top_left",
},
{
label: "上架时间",
param: "createTime",
align: "center",
show: true,
display: "top_left",
},
{
label: "商品",
param: "",
align: "center",
show: true,
minwidth: "210",
},
{
label: "商品状态",
param: "publishStatusName",
align: "center",
show: true,
minwidth: "150",
},
{
label: "商品类型",
param: "itemBizType",
align: "center",
show: true,
minwidth: "150",
},
{
label: "分类",
param: "auctionType",
align: "center",
show: true,
minwidth: "150",
},
{
label: "售价(元)",
param: "retailPrice",
align: "center",
show: true,
minwidth: "150",
},
{
label: "库存(个)",
param: "stock",
align: "center",
show: true,
minwidth: "150",
},
{
label: "销量",
param: "salesVolume",
align: "center",
show: true,
minwidth: "150",
},
{
label: "闲鱼店铺",
param: "xyName",
align: "center",
show: true,
minwidth: "150",
},
{
label: "操作",
align: "center",
show: true,
fixed: "right",
minwidth: "150",
},
]);
const New_TableLabel = ref([]);
const ButtonListGroup = ref([
{
AssemblyName: "el-link",
name: "编辑",
show: false,
type: "primary",
mode: "detail",
confirm: (row) => {
get_commodity_id(row.id).then((res) => {
if (res.code === "200") {
router.push({
path: "/NewlyBuiltGoods",
query: {
params: JSON.stringify(res.data),
},
});
}
});
},
},
{
AssemblyName: "el-link",
name: "复制",
show: false,
type: "primary",
mode: "detail",
confirm: (row) => {},
},
{
AssemblyName: "el-link",
name: "上架",
show: false,
type: "primary",
mode: "detail",
confirm: (row) => {
publish(row.id).then((res) => {
if (res.code === "200") {
ElMessage.success(res.msg);
getDatas();
}
});
},
},
{
AssemblyName: "el-popconfirm",
name: "下架",
title: "是否下架?",
cancelText: "不用了",
popconfirmIcon: "el-icon-info",
iconColor: "red",
type: "danger",
show: false,
confirm: (row) => {
pull_off(row.id).then((res) => {
if (res.code === "200") {
ElMessage.success(res.msg);
getDatas();
}
});
},
},
{
AssemblyName: "el-popconfirm",
name: "删除",
title: "是否删除?",
cancelText: "不用了",
popconfirmIcon: "el-icon-info",
iconColor: "red",
type: "danger",
show: false,
confirm: (row) => {
delete_one(row.id).then((res) => {
if (res.code === "200") {
ElMessage.success(res.msg);
getDatas();
}
});
},
},
{
AssemblyName: "el-link",
name: "日志",
show: false,
type: "warning",
mode: "detail",
confirm: (row) => {},
},
]);
let commodityInfoDto = reactive({
pageNo: 1,
pageSize: 20,
publishStatus: "",
});
const totalNumbel = ref(0);
const getDatas = () => {
TabLoading.value = true;
select_by_conditions(commodityInfoDto)
.then((res) => {
TabLoading.value = false;
if (res.code === "200") {
const newData = Object.assign([], res.data.data);
newData.map((item) => {
item.ButtonGroup = ButtonListGroup.value.map((el) => {
if (
(el.name === "编辑" &&
[1, -4, -2].includes(item.publishStatus)) ||
(el.name === "下架" && [-3].includes(item.publishStatus)) ||
(el.name === "复制" &&
[1, -2, -3, -4, 3].includes(item.publishStatus)) ||
(el.name === "上架" && [-2, -4].includes(item.publishStatus)) ||
(el.name === "删除" && [1, -4, -2].includes(item.publishStatus))
) {
return { ...el, show: true };
}
return el;
});
});
console.log(newData);
TableData.value = newData;
totalNumbel.value = res.data.totalCount;
}
})
.catch((err) => {
TabLoading.value = false;
});
};
//
const onSearch = (value) => {
if (value.createTime) {
value.startCreateTime = new Date(value.createTime[0]).getTime();
value.endCreateTime = new Date(value.createTime[1]).getTime() + 86399999;
} else if (value.shelfTime) {
value.startShelfTime = new Date(value.shelfTime[0]).getTime();
value.endShelfTime = new Date(value.shelfTime[1]).getTime() + 86399999;
}
commodityInfoDto = {
...commodityInfoDto,
...value,
};
getDatas();
};
//
const onRest = (value) => {
commodityInfoDto = {
pageNo: 1,
pageSize: 20,
publishStatus: activeName.value,
};
getDatas();
};
const get_shopInfo = () => {
getshopInfo().then((res) => {
if (res.code === "200") {
const storeList = [];
res.data.forEach((item) => {
storeList.push({ label: item.xyName, value: item.id });
});
Inputs.value.find((e) => e.title == "闲鱼店铺").options = storeList;
}
});
};
onMounted(() => {
TabChange();
get_shopInfo();
});
const handleSizeChange = () => {
commodityInfoDto.pageNo = 1;
getDatas();
};
const TabChange = (val) => {
commodityInfoDto.publishStatus = activeName.value;
getDatas();
TableLabel.value.forEach((e) => {
e.show = !(
e.hasOwnProperty("NumberType") && !e.NumberType.includes(Number(val))
);
});
New_TableLabel.value = TableLabel.value;
TableKey.value = new Date().getTime();
};
</script>
<style lang="scss" scoped>
.Special_offer_box {
height: calc(100vh - 38px);
background: #f1f2f5;
}
.table_box_header {
width: 100%;
padding: 0 20px;
box-sizing: border-box;
background: #fff;
}
.table_box_center {
padding: 20px;
box-sizing: border-box;
}
</style>

View File

@ -208,9 +208,11 @@ const onCheckImg = () => {
checkimages.value = false; checkimages.value = false;
let token = e.datas.token; let token = e.datas.token;
console.log(token,"token")
if (e.datas.token) { if (e.datas.token) {
axioshooks({ axioshooks({
url: "auth/login3rd", url: "auth/login3rd",
headers: { headers: {
loginType: "erpLogin", loginType: "erpLogin",
token: e.datas.token, token: e.datas.token,
@ -223,7 +225,7 @@ const onCheckImg = () => {
// addStorage("virtoken", e.data); // addStorage("virtoken", e.data);
addStorage( addStorage(
"virtoken", "virtoken",
"9wEUErM0vX7OGuPq7byzZA0KdSMhROI8cCWvQAK5bH8TyOwHhekuHF0vwF9cMg5h92fVFtoZssQv9Oo36CYbZmXjrWa56NWWLNppUGRiTFEHYNzPhn7NYBP7SqvPPI6z" "47ewUzuYl8Omr40VtNlOONmiqIgOe9gjWsl5BWrnwWHMHp1XB1Ac9ADtwxMDp2G4p5e6fG079cSsfEDOmGY2SAXe3611imSBKgmq2SzGOOfP1d2TPlKYmnuvWSNFNou0"
); );
if (props.callback) { if (props.callback) {
props.callback(); props.callback();

View File

@ -66,7 +66,7 @@
:type="el.type" :type="el.type"
text text
size="small" size="small"
@click="el.handler(item, index)" @click="operation(el.label, item, index)"
>{{ el.label }}</el-button >{{ el.label }}</el-button
> >
</div> </div>
@ -150,8 +150,14 @@ let that = newDataList;
const submit_specification = (formEl) => { const submit_specification = (formEl) => {
formEl.validate((valid) => { formEl.validate((valid) => {
if (!valid || !ruleForm.name) return; if (!valid || !ruleForm.name) return;
if (
newDataList.value.find(
(e) => e.label.replace(/\s+/g, "") === ruleForm.name.replace(/\s+/g, "")
)
)
return ElMessage.warning("商品规格不能重复!");
if (newDataList.value.length >= 2) if (newDataList.value.length >= 2)
return ElMessage.warning("超过输入限制!"); return ElMessage.warning("超过输入限制,商品规格最多添加两个");
specification_list_index.value++; specification_list_index.value++;
newDataList.value.push({ newDataList.value.push({
label: ruleForm.name, label: ruleForm.name,
@ -170,16 +176,10 @@ const submit_specification = (formEl) => {
{ {
type: "primary", type: "primary",
label: "编辑", label: "编辑",
handler: (item) => {
item.disabled = true;
},
}, },
{ {
type: "danger", type: "danger",
label: "删除", label: "删除",
handler: (item, index) => {
newDataList.value.splice(index, 1);
},
}, },
], ],
inputGroup: { inputGroup: {
@ -191,16 +191,24 @@ const submit_specification = (formEl) => {
ruleForm.name = ""; ruleForm.name = "";
}); });
}; };
function operation(status, item, index) {
if (status == "编辑") {
item.disabled = true;
} else {
newDataList.value.splice(index, 1);
}
}
function onDelValueItem(index, ind) { function onDelValueItem(index, ind) {
let newdatas = JSON.parse(JSON.stringify(newDataList.value[index].valueGrop)); newDataList.value[index].valueGrop.splice(ind, 1);
newdatas.splice(ind, 1);
newDataList.value[index].valueGrop = newdatas;
newDataList.value = Object.assign([], newDataList.value);
console.log(newDataList.value, "newDataList.value111");
} }
function input_child_keydown(e, name, index) { function input_child_keydown(e, name, index) {
if (e.key !== "Enter" || !name) return; if (e.key !== "Enter" || !name) return;
if (
newDataList.value[index].valueGrop.find(
(e) => e.label.replace(/\s+/g, "") === name.replace(/\s+/g, "")
)
)
return ElMessage.warning("商品属性不能重复!");
if (newDataList.value.length <= 1) { if (newDataList.value.length <= 1) {
if (newDataList.value[index].valueGrop.length >= 10) return; if (newDataList.value[index].valueGrop.length >= 10) return;
} else { } else {

View File

@ -7,7 +7,6 @@
label-width="auto" label-width="auto"
class="demo-ruleForm" class="demo-ruleForm"
:size="formSize" :size="formSize"
status-icon
> >
<div class="head"> <div class="head">
<div class="title">{{ createGoods.title }}</div> <div class="title">{{ createGoods.title }}</div>
@ -44,7 +43,7 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="ruleForm[createGoods.radio_group_select.params] === '24'" v-if="ruleForm[createGoods.radio_group_select.params] === 24"
:label="createGoods.radio_group_sell.label" :label="createGoods.radio_group_sell.label"
:prop="createGoods.radio_group_sell.prop" :prop="createGoods.radio_group_sell.prop"
> >
@ -52,7 +51,7 @@
v-loading="createGoods.radio_group_sell.loading" v-loading="createGoods.radio_group_sell.loading"
element-loading-text="加载中..." element-loading-text="加载中..."
v-model=" v-model="
ruleForm.flash_sale_do[createGoods.radio_group_sell.params] ruleForm.flashSaleDO[createGoods.radio_group_sell.params]
" "
@change="createGoods.radio_group_sell.change" @change="createGoods.radio_group_sell.change"
> >
@ -165,6 +164,7 @@
:autoUpload="false" :autoUpload="false"
:multiple="goodsInfo.more_src.multiple" :multiple="goodsInfo.more_src.multiple"
@onSuccessFiles="goodsInfo.more_src.onSuccessFiles" @onSuccessFiles="goodsInfo.more_src.onSuccessFiles"
@handleRemove="goodsInfo.more_src.handleRemove"
/> />
</div> </div>
</div> </div>
@ -174,8 +174,9 @@
:limit="goodsInfo.White_src.limit" :limit="goodsInfo.White_src.limit"
:imgList="goodsInfo.White_src.fileImgList" :imgList="goodsInfo.White_src.fileImgList"
:autoUpload="false" :autoUpload="false"
:multiple="goodsInfo.White_src.multiple"
@onSuccessFiles="goodsInfo.White_src.onSuccessFiles" @onSuccessFiles="goodsInfo.White_src.onSuccessFiles"
@handleSuccess="goodsInfo.more_src.handleSuccess" @handleRemove="goodsInfo.White_src.handleRemove"
/> />
</el-form-item> </el-form-item>
<el-form-item label="商品标题" prop="title"> <el-form-item label="商品标题" prop="title">
@ -275,6 +276,22 @@
</div> </div>
</div> </div>
</div> </div>
<el-input
v-model="ruleForm.bidDto[item.params]"
style="width: 480px"
:placeholder="`请输入${item.label}`"
:clearable="true"
:disabled="item.disabled"
type="text"
v-if="
item.type === 'el-input' &&
(item.label == '保证金' || item.label == '加价幅度')
"
>
<template #suffix v-if="item.suffix">
{{ item.suffix }}
</template>
</el-input>
<el-input <el-input
v-model="ruleForm[item.params]" v-model="ruleForm[item.params]"
style="width: 480px" style="width: 480px"
@ -282,7 +299,7 @@
:clearable="true" :clearable="true"
:disabled="item.disabled" :disabled="item.disabled"
type="text" type="text"
v-if="item.type === 'el-input'" v-else-if="item.type === 'el-input'"
> >
<template #suffix v-if="item.suffix"> <template #suffix v-if="item.suffix">
{{ item.suffix }} {{ item.suffix }}
@ -305,7 +322,7 @@
:label="el.label" :label="el.label"
align="center" align="center"
> >
<template #header="scope"> <template #header>
<el-input <el-input
style="width: 80px" style="width: 80px"
v-if="el.label === '售价' || el.label === '库存'" v-if="el.label === '售价' || el.label === '库存'"
@ -382,11 +399,11 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-select <el-select
v-if="item.type === 'el-select'"
style="width: 240px" style="width: 240px"
v-model="ruleForm[item.params]" v-model="ruleForm[item.params]"
:placeholder="`请选择${item.label}`" :placeholder="`请选择${item.label}`"
:clearable="true" :clearable="true"
v-if="item.type === 'el-select'"
><el-option ><el-option
v-for="el in item.options" v-for="el in item.options"
:key="el.value" :key="el.value"
@ -397,18 +414,19 @@
></el-select> ></el-select>
<el-date-picker <el-date-picker
v-if="item.type === 'daterange'" v-if="item.type === 'daterange'"
v-model="ruleForm[item.params]"
type="daterange" type="daterange"
range-separator="-" range-separator="-"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:size="size" @change="item.change"
/> />
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
<div class="main-box"> <div class="main-box">
<div class="title">{{ logistics.title }}</div> <div class="title">{{ logistics.title }}</div>
<div class="price_list"> <div class="logistics">
<el-form-item <el-form-item
:label="logistics.configured.label" :label="logistics.configured.label"
:prop="logistics.configured.prop" :prop="logistics.configured.prop"
@ -426,12 +444,12 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</div> </div>
<div> <div class="logistics_input" v-if="ruleForm.logistics === '2'">
<el-form-item prop="logistics"> <el-form-item label=" ">
<el-input <el-input
placeholder="请输入金额"
style="width: 180px"
v-model="ruleForm.transportFee" v-model="ruleForm.transportFee"
:placeholder="el.label"
size="small"
> >
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -460,6 +478,7 @@
<script setup> <script setup>
import { Plus, Edit, Filter } from "@element-plus/icons-vue"; import { Plus, Edit, Filter } from "@element-plus/icons-vue";
import { router } from "@/router.js"; import { router } from "@/router.js";
import { useRoute } from "vue-router";
import { ref, reactive, onMounted } from "vue"; import { ref, reactive, onMounted } from "vue";
import UploadImage from "@components/Upload/newfileupload.vue"; import UploadImage from "@components/Upload/newfileupload.vue";
import SpecificationDialog from "./components/specificationDialog.vue"; import SpecificationDialog from "./components/specificationDialog.vue";
@ -467,13 +486,63 @@ import { ElMessage } from "element-plus";
import { deepClone } from "@/services/commont"; import { deepClone } from "@/services/commont";
const ruleFormRef = ref(null); const ruleFormRef = ref(null);
const tableRef = ref(null); const tableRef = ref(null);
const route = useRoute();
import { import {
getGoodsType, getGoodsType,
getGoodsInfo, getGoodsInfo,
getshopInfo, getshopInfo,
uploadImage, uploadImage,
region, region,
qualityList,
address_default,
publish_shelve,
} from "@/api/newlybuiltgoods"; } from "@/api/newlybuiltgoods";
let ruleForm = reactive({
bidDate: [],
auctionType: "b", //
itemBizType: 24, // 0 1 2 24
flashSaleDO: {
tag: 1,
foodProDate: "0", // -
foodExpireDate: "0", // -
}, //
xyShopId: "",
channelCatId: "", //id
classValue: [],
spBizType: "99", //99 :1, :2, :3, :8, 3C:9, :16, :17, :18, /:19, :20, :21
pvListDtoList: [],
title: "", //
desc: "", //
reservePrice: "", //
originalPrice: "", //
stuffStatus: "", //
divisionId: "", //
categoryId: 0, //Id,: 50025386long810
bidDto: {
bidBail: "", //
bidStep: "", //
bidEndTime: "", //
bidStartTime: "", //
}, //
quantity: 1, //
skuList: [
{
quantity: 0, //
price: 0, //
property: [{ key: "", value: "" }], //
},
],
xyImages: [], //
aliImages: [], //
whiteBgImage: "", // ()
flag: "1", //稿-0 -1
republishId: 0, //id
logistics: "1", // 1 2 bidStep
transportFee: "", // 2
templateId: 0, // 3
});
const createGoods = reactive({ const createGoods = reactive({
title: "新建商品", title: "新建商品",
radio_group_goods: { radio_group_goods: {
@ -484,8 +553,9 @@ const createGoods = reactive({
options: [ options: [
{ {
label: "一口价", label: "一口价",
value: "a", value: "b",
change: () => { change: () => {
ruleFormRef.value.clearValidate();
priceList.fixPrice = [ priceList.fixPrice = [
{ {
type: "add", type: "add",
@ -520,66 +590,99 @@ const createGoods = reactive({
prop: "stuffStatus", prop: "stuffStatus",
params: "stuffStatus", params: "stuffStatus",
disabled: true, disabled: true,
options: [{ label: "888", value: 6 }], options: qualityData.value,
}, },
]; ];
}, },
}, },
{ {
label: "拍卖", label: "拍卖",
value: "b", value: "a",
change: () => { change: () => {
ruleFormRef.value.clearValidate();
priceList.fixPrice = [ priceList.fixPrice = [
{ {
type: "el-input", type: "el-input",
label: "起拍价", label: "起拍价",
prop: "", prop: "reservePrice",
params: "", params: "reservePrice",
disabled: false, disabled: false,
}, },
{ {
type: "el-input", type: "el-input",
label: "原价", label: "原价",
prop: "", prop: "originalPrice",
params: "", params: "originalPrice",
disabled: false, disabled: false,
}, },
{ {
type: "el-input", type: "el-input",
label: "加价幅度", label: "加价幅度",
prop: "", prop: "bidStep",
params: "", params: "bidStep",
disabled: false, disabled: false,
}, },
{ {
type: "el-input", type: "el-input",
label: "保证金", label: "保证金",
prop: "", prop: "bidBail",
params: "", params: "bidBail",
disabled: true, disabled: false,
}, },
{ {
type: "daterange", type: "daterange",
label: "拍卖时间", label: "拍卖时间",
prop: "", params: "bidDate",
params: "", prop: "bidDate",
disabled: true, disabled: false,
change: (e) => {
const now = new Date();
const startTime = new Date(e[0]);
const endTime = new Date(e[1]);
//
if (startTime.getTime() <= now.getTime()) {
ElMessage.warning("拍卖开始时间必须大于当前时间");
return false; //
}
// 15
const maxEndTime = new Date(
now.getTime() + 15 * 24 * 60 * 60 * 1000
); // 15
if (
endTime.getTime() <= startTime.getTime() ||
endTime.getTime() > maxEndTime.getTime()
) {
ElMessage.warning(
"结束时间必须在开始时间之后且小于当前时间后的15天"
);
return false; //
}
if (e) {
ruleForm.bidDto.bidStartTime = new Date(e[0]).getTime();
ruleForm.bidDto.bidEndTime = new Date(e[1]).getTime();
} else {
ruleForm.bidDto.bidStartTime = "";
ruleForm.bidDto.bidEndTime = "";
}
},
}, },
{ {
type: "el-input", type: "el-input",
label: "库存", label: "库存",
prop: "", prop: "quantity",
params: "", params: "quantity",
disabled: true, disabled: true,
suffix: "拍卖商品支支持发布一个库存", suffix: "拍卖商品支支持发布一个库存",
}, },
{ {
type: "el-select", type: "el-select",
label: "成色", label: "成色",
prop: "", prop: "stuffStatus",
params: "", params: "stuffStatus",
disabled: true, disabled: false,
options: [{ label: "888", value: 6 }], options: qualityData.value,
}, },
]; ];
}, },
@ -618,39 +721,39 @@ const createGoods = reactive({
options: [ options: [
{ {
label: "临期", label: "临期",
value: "1", value: 1,
}, },
{ {
label: "孤品", label: "孤品",
value: "2", value: 2,
}, },
{ {
label: "断码", label: "断码",
value: "3", value: 3,
}, },
{ {
label: "微瑕", label: "微瑕",
value: "4", value: 4,
}, },
{ {
label: "尾货", label: "尾货",
value: "5", value: 5,
}, },
{ {
label: "官翻", label: "官翻",
value: "6", value: 6,
}, },
{ {
label: "全新", label: "全新",
value: "7", value: 7,
}, },
{ {
label: "福袋", label: "福袋",
value: "8", value: 8,
}, },
{ {
label: "其他", label: "其他",
value: "99", value: 9,
}, },
], ],
change: () => { change: () => {
@ -705,9 +808,10 @@ const information = reactive({
}); });
item.child.find((e) => e.value === 0); item.child.find((e) => e.value === 0);
information.goods_attribute.group.push({ information.goods_attribute.group.push({
label: item.property_name, label: item.property_name,
propertyId: item.propertyId, propertyId: item.property_id,
options: item.child.slice(0, 8), options: item.child.slice(0, 8),
add_attribute: { add_attribute: {
querySearchAsync: (queryString, cb) => { querySearchAsync: (queryString, cb) => {
@ -721,6 +825,8 @@ const information = reactive({
}, 500 * Math.random()); }, 500 * Math.random());
}, },
handleSelect: (item, el, index) => { handleSelect: (item, el, index) => {
console.log(item, "itemtemtekte");
const pvlistdto = item.options.find((e) => e.link == el); const pvlistdto = item.options.find((e) => e.link == el);
ruleForm.pvListDtoList[index] = { ruleForm.pvListDtoList[index] = {
propertyId: item.propertyId, propertyId: item.propertyId,
@ -766,39 +872,58 @@ const goodsInfo = reactive({
type: "UploadImage", type: "UploadImage",
label: "多图", label: "多图",
params: "inspection_avatars", params: "inspection_avatars",
// prop: "inspection_avatar", prop: "inspection_avatar",
limit: 9, limit: 9,
fileImgList: [], fileImgList: [],
paramslist: [], paramslist: [],
multiple: true, multiple: true,
onSuccessFiles: (filelist) => { onSuccessFiles: (filelist) => {
goodsInfo.more_src.fileImgList = filelist;
goodsInfo.more_src.paramslist = filelist.raw;
console.log(
goodsInfo.more_src.paramslist,
"goodsInfo.more_src.paramslist"
);
uploadImage({ uploadImage({
filekey: "files",
xyShopId: ruleForm.xyShopId, xyShopId: ruleForm.xyShopId,
files: goodsInfo.more_src.paramslist, files: filelist,
type: 1,
}).then((res) => { }).then((res) => {
console.log(res);
if (res.code === "200") { if (res.code === "200") {
console.log(res); ruleForm.xyImages = res.data.xy; //
ruleForm.aliImages = res.data.ali; //
} else {
ElMessage.warning(res.msg);
} }
}); });
}, },
handleRemove: (filelist) => {
if (!ruleForm.aliImages.length) return;
const nameToFind = filelist[0].name;
const index = ruleForm.aliImages.findIndex((url) => {
const urlParts = url.split("/");
const filename = urlParts[urlParts.length - 1];
return filename.includes(nameToFind);
});
ruleForm.aliImages.splice(index, 1);
ruleForm.xyImages.splice(index, 1);
},
}, },
White_src: { White_src: {
type: "UploadImage", type: "UploadImage",
label: "主图", label: "白底图",
params: "inspection_avatar", params: "inspection_avatar",
// prop: "inspection_avatar", prop: "inspection_avatar",
limit: 1, limit: 1,
fileImgList: [], fileImgList: [],
onSuccessFiles: (file, filelist) => { multiple: false,
console.log(file, filelist, "file,filelist"); onSuccessFiles: (filelist) => {
uploadImage({
filekey: "files",
xyShopId: ruleForm.xyShopId,
files: filelist,
}).then((res) => {
if (res.code === "200") {
ruleForm.whiteBgImage = res.data.xy[0];
}
});
},
handleRemove: () => {
ruleForm.whiteBgImage = "";
}, },
}, },
Deliver_location: { Deliver_location: {
@ -809,10 +934,12 @@ const goodsInfo = reactive({
clearable: true, clearable: true,
options: [], options: [],
visibleChange: (e) => { visibleChange: (e) => {
ruleForm.divisionId = goodsInfo.Deliver_location.params[3]; if (e) return;
ruleForm.divisionId = goodsInfo.Deliver_location.params.slice(-1)[0];
}, },
}, },
}); });
const qualityData = ref([]);
const priceList = reactive({ const priceList = reactive({
title: "定价与库存", title: "定价与库存",
dialogTitle: "设置商品规格", dialogTitle: "设置商品规格",
@ -853,7 +980,7 @@ const priceList = reactive({
prop: "stuffStatus", prop: "stuffStatus",
params: "stuffStatus", params: "stuffStatus",
disabled: true, disabled: true,
options: [{ label: "888", value: 6 }], options: qualityData.value,
}, },
], ],
}); });
@ -880,55 +1007,30 @@ const logistics = reactive({
change: () => {}, change: () => {},
}, },
}); });
const ruleForm = reactive({ const bidStep = (rule, value, callback) => {
auctionType: "a", // if (ruleForm.bidDto.bidStep === "") {
itemBizType: "24", // 0 1 2 24 callback(new Error("出价幅度,不能为空"));
flash_sale_do: { } else {
tag: "1", callback();
foodProDate: "", // - }
foodExpireDate: "", // - };
}, // const bidBail = (rule, value, callback) => {
xyShopId: "", if (ruleForm.bidDto.bidBail === "") {
channelCatId: "", //id callback(new Error("保证金,不能为空"));
classValue: [], } else {
spBizType: "99", //99 :1, :2, :3, :8, 3C:9, :16, :17, :18, /:19, :20, :21 callback();
pvListDtoList: [], }
title: "", // };
desc: "", //
reservePrice: "", //
originalPrice: "", //
stuffStatus: "", //
divisionId: "", //
categoryId: 0, //Id,: 50025386long810
bidDto: {
bidBail: 0, //
bidEndTime: 0, //
bidStartTime: 0, //
bidStep: 0, //
}, //
quantity: 1, //
skuList: [
{
quantity: 0, //
price: 0, //
property: [{ key: "", value: "" }], //
},
],
xyImages: [], //
aliImages: [], //
whiteBgImage: 0, //
flag: 0, //稿-0 -1
republishId: 0, //id
logistics: "1", // 1 2 3
transportFee: "", // 2
templateId: 0, // 3
});
const rules = reactive({ const rules = reactive({
auctionType: [{ trigger: "blur", required: true, message: "请选择商品类型" }], auctionType: [{ trigger: "blur", required: true, message: "请选择商品类型" }],
title: [{ trigger: "blur", required: true, message: "请输入商品标题" }], title: [
desc: [{ trigger: "blur", required: true, message: "请输入商品描述" }], { trigger: "blur", required: true, message: "请输入商品标题" },
{ min: 3, max: 30, message: "最少输入3个字符", trigger: "blur" },
],
desc: [
{ trigger: "blur", required: true, message: "请输入商品描述" },
{ min: 5, max: 5000, message: "最少输入5个字符", trigger: "blur" },
],
divisionId: [{ trigger: "blur", required: true, message: "请选择发货地" }], divisionId: [{ trigger: "blur", required: true, message: "请选择发货地" }],
reservePrice: [ reservePrice: [
{ trigger: "blur", required: true, message: "请输入商品售价" }, { trigger: "blur", required: true, message: "请输入商品售价" },
@ -936,7 +1038,17 @@ const rules = reactive({
stuffStatus: [{ trigger: "blur", required: true, message: "请输入商品成色" }], stuffStatus: [{ trigger: "blur", required: true, message: "请输入商品成色" }],
quantity: [{ trigger: "blur", required: true, message: "请输入库存" }], quantity: [{ trigger: "blur", required: true, message: "请输入库存" }],
logistics: [{ trigger: "blur", required: true, message: "请选择物流配置" }], logistics: [{ trigger: "blur", required: true, message: "请选择物流配置" }],
inspection_avatar: [
{ trigger: "blur", required: true, message: "请选择商品图片" },
],
classValue: [
{ trigger: "change", required: true, message: "请选择商品分类" },
],
bidStep: [{ validator: bidStep, trigger: "blur", required: true }],
bidBail: [{ validator: bidBail, trigger: "blur", required: true }],
bidDate: [{ trigger: "change", required: true, message: "请选择拍卖时间" }],
}); });
const createFilter = (queryString) => { const createFilter = (queryString) => {
return (restaurant) => { return (restaurant) => {
return ( return (
@ -955,17 +1067,15 @@ const add_xyShop = () => {
}; };
// //
const select_store = (item) => { const select_store = (item) => {
console.log(ruleForm, "dsfjsdklfjsdlfhsdlfhsdlakhfsadlfhsadkhfkls");
ruleForm.xyShopId = item.id; ruleForm.xyShopId = item.id;
}; };
const newDataList = ref([]); const newDataList = ref([]);
const specificationSubmit = (row) => { const specificationSubmit = (row) => {
ruleFormRef.value.resetFields(); ruleFormRef.value.clearValidate();
if (!row.length) return; if (!row.length) return;
newDataList.value = deepClone(row); newDataList.value = deepClone(row);
priceList.specification_arr = deepClone(row); priceList.specification_arr = deepClone(row);
console.log(priceList, "priceList", row);
const specification_list = []; const specification_list = [];
const tabelList = []; const tabelList = [];
@ -1028,7 +1138,7 @@ const specificationSubmit = (row) => {
prop: "stuffStatus", prop: "stuffStatus",
params: "stuffStatus", params: "stuffStatus",
disabled: true, disabled: true,
options: [{ label: "888", value: 6 }], options: qualityData.value,
}, },
]; ];
}, },
@ -1046,6 +1156,11 @@ const specificationSubmit = (row) => {
params: "price", params: "price",
keydown: (e, data, el) => { keydown: (e, data, el) => {
if (e.key !== "Enter") return; if (e.key !== "Enter") return;
if (data.tableData.every((item) => !item.price)) {
data.new_tableData.forEach((item) => {
item.price = el.search;
});
}
data.tableData.forEach((item) => { data.tableData.forEach((item) => {
item.price = el.search; item.price = el.search;
}); });
@ -1057,6 +1172,11 @@ const specificationSubmit = (row) => {
params: "inventory", params: "inventory",
keydown: (e, data, el) => { keydown: (e, data, el) => {
if (e.key !== "Enter") return; if (e.key !== "Enter") return;
if (data.tableData.every((item) => !item.price)) {
data.tableData.forEach((item) => {
item.inventory = el.search;
});
}
data.tableData.forEach((item) => { data.tableData.forEach((item) => {
item.inventory = el.search; item.inventory = el.search;
}); });
@ -1068,8 +1188,8 @@ const specificationSubmit = (row) => {
{ {
type: "el-input", type: "el-input",
label: "原价", label: "原价",
prop: "originalPrice", prop: "reservePrice",
params: "originalPrice", params: "reservePrice",
disabled: false, disabled: false,
}, },
{ {
@ -1078,7 +1198,7 @@ const specificationSubmit = (row) => {
prop: "stuffStatus", prop: "stuffStatus",
params: "stuffStatus", params: "stuffStatus",
disabled: true, disabled: true,
options: [{ label: "888", value: 6 }], options: qualityData.value,
}, },
]; ];
row.forEach((item) => { row.forEach((item) => {
@ -1134,7 +1254,6 @@ const specificationSubmit = (row) => {
}); });
}); });
priceList.fixPrice.map((item) => { priceList.fixPrice.map((item) => {
console.log(item, "itemmm");
if (item.type === "edit") { if (item.type === "edit") {
item.specification_list = specification_list; item.specification_list = specification_list;
} else if (item.type === "el-table") { } else if (item.type === "el-table") {
@ -1149,8 +1268,6 @@ const get_filters = (arr) => {
arr.valueGrop.map((e) => { arr.valueGrop.map((e) => {
filters.push({ label: e.label, value: e.label }); filters.push({ label: e.label, value: e.label });
}); });
console.log(filters, "arr");
return filters; return filters;
}; };
const generateCombinations = (attributeGroups) => { const generateCombinations = (attributeGroups) => {
@ -1176,7 +1293,6 @@ const generateCombinations = (attributeGroups) => {
let result = []; // let result = []; //
generate(0, {}); // generate(0, {}); //
console.log(result, "result");
return result; return result;
}; };
const specificationClose = () => { const specificationClose = () => {
@ -1193,6 +1309,14 @@ const get_shopInfo = () => {
}; };
// //
const get_region = () => { const get_region = () => {
address_default(1).then((res) => {
if (res.code === "200") {
ruleForm.divisionId = res.data.district_id;
goodsInfo.Deliver_location.params = [
res.data.province_id,
res.data.city_id,
res.data.district_id,
];
region().then((res) => { region().then((res) => {
if (res.code === "200") { if (res.code === "200") {
const transformData = (data) => { const transformData = (data) => {
@ -1210,80 +1334,130 @@ const get_region = () => {
goodsInfo.Deliver_location.options = transformData(res.data); goodsInfo.Deliver_location.options = transformData(res.data);
} }
}); });
}
});
};
//
const get_qualityList = () => {
qualityList().then((res) => {
if (res.code === "200") {
res.data.forEach((item) => {
qualityData.value.push({
label: item.quality,
value: item.number,
});
});
}
});
}; };
//稿 //稿
const SaveDraft = () => {}; const SaveDraft = () => {
console.log(priceList.fixPrice, "priceList.specification_arr");
};
const publish = (formRef) => { const publish = (formRef) => {
if (!formRef) return; if (!formRef) return;
formRef.validate((valid, fields) => {}); formRef.validate((valid, fields) => {
if (!valid) return;
const dataList = priceList.fixPrice.filter(
(item) => item.label === "销售规格"
)[0];
if (dataList) {
const ruleFormSkuList = generateSkuList(
dataList.tableData,
dataList.tabelList
);
ruleForm.skuList = ruleFormSkuList;
}
publish_shelve(ruleForm).then((res) => {
if (res.code === "200") {
ElMessage.success(res.msg);
} else {
ElMessage.warning(res.msg);
}
});
});
}; };
function generateSkuList(array1, array2) {
let skuList = [];
array1.forEach((skuVariant) => {
let sku = {
quantity: "", // 0
price: "", // 0
property: [], //
};
array2.forEach((item) => {
console.log(item, "item,");
let value = skuVariant[item.params];
console.log(value, "value", skuVariant, "skuVariant");
sku.quantity = skuVariant.inventory;
sku.price = skuVariant.price;
if (
value &&
item.filters &&
item.filters.some((filter) => filter.value === value)
) {
sku.property.push({ key: item.label, value: value });
}
});
skuList.push(sku);
});
return skuList;
}
onMounted(() => { onMounted(() => {
if (route.query.params) {
let params = JSON.parse(route.query.params);
// console.log(params,"praaafsdf");
// ruleForm = {
// bidDate: [],
// auctionType: params.auctionType, //
// itemBizType: params.itemBizType, // 0 1 2 24
// flashSaleDO: {
// tag: params.flashSaleType,
// foodProDate: "", // -
// foodExpireDate: "", // -
// }, //
// xyShopId: "",
// channelCatId: "", //id
// classValue: [],
// spBizType: "99", //99 :1, :2, :3, :8, 3C:9, :16, :17, :18, /:19, :20, :21
// pvListDtoList: [],
// title: "", //
// desc: "", //
// reservePrice: "", //
// originalPrice: "", //
// stuffStatus: "", //
// divisionId: "", //
// categoryId: 0, //Id,: 50025386long810
// bidDto: {
// bidBail: "", //
// bidStep: "", //
// bidEndTime: "", //
// bidStartTime: "", //
// }, //
// quantity: 1, //
// skuList: [
// {
// quantity: 0, //
// price: 0, //
// property: [{ key: "", value: "" }], //
// },
// ],
// xyImages: [], //
// aliImages: [], //
// whiteBgImage: "", // ()
// flag: "1", //稿-0 -1
// republishId: 0, //id
// logistics: "1", // 1 2 bidStep
// transportFee: "", // 2
// templateId: 0, // 3
// };
}
get_shopInfo(); get_shopInfo();
get_region(); get_region();
get_qualityList();
createGoods.radio_group_sell.change(); createGoods.radio_group_sell.change();
}); });
// const submitSpecification = (valName) => {
// specification_list_index.value++;
// priceList.specification_arr.push({
// label: valName,
// num: 0,
// index: specification_list_index.value,
// disabled: false,
// keydown: (e, item, index) => {
// if (e.key !== "Enter") return;
// if (item.label.length <= 4) {
// item.disabled = false;
// } else {
// ElMessage.warning("4");
// }
// },
// buttonGroup: [
// {
// type: "primary",
// label: "",
// handler: (item) => {
// item.disabled = true;
// },
// },
// {
// type: "danger",
// label: "",
// handler: (item, index) => {
// priceList.specification_arr.splice(index, 1);
// },
// },
// ],
// inputGroup: {
// valueName: "",
// placeholder: "",
// keydown: (e, name, index) => {
// if (e.key !== "Enter" || !name) return;
// if (priceList.specification_arr.length <= 1) {
// if (priceList.specification_arr[index].valueGrop.length >= 10) return;
// } else {
// if (
// priceList.specification_arr[0].valueGrop.length *
// priceList.specification_arr[1].valueGrop.length >=
// 100
// )
// return;
// }
// priceList.specification_arr[index].valueGrop.push({
// type: "danger",
// label: priceList.specification_arr[index].inputGroup.valueName,
// delete: (item, ind) => {
// priceList.specification_arr[index].valueGrop.splice(ind, 1);
// },
// });
// priceList.specification_arr[index].num =
// priceList.specification_arr[index].valueGrop.length;
// priceList.specification_arr[index].inputGroup.valueName = "";
// },
// },
// valueGrop: [],
// });
// };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -1443,6 +1617,11 @@ onMounted(() => {
} }
} }
} }
.logistics {
:deep(.el-form-item) {
margin-bottom: 0 !important;
}
}
} }
} }

View File

@ -91,7 +91,7 @@
<script setup> <script setup>
import { router } from "@/router.js"; import { router } from "@/router.js";
import { ref, reactive, onMounted, watch, computed } from "vue"; import { ref, reactive, onMounted, computed } from "vue";
import { Delete, Edit, Search, Share, Upload } from "@element-plus/icons-vue"; import { Delete, Edit, Search, Share, Upload } from "@element-plus/icons-vue";
import CreateStoreDialog from "./CreateStoreDialog/CreateStoreDialog.vue"; import CreateStoreDialog from "./CreateStoreDialog/CreateStoreDialog.vue";
import { import {
@ -104,7 +104,6 @@ import {
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
const route = useRoute(); const route = useRoute();
const CreateStoreDialogVisible = ref(route.query.CreateStoreDialogVisible);
const get_win_width = computed(() => { const get_win_width = computed(() => {
const xl = window.innerWidth > 1920 ? 4 : 6; const xl = window.innerWidth > 1920 ? 4 : 6;
return xl; return xl;
@ -116,7 +115,7 @@ const buttonGroup = ref([
icon: Edit, icon: Edit,
handler: (item) => { handler: (item) => {
CreateStore.CreateStoreTitle = "编辑店铺"; CreateStore.CreateStoreTitle = "编辑店铺";
CreateStore.editText = "编辑"; CreateStore.editText = "确定";
CreateStore.CreateStoreDialogVisible = true; CreateStore.CreateStoreDialogVisible = true;
CreateStore.ruleForm = { CreateStore.ruleForm = {
id: item.id, id: item.id,
@ -165,7 +164,7 @@ const CreateStore = reactive({
multiple: true, multiple: true,
fileImgList: [], fileImgList: [],
onSuccessFiles: (files) => { onSuccessFiles: (files) => {
upload({ file: files.raw }).then((res) => { upload({ file: files[0] }).then((res) => {
if (res.code === "200") { if (res.code === "200") {
CreateStore.ruleForm.lcon = res.data; CreateStore.ruleForm.lcon = res.data;
ElMessage.success("上传成功"); ElMessage.success("上传成功");
@ -254,17 +253,11 @@ const get_list_shop = () => {
}); });
}; };
onMounted(() => { onMounted(() => {
CreateStore.CreateStoreDialogVisible = route.query.CreateStoreDialogVisible; if (route.query.CreateStoreDialogVisible) {
operation("create");
}
get_list_shop(); get_list_shop();
}); });
watch(
() => route.query.CreateStoreDialogVisible,
(val) => {
if (val) {
CreateStore.CreateStoreDialogVisible = CreateStoreDialogVisible;
}
}
);
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>

View File

@ -1,792 +0,0 @@
<template>
<div class="salecontainer">
<div class="saleordertopbox">
<el-tabs class="demo-tabs" v-model="activeName" @tab-click="onTabChange">
<el-tab-pane v-for="item in tabsdatas" :key="item.value" :label="renderlaebl(item)" :name="item.value"></el-tab-pane>
</el-tabs>
</div>
<SearchForm :inputs="Inputs" @onSearch="onSearch" @onRest="onRest"/>
<Table :data="list" @looksLogs="looksLogs" :select="false" width="auto" :spanMethod="true" @onSelect="onSelect" @delivery="doDelivery" :columns="newcolumns" :loading="loading" :pageSize="pageSize" :page="page" :total="total" :handleSizeChange="handleSizeChange" :handleCurrentChange="handleCurrentChange" @quality="onQuality" @processing="onProcessing" @judgment="onJudgment" @ConfirmReceipt="onConfirmReceipt"/>
<el-dialog v-model="logsState" :before-close="()=>logsState=false" title="售后日志">
<el-table
:data="logsList"
border
height="260px"
style="width: 100%"
v-loading="logsloading"
element-loading-text="加载中"
element-loading-spinner="el-icon-loading"
>
<el-table-column type="index" label="序号" width="60" />
<el-table-column prop="content" label="内容" min-width="180">
<template #default="scope">
<span v-if="scope.row.content">
{{ scope.row.content }}
</span>
<span v-else-if="scope.row.log_content">
{{ scope.row.log_content }}
</span>
<span v-else>
{{ scope.row.content }}
</span>
</template>
</el-table-column>
<el-table-column prop="truename" label="操作人">
<template #default="scope">
<span v-if="scope.row.truename">
{{ scope.row.truename }}({{ scope.row.username }})
</span>
<span v-else>
{{ scope.row.username }}
</span>
</template>
</el-table-column>
<el-table-column prop="add_time" label="操作时间" min-width="180" />
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button size="small" @click="()=>logsState=false"> </el-button>
</span>
</template>
</el-dialog>
<el-dialog v-model="draveState" :before-close="()=>draveState=false" title="发货" :width="900">
<DriverForm :DeliveryInfoList="DeliveryInfoList" @deliveryConfirm="DeliveryConfirm" @deliveryCancel="DeliveryCancel"/>
</el-dialog>
<el-dialog v-model="processState" :before-close="()=>processState=false" title="人工处理" :width="600">
<el-radio-group v-model="processValue">
<el-radio :value="1">已核实地址符合情况--售后单状态改为待售后收货</el-radio>
<el-radio :value="2">忽略本次异常--状态改为已处理</el-radio>
</el-radio-group>
<div class="btnbox">
<el-button text class="btn" @click="()=>processState=false"
>取消<i
class="el-icon-circle-close"
style="margin-left: 5px"
/></el-button>
<el-button
text
type="primary"
class="btn"
@click="doProcess(processData)"
>确定</el-button
>
</div>
</el-dialog>
<el-dialog v-model="judgState" :before-close="()=>judgState=false" title="判责情况" :width="600">
<h4>判责</h4>
<el-radio-group v-model="judgValue.mode">
<el-radio value="1">卖家责任</el-radio>
<el-radio value="2">买家责任</el-radio>
</el-radio-group>
<el-row :gutter="24">
<el-col :span="12">
<h4>说明</h4>
<el-input placeholder="请输入说明" type="textarea" v-model="judgValue.info"></el-input>
</el-col>
<el-col :span="10">
<h4>图片</h4>
<el-upload
class="avatar-uploader"
:show-file-list="false"
:before-upload="beforeAvatarUpload"
>
<img v-if="judgValue.imageUrl" :src="judgValue.imageUrl" class="avatar" />
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
</el-upload>
</el-col>
</el-row>
<div class="btnbox">
<el-button text class="btn" @click="()=>judgState=false"
>取消<i
class="el-icon-circle-close"
style="margin-left: 5px"
/></el-button>
<el-button
text
type="primary"
class="btn"
@click="doJudg(judgData)"
>确定</el-button
>
</div>
</el-dialog>
<el-dialog v-model="receState.state" :before-close="()=>receState.state=false" title="手动收货" :width="600">
<h4>快递单号/说明</h4>
<el-input placeholder="请输入快递单号/说明" type="textarea" v-model="receState.value"></el-input>
<div class="btnbox" style="margin-top:15px">
<el-button text class="btn" @click="()=>receState.state=false"
>取消<i
class="el-icon-circle-close"
style="margin-left: 5px"
/></el-button>
<el-button
text
type="primary"
class="btn"
@click="doRecive(receState.data)"
>确定</el-button
>
</div>
</el-dialog>
</div>
</template>
<script setup>
import { ref,unref,computed,reactive,onMounted} from 'vue';
import Table from "@components/table.vue";
import axioshooks from "@axioshooks";
import {ElMessage} from "element-plus";
import {formatDate,initOss} from "@services/commont";
import DriverForm from "@components/driverForm/index.vue"
import { useRouter } from 'vue-router';
import {Plus} from "@element-plus/icons-vue";
import SearchForm from "@components/searchForm/index.vue";
const router=useRouter();
const activeName=ref('');
const tabs=[
{label:"全部",value:"",total:0},
{label:"待商家处理",value:"9",total:0},
{label:"商家拒绝售后",value:"10",total:0},
{label:"等待寄出",value:"1",total:0},
{label:"待售后收货",value:"2",total:0},
{label:"待质检",value:"3",total:0},
{label:"待判责",value:"4",total:0},
{label:"判责完成",value:"5",total:0},
{label:"已寄出待收货",value:"6",total:0},
{label:"售后异常订单",value:"7",total:0},
{label:"售后异常订单-已处理",value:"8",total:0}
];
const murecedata=reactive({
data:[],
state:false
});
const receState=reactive({
state:false,data:[],value:""
});
const imeipopover=ref(false);
const imeivalue=reactive({
imei:"",
inspect:""
});
const searchparams=reactive({
imei:"",
inspect:""
});
const pageSize=ref(10);
const page=ref(1);
const total=ref(0);
const loading=ref(false);
const logsList=ref(false);
const logsState=ref(false);
const logsloading=ref(false);
const draveState=ref(false);
const refund_status=ref('');
const DeliveryInfoList=ref({});
const processState=ref(false);
const processData=ref({xy_sale_after_additional_id:''});
const processValue=ref(1);
const judgState=ref(false);
const judgData=ref({xy_sale_after_additional_id:''});
const judgValue=ref({mode:"1",info:"",imageUrl:""});
const list=ref([]);
const select=computed(()=>{
if(activeName.value=="2"){
return true;
}else{
return false;
}
});
const onTabChange=(e)=>{
if(activeName.value!=e.props.name){
activeName.value=e.props.name;
if(e.props.name=="9"){
refund_status.value="1";
}else if(e.props.name=="10"){
refund_status.value="6";
}else{
refund_status.value="";
}
getDatas(1);
}
}
const params=ref({});
const onSearch=(values)=>{
let time = {}
if(values.quality_inspection_time){
values.quality_inspection_time_start = values.quality_inspection_time[0],
values.quality_inspection_time_end = values.quality_inspection_time[1]
}
let obj = {
...values,
...time
}
params.value=obj;
getDatas(1);
}
const onRest=()=>{
params.value={};
getDatas(1);
}
const renderlaebl=(item)=>{
if(item.total>0){
return `${item.label} ${item.total}`
}
return item.label
}
const mutrevice=()=>{
if(!murecedata.data){
ElMessage("请选择要收货的订单");
return false;
}
murecedata.state=true;
}
const onSelect=(values)=>{
murecedata.data=values;
}
const Inputs=ref([
{
type:"el-input",
placeholder:"查询IMEI/SN/机器编号",
value:"",
title:"IMEI/SN/机器编号",
name:"imei",
popover:true
},
{
type:"el-input",
placeholder:"查询质检码",
name:"quality_inspection_code",
value:"",
popover:true,
title:"查询质检码",
},
{
type:"el-input",
placeholder:"请输入销售单号",
name:"sales_order_number",
value:"",
title:"销售单号",
},
{
type:"el-input",
placeholder:"请输入商品名称",
name:"title",
value:"",
title:"商品名称",
},
{
type:"el-input",
placeholder:"请输入买家姓名",
name:"consignee_name",
value:"",
title:"买家姓名",
},
{
type:"el-input",
placeholder:"请输入买家手机号",
name:"consignee_phone",
value:"",
title:"买家手机号",
},
{
type:"el-input",
placeholder:"请输入买家地址",
name:"consignee_address",
value:"",
title:"收货人",
},
{
type:"el-input",
placeholder:"请输入快递单号",
name:"refund_post_no",
value:"",
title:"快递单号",
},
{
type:"el-input",
placeholder:"请输入售后订单号",
name:"after_sales_order_number",
value:"",
title:"售后订单号",
} ,
{
type:"el-date-picker",
placeholder:"",
name:"quality_inspection_time",
value:"",
title:"质检时间",
width:"215px"
},
]);
const columns=[
{
dataKey: `machine_name`,
title:"机器信息",
width:300,
show:true,
align: "center",
},
{
dataKey: `title`,
title:"商品标题",
show:true,
width:100,
align: "center",
},
{
dataKey: `merchant_name`,
title:"闲鱼账号",
width:100,
align: "center",
},{
dataKey: `price`,
title:"订单价格",
width:100,
align: "center",
},{
dataKey: `buy_info`,
title:"买家信息",
width:150,
align: "center",
show:true,
},{
dataKey: `buyer_apply_reason`,
title:"售后原因",
show:true,
align: "center",
width:100,
align: "center",
},
// {
// dataKey: `sale_after_quality_inspection_code`,
// title:"",
// width:150,
// show:true,
// align: "center",
// },
{
dataKey: `inspect_report`,
title:"售前质检报告",
width:150,
show:true,
align: "center",
},
{
key: `买家退货物流`,
dataKey: `refund_post_no`,
title:"买家退货物流",
width:150,
show:true,
align: "center",
},
{
dataKey: `receiver`,
title:"收货人/收货时间",
width:140,
show:true,
align: "center",
},
{
dataKey: `inspect_report`,
title:"质检员",
width:150,
show:true,
align: "center",
},
{
dataKey: `quality_inspection_time`,
title:"质检时间",
width:150,
show:true,
align: "center",
},
{
dataKey: `responsibility_type`,
title:"判责情况",
width:150,
show:true,
align: "center",
},
{
dataKey: `return_tracking_number`,
title:"寄回物流信息",
width:150,
show:true,
align: "center",
}, {
dataKey: `sale_after_additional_status`,
title:"售后状态",
width:100,
show:true,
align: "center",
},{
key: `操作`,
dataKey: `opction`,
title:"操作",
width:100,
show:true,
fixed:'right',
align: "center",
status:['Logs','Delivery']
}
];
const newcolumns=computed(()=>{
console.log(activeName.value);
let cludata=Object.assign([],columns);
if(activeName.value=='10'){
cludata.splice(columns.length-2,0,{
dataKey: `seller_refuse_reason`,
title:"卖家拒绝原因",
show:true,
align: "center",
width:150,
align: "center",
});
}
// else if(activeName.value=='8'){
// cludata.splice(columns.length-2,0,{
// dataKey: `address_accord_with`,
// title:"",
// show:true,
// align: "center",
// width:100,
// align: "center",
// });
// }
return cludata;
});
const tabsdatas=computed(()=>{
return Object.assign([],tabs).map((f)=>{
f.total=0;
if(f.value==activeName.value){
f.total= total.value;
}
return f;
});
});
const getDatas=(p)=>{
page.value=p?p:1;
loading.value=true;
total.value=0;
let newtab=activeName.value;
axioshooks({
data:{sale_after_additional_status:Number(activeName.value)<9?activeName.value:"",list_row:pageSize.value,page:page.value,refund_status:refund_status.value,...params.value},
url:"trusteeship/after_sales_list",
customHandler:(err,e)=>{
if(!err&&e){
if(e.errcode==0){
if(newtab==activeName.value){
list.value=e.datas.datas_list;
total.value=e.datas.total;
}
loading.value=false;
}else{
ElMessage(e.msg);
loading.value=false;
}
}else if(err){
ElMessage(err);
loading.value=false;
}
}
});
}
onMounted(()=>{
getDatas(1);
});
const handleSizeChange=(v)=>{
if(pageSize.value!=v){
pageSize.value=v;
getDatas(1);
}
}
const looksLogs=(data)=>{
logsloading.value=true;
logsState.value=true;
axioshooks({
data:{refund_id:data.after_sales_order_number},
url:"xy/sale_after_log",
customHandler:(err,e)=>{
if(!err&&e){
if(e.errcode==0){
logsList.value=e.datas;
logsloading.value=false;
}else{
ElMessage(e.msg);
logsloading.value=false;
}
}else if(err){
ElMessage(err);
logsloading.value=false;
}
}
});
}
const doDelivery=(data)=>{
draveState.value=true;
logsloading.value=true;
axioshooks({
data:{xy_sale_after_additional_id:data.xy_sale_after_additional_id},
url:"trusteeship/shipping_info",
customHandler:(err,e)=>{
if(!err&&e){
if(e.errcode==0){
DeliveryInfoList.value=Object.assign({},data,e.datas);
logsloading.value=false;
}else{
ElMessage(e.msg);
logsloading.value=false;
}
}else if(err){
ElMessage(err);
logsloading.value=false;
}
}
});
}
const handleCurrentChange=(v)=>{
if(page.value!=v){
getDatas(v);
}
}
const DeliveryCancel=()=>{
draveState.value=false;
}
const DeliveryConfirm=()=>{
draveState.value=false;
getDatas(page.value);
}
const onProcessing=(data)=>{
processData.value=data;
processState.value=true;
}
const onJudgment=(data)=>{
judgState.value=data;
judgData.value.xy_sale_after_additional_id = data.xy_sale_after_additional_id;
}
const onQuality=(data)=>{
let imei=data.imei1?data.imei1:data.imei2||data.sn;
router.push({path:'qualityWork',query:{imei:imei}});
}
const doProcess=(data)=>{
if(!processValue.value){
ElMessage('请选择处理结果');
return false;
}
if(!data.xy_sale_after_additional_id){
ElMessage('非法点击');
return false;
}
axioshooks({
url:'trusteeship/exception_handling',
data:{address_accord_with:processValue.value,xy_sale_after_additional_id:data?.xy_sale_after_additional_id},
customHandler:(err,e)=>{
if(!err&&e){
if(e.errcode==0){
ElMessage("操作成功");
processData.value={};
processValue.value=1;
processState.value=false;
getDatas(page.value);
}else{
ElMessage(e.msg);
}
}else if(err){
ElMessage(err);
}
}
});
}
const doJudg=(data)=>{
if(!judgValue.value.mode){
ElMessage('请选择处理结果');
return false;
}
if(!data.xy_sale_after_additional_id){
ElMessage('非法点击');
return false;
}
axioshooks({
url:'trusteeship/judgment_responsibility',
data:{responsibility_type:judgValue.value.mode,xy_sale_after_additional_id:data?.xy_sale_after_additional_id,responsibility_explanation:judgValue.value.info,responsibility_img:judgValue.value.imageUrl},
customHandler:(err,e)=>{
if(!err&&e){
if(e.errcode==0){
ElMessage("操作成功");
judgValue.value={mode:"1",info:"",imageUrl:""};
judgState.value=false;
getDatas(page.value);
}else{
ElMessage(e.msg);
}
}else if(err){
ElMessage(err);
}
}
});
}
const beforeAvatarUpload=(rawFile)=>{
let types=["image/jpeg","image/png","image/gif","image/bmp","image/jpg"];
if(!types.includes(rawFile.type)){
ElMessage.error('图片格式有误!')
return false
}
if (rawFile.size / 1024 / 1024 > 2) {
ElMessage.error('图片超过 2MB 大小!')
return false
}
initOss(rawFile).then((link)=>{
judgValue.value.imageUrl=link;
});
return false;
}
const onConfirmReceipt=(data)=>{
receState.data=data;
receState.state=true;
}
const doRecive=(data)=>{
console.log(receState.value,receState.data,"doRecive");
if(!receState.value){
ElMessage("请输入快递单号或说明");
return false;
}
if(!data.xy_sale_after_additional_id){
ElMessage('非法点击');
return false;
}
let ids = [data.xy_sale_after_additional_id]
axioshooks({
url:'trusteeship/receiving_goods',
data:{xy_sale_after_additional_id:ids||[1],tracking_number:receState.value},
customHandler:(err,e)=>{
if(!err&&e){
if(e.errcode==0){
ElMessage("操作成功");
receState.value="";
receState.data={};
receState.state=false;
getDatas(page.value);
}else{
ElMessage(e.msg);
}
}else if(err){
ElMessage(err);
}
}
});
}
</script>
<style lang="scss" scoped>
.avatar-uploader .avatar {
width:80px;
height:80px;
display: block;
}
.salecontainer{
background:#F1F2F5;
flex:1;
display:flex;
flex-direction:column;
}
.saleordertopbox{
background: #fff;
padding:20px 20px 0;
}
.searchbox{
margin-top:5px;
display:grid;
align-items:center;
grid-gap: 10px;
grid-template-columns:3fr 3fr 1fr 1fr 4fr;
}
.receivingWorkbenchbox {
padding: 10px;
flex:1;
}
.topinput{
height:36px;
}
.imeiicondefault{
height:26px;
width:26px;
box-sizing: border-box;
border-radius: 4px;
background: #f0f2f5;
cursor: pointer;
}
.avatar-uploader .el-upload {
border: 1px dashed var(--el-border-color);
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
transition: var(--el-transition-duration-fast);
}
.avatar-uploader .el-upload:hover {
border-color: var(--el-color-primary);
}
.toolbox{
display:flex;
align-items:center;
justify-content: space-between;
padding:20px 20px 0;
}
.el-icon.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px;
height:80px;
text-align: center;
background: #f1f1f1;
}
</style>