|
@@ -6,6 +6,20 @@
|
|
|
<span style="font-size: 18px; font-weight: 700" v-if="formData.data.wlnCode"> ({{ formData.data.wlnCode }})</span>
|
|
|
</div>
|
|
|
<byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
|
|
|
+ <template #type>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-radio-group v-model="formData.data.type">
|
|
|
+ <el-radio v-for="(itemType, index) in typeList" :key="index" :label="itemType.dictKey">{{ itemType.dictValue }}</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #departmentId>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <el-select v-model="formData.data.departmentId" placeholder="请选择事业部" clearable style="width: 100%">
|
|
|
+ <el-option v-for="item in departmentList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template #deliveryAddress>
|
|
|
<div style="width: 100%">
|
|
|
<el-row>
|
|
@@ -50,13 +64,6 @@
|
|
|
<el-input v-model="formData.data.consigneeNumber" placeholder="请输入联系电话" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <el-form-item label-width="0" prop="departmentId" style="width: 100%">
|
|
|
- <el-select v-model="formData.data.departmentId" placeholder="请选择事业部" clearable style="width: 100%">
|
|
|
- <el-option v-for="item in departmentList" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -147,63 +154,87 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="产品图稿" width="400">
|
|
|
<template #default="{ row }">
|
|
|
- <el-form-item :prop="'orderSkuList.' + index + '.blueprint'">
|
|
|
- <div style="display: flex; width: 100%">
|
|
|
- <div style="width: 65px">设计图:</div>
|
|
|
- <div style="width: calc(100% - 65px)">
|
|
|
- <el-image
|
|
|
- fit="scale-down"
|
|
|
- style="width: 148px; height: 148px; margin-right: 10px"
|
|
|
- v-if="row.blueprint"
|
|
|
- :src="row.blueprint"
|
|
|
- @click="openFile(row.blueprint)" />
|
|
|
- <div style="display: flex" v-if="!(route.query && route.query.detailId)">
|
|
|
- <el-button type="primary" @click="clickDrawingFile(index)" text>选择图稿</el-button>
|
|
|
- <el-upload
|
|
|
- :show-file-list="false"
|
|
|
- action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
- :data="uploadImgData"
|
|
|
- :before-upload="uploadImgFile"
|
|
|
- :on-success="
|
|
|
- (response, uploadFile) => {
|
|
|
- return handleImgSuccess(uploadFile, index);
|
|
|
- }
|
|
|
- "
|
|
|
- style="width: 100%"
|
|
|
- accept=".docx,.jpg,.jpeg,.png,.GIF,.JPG,.PNG">
|
|
|
- <el-button type="primary" style="margin-left: 12px" text>上传图片</el-button>
|
|
|
- </el-upload>
|
|
|
- </div>
|
|
|
+ <div style="display: flex; width: 100%">
|
|
|
+ <div style="width: 80px">设计图:</div>
|
|
|
+ <div style="width: calc(100% - 80px)">
|
|
|
+ <el-image
|
|
|
+ fit="scale-down"
|
|
|
+ style="width: 148px; height: 148px; margin-right: 10px"
|
|
|
+ v-if="row.blueprint"
|
|
|
+ :src="row.blueprint"
|
|
|
+ @click="openFile(row.blueprint)" />
|
|
|
+ <div style="display: flex" v-if="!(route.query && route.query.detailId)">
|
|
|
+ <el-button type="primary" @click="clickDrawingFile(index)" text>选择图稿</el-button>
|
|
|
+ <el-upload
|
|
|
+ :show-file-list="false"
|
|
|
+ action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
+ :data="uploadImgData"
|
|
|
+ :before-upload="uploadImgFile"
|
|
|
+ :on-success="
|
|
|
+ (response, uploadFile) => {
|
|
|
+ return handleImgSuccess(uploadFile, index);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ style="width: 100%"
|
|
|
+ accept=".docx,.jpg,.jpeg,.png,.GIF,.JPG,.PNG">
|
|
|
+ <el-button type="primary" style="margin-left: 12px" text>上传图片</el-button>
|
|
|
+ </el-upload>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="display: flex; margin-top: 20px; width: 100%">
|
|
|
- <div style="width: 65px">图稿文件:</div>
|
|
|
- <div style="width: calc(100% - 65px)">
|
|
|
- <a
|
|
|
- style="color: #409eff; cursor: pointer; word-break: break-all; margin-right: 10px"
|
|
|
- @click="openFile(row.productionDocument)"
|
|
|
- v-if="row.productionDocument">
|
|
|
- {{ row.productionDocument }}
|
|
|
- </a>
|
|
|
- <div style="display: flex" v-if="!(route.query && route.query.detailId)">
|
|
|
- <el-button type="primary" @click="clickDrawingFile(index)" text>选择图稿</el-button>
|
|
|
- <el-upload
|
|
|
- :show-file-list="false"
|
|
|
- action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
- :data="uploadData"
|
|
|
- :before-upload="uploadFile"
|
|
|
- :on-success="
|
|
|
- (response, uploadFile) => {
|
|
|
- return handleSuccess(uploadFile, index);
|
|
|
- }
|
|
|
- "
|
|
|
- style="width: 100%">
|
|
|
- <el-button type="primary" style="margin-left: 12px" text>上传文件</el-button>
|
|
|
- </el-upload>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex; margin-top: 20px; width: 100%">
|
|
|
+ <div style="width: 80px">图稿文件:</div>
|
|
|
+ <div style="width: calc(100% - 80px)">
|
|
|
+ <a
|
|
|
+ style="color: #409eff; cursor: pointer; word-break: break-all; margin-right: 10px"
|
|
|
+ @click="openFile(row.productionDocument)"
|
|
|
+ v-if="row.productionDocument">
|
|
|
+ {{ row.productionDocument }}
|
|
|
+ </a>
|
|
|
+ <div style="display: flex" v-if="!(route.query && route.query.detailId)">
|
|
|
+ <el-button type="primary" @click="clickDrawingFile(index)" text>选择图稿</el-button>
|
|
|
+ <el-upload
|
|
|
+ :show-file-list="false"
|
|
|
+ action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
+ :data="uploadData"
|
|
|
+ :before-upload="uploadFile"
|
|
|
+ :on-success="
|
|
|
+ (response, uploadFile) => {
|
|
|
+ return handleSuccess(uploadFile, index);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ style="width: 100%">
|
|
|
+ <el-button type="primary" style="margin-left: 12px" text>上传文件</el-button>
|
|
|
+ </el-upload>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex; margin-top: 20px; width: 100%">
|
|
|
+ <div style="width: 80px">不干胶图片:</div>
|
|
|
+ <div style="width: calc(100% - 80px)">
|
|
|
+ <a
|
|
|
+ style="color: #409eff; cursor: pointer; word-break: break-all; margin-right: 10px"
|
|
|
+ @click="openFile(row.selfAdhesiveStickerFile.fileUrl)"
|
|
|
+ v-if="row.selfAdhesiveStickerFile && row.selfAdhesiveStickerFile.fileName">
|
|
|
+ {{ row.selfAdhesiveStickerFile.fileName }}
|
|
|
+ </a>
|
|
|
+ <div style="display: flex" v-if="!(route.query && route.query.detailId)">
|
|
|
+ <el-upload
|
|
|
+ :show-file-list="false"
|
|
|
+ action="https://winfaster.obs.cn-south-1.myhuaweicloud.com"
|
|
|
+ :data="uploadAdhesiveData"
|
|
|
+ :before-upload="uploadAdhesiveFile"
|
|
|
+ :on-success="
|
|
|
+ (response, uploadFile) => {
|
|
|
+ return handleAdhesiveSuccess(uploadFile, index);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ style="width: 100%">
|
|
|
+ <el-button type="primary" text>上传文件</el-button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="包材配件/单品" min-width="400">
|
|
@@ -401,6 +432,7 @@ const formOption = reactive({
|
|
|
const formData = reactive({
|
|
|
data: {
|
|
|
remark: "",
|
|
|
+ type: 1,
|
|
|
orderSkuList: [],
|
|
|
fileList: [],
|
|
|
},
|
|
@@ -409,6 +441,24 @@ const formConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
type: "title",
|
|
|
+ title: "类型",
|
|
|
+ label: "",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ prop: "type",
|
|
|
+ slotName: "type",
|
|
|
+ label: "订单类型",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "slot",
|
|
|
+ prop: "departmentId",
|
|
|
+ slotName: "departmentId",
|
|
|
+ label: "事业部",
|
|
|
+ itemWidth: 25,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "title",
|
|
|
title: "产品",
|
|
|
label: "",
|
|
|
},
|
|
@@ -515,6 +565,8 @@ const rules = ref({
|
|
|
sourcePlatform: [{ required: true, message: "请选择店铺来源", trigger: "change" }],
|
|
|
shopName: [{ required: true, message: "请选择店铺", trigger: "change" }],
|
|
|
quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
|
|
|
+ type: [{ required: true, message: "请选择订单类型", trigger: "change" }],
|
|
|
+ departmentId: [{ required: true, message: "请选择事业部", trigger: "change" }],
|
|
|
});
|
|
|
const getDemandData = () => {
|
|
|
proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
@@ -668,22 +720,35 @@ const getOrderDetail = (parameter) => {
|
|
|
activeNames.value = allIndex;
|
|
|
formOption.disabled = true;
|
|
|
}
|
|
|
- proxy.post("/fileInfo/getList", { businessIdList: [formData.data.id] }).then((fileObj) => {
|
|
|
- if (fileObj[formData.data.id] && fileObj[formData.data.id].length > 0) {
|
|
|
- let list = fileObj[formData.data.id].filter((item) => item.businessType == "0");
|
|
|
- if (list && list.length > 0) {
|
|
|
- fileList.value = list.map((item) => {
|
|
|
- return {
|
|
|
- raw: item,
|
|
|
- name: item.fileName,
|
|
|
- url: item.fileUrl,
|
|
|
+ let list = [formData.data.id];
|
|
|
+ if (formData.data.orderSkuList && formData.data.orderSkuList.length > 0) {
|
|
|
+ list = list.concat(formData.data.orderSkuList.map((item) => item.id));
|
|
|
+ proxy.post("/fileInfo/getList", { businessIdList: list }).then((fileObj) => {
|
|
|
+ if (fileObj[formData.data.id] && fileObj[formData.data.id].length > 0) {
|
|
|
+ let file = fileObj[formData.data.id].filter((item) => item.businessType == "0");
|
|
|
+ if (file && file.length > 0) {
|
|
|
+ fileList.value = file.map((item) => {
|
|
|
+ return {
|
|
|
+ raw: item,
|
|
|
+ name: item.fileName,
|
|
|
+ url: item.fileUrl,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ fileList.value = [];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (let i = 0; i < formData.data.orderSkuList.length; i++) {
|
|
|
+ if (fileObj[formData.data.orderSkuList[i].id] && fileObj[formData.data.orderSkuList[i].id].length > 0) {
|
|
|
+ formData.data.orderSkuList[i].selfAdhesiveStickerFile = {
|
|
|
+ id: fileObj[formData.data.orderSkuList[i].id][0].id,
|
|
|
+ fileName: fileObj[formData.data.orderSkuList[i].id][0].fileName,
|
|
|
+ fileUrl: fileObj[formData.data.orderSkuList[i].id][0].fileUrl,
|
|
|
};
|
|
|
- });
|
|
|
- } else {
|
|
|
- fileList.value = [];
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
};
|
|
|
const getStyle = (text) => {
|
|
@@ -707,6 +772,16 @@ const printType = ref([
|
|
|
dictValue: "双面",
|
|
|
},
|
|
|
]);
|
|
|
+const typeList = ref([
|
|
|
+ {
|
|
|
+ dictKey: 1,
|
|
|
+ dictValue: "自主订单",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictKey: 2,
|
|
|
+ dictValue: "委外订单",
|
|
|
+ },
|
|
|
+]);
|
|
|
const selectProduct = (row, SKU) => {
|
|
|
if (row.id) {
|
|
|
let list = formData.data.orderSkuList.filter((item) => item.skuSpecId === row.id && item.bomSpecId === row.bomSpecId);
|
|
@@ -943,6 +1018,22 @@ const onSuccessFile = (any, UploadFile) => {
|
|
|
const onPreviewFile = (file) => {
|
|
|
window.open(file.raw.fileUrl, "_blank");
|
|
|
};
|
|
|
+const uploadAdhesiveData = ref({});
|
|
|
+const uploadAdhesiveFile = async (file) => {
|
|
|
+ const res = await proxy.post("/fileInfo/getSing", { fileName: file.name });
|
|
|
+ uploadAdhesiveData.value = res.uploadBody;
|
|
|
+ file.id = res.id;
|
|
|
+ file.fileName = res.fileName;
|
|
|
+ file.fileUrl = res.fileUrl;
|
|
|
+ return true;
|
|
|
+};
|
|
|
+const handleAdhesiveSuccess = (UploadFile, index) => {
|
|
|
+ formData.data.orderSkuList[index].selfAdhesiveStickerFile = {
|
|
|
+ id: UploadFile.raw.id,
|
|
|
+ fileName: UploadFile.raw.fileName,
|
|
|
+ fileUrl: UploadFile.raw.fileUrl,
|
|
|
+ };
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|