From afebda12a2381e1150f86694a21f3122e2861bdb Mon Sep 17 00:00:00 2001 From: 15820893422 <1978476055@qq.com> Date: Fri, 5 Apr 2024 18:19:33 +0800 Subject: [PATCH] add --- babel.config.js | 3 +- package.json | 1 + src/api/setting.js | 45 +- src/views/order/index.vue | 4 +- src/views/product/addProduct/index.vue | 537 ++++++++++++------ src/views/product/productList/index.vue | 1 + src/views/product/productList/proDetails.vue | 298 +++++++++- .../systemForm/setSystem/modifyStoreInfo.vue | 84 ++- 8 files changed, 767 insertions(+), 206 deletions(-) diff --git a/babel.config.js b/babel.config.js index ba17966..8514aa8 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,6 @@ module.exports = { presets: [ '@vue/app' - ] + ], + plugins: ["@babel/plugin-proposal-optional-chaining"] } diff --git a/package.json b/package.json index f7da6b1..b633d22 100644 --- a/package.json +++ b/package.json @@ -85,6 +85,7 @@ }, "devDependencies": { "@babel/core": "7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.21.0", "@babel/register": "7.0.0", "@vue/cli-plugin-babel": "3.5.3", "@vue/cli-plugin-eslint": "^3.9.1", diff --git a/src/api/setting.js b/src/api/setting.js index e476054..9356c16 100644 --- a/src/api/setting.js +++ b/src/api/setting.js @@ -15,7 +15,20 @@ import request from './request' export function menuRoleApi(data) { return request.get(`system/role/lst`, data) } - +/** + * @description 产品服务费 -- 列表 + * @param {Object} param params {Object} 传值参数 + */ +export function serviceCodeApi() { + return request.get(`service/code`) +} +/** + * @description 商品上架费用 -- 列表 + * @param {Object} param params {Object} 传值参数 + */ +export function goodsCodeApi() { + return request.get(`goods/code`) +} /** * @description 身份管理 -- 新增 * @param {Object} param params {Object} 传值参数 @@ -154,7 +167,7 @@ export function marginRefund() { * @param {Object} param params {Object} 传值参数 */ export function marginRefundApply(data) { - return request.post('financial/refund/margin_apply',data) + return request.post('financial/refund/margin_apply', data) } /** * @description 一号通 -- 用户信息 @@ -225,31 +238,31 @@ export function updatedumpDataApi(data) { /** * @description 打印机配置 -- 添加 */ - export function printerAddApi() { +export function printerAddApi() { return request.get('store/printer/create/form') } /** * @description 打印机配置 -- 列表 */ - export function printerLstApi(data) { +export function printerLstApi(data) { return request.get('store/printer/lst', data) } /** * @description 打印机 -- 是否开启 */ - export function printerStatusApi(id, status) { +export function printerStatusApi(id, status) { return request.post(`store/printer/status/${id}`, status) } /** * @description 打印机配置 -- 编辑 */ - export function printerUpdateApi(id) { +export function printerUpdateApi(id) { return request.get(`store/printer/update/${id}/form`) } /** * @description 打印机配置 -- 删除 */ - export function printerDeleteApi(id) { +export function printerDeleteApi(id) { return request.delete(`store/printer/delete/${id}`) } /** @@ -273,14 +286,14 @@ export function scanUploadSave(scan_token, data) { /** * @description 扫码上传提交数据 */ -export function fileUpload(id,field) { - return request.post(`upload/image/${id}/file`,field); +export function fileUpload(id, field) { + return request.post(`upload/image/${id}/file`, field); } /** * @description 网络上传提交数据 */ export function onlineUpload(data) { - return request.post(`system/attachment/online_upload`,data); + return request.post(`system/attachment/online_upload`, data); } /** * @description 添加账户--表单 @@ -328,7 +341,7 @@ export function resetSccretKey(id) { * @description 系统表单--添加 */ export function systemForm(data) { - return request.post(`store/form/create`,data); + return request.post(`store/form/create`, data); } /** * @description 系统表单--详情 @@ -339,14 +352,14 @@ export function systemFormInfo(id) { /** * @description 系统表单--编辑 */ -export function systemFormUpdate(id,data) { - return request.post(`store/form/update/${id}`,data); +export function systemFormUpdate(id, data) { + return request.post(`store/form/update/${id}`, data); } /** * @description 系统表单--列表 */ export function systemFormList(data) { - return request.get(`store/form/lst`,data); + return request.get(`store/form/lst`, data); } /** * @description 系统表单--删除 @@ -358,6 +371,6 @@ export function formDeleteApi(id) { /** * @description 系统表单--详情 */ -export function formDetailList(id,data) { - return request.get(`store/form/user_lst/${id}`,data); +export function formDetailList(id, data) { + return request.get(`store/form/user_lst/${id}`, data); } \ No newline at end of file diff --git a/src/views/order/index.vue b/src/views/order/index.vue index e85e789..4de58c8 100644 --- a/src/views/order/index.vue +++ b/src/views/order/index.vue @@ -278,10 +278,10 @@ 手动发货 - {{ orderType == 1 ? '虚拟发货' : '无需物流' }} + diff --git a/src/views/product/addProduct/index.vue b/src/views/product/addProduct/index.vue index 72e5c0d..b5956a9 100644 --- a/src/views/product/addProduct/index.vue +++ b/src/views/product/addProduct/index.vue @@ -65,6 +65,16 @@ /> + + + + + + + + - + +
+
+ {{ file.name }} +
+ + + + + + + + + + +
点击上传
@@ -335,14 +369,36 @@ +
+
+ {{ file.name }} +
+ + + + + + + + + + +
点击上传
@@ -355,12 +411,33 @@ class="upload-demo" :action="filePdf" :headers="pdfHeaders" - :on-remove="trademarkRemoves" :on-success="trademarkSuccess" :before-upload="beforeUpload" - + list-type="picture-card" :file-list="formValidate.qualification.trademarkList" > +
+
+ {{ file.name }} +
+ + + + + + + + + + +
点击上传 @@ -372,12 +449,33 @@ class="upload-demo" :action="filePdf" :headers="pdfHeaders" - :on-remove="authorizedRemoves" :on-success="authorizedSuccess" :before-upload="beforeUpload" - + list-type="picture-card" :file-list="formValidate.qualification.authorizedList" > +
+
+ {{ file.name }} +
+ + + + + + + + + + +
点击上传 @@ -390,12 +488,33 @@ class="upload-demo" :action="filePdf" :headers="pdfHeaders" - :on-remove="commodityRemoves" :on-success="commoditySuccess" :before-upload="beforeUpload" - + list-type="picture-card" :file-list="formValidate.qualification.commodityList" > +
+
+ {{ file.name }} +
+ + + + + + + + + + +
点击上传 @@ -407,12 +526,33 @@ class="upload-demo" :action="filePdf" :headers="pdfHeaders" - :on-remove="otherRemoves" :on-success="otherSuccess" :before-upload="beforeUpload" - + list-type="picture-card" :file-list="formValidate.qualification.otherList" > +
+
+ {{ file.name }} +
+ + + + + + + + + + +
点击上传 @@ -437,12 +577,33 @@ class="upload-demo" :action="filePdf" :headers="pdfHeaders" - :on-remove="importHandleRemoves" :on-success="importHandleSuccess" :before-upload="beforeUpload" - + list-type="picture-card" :file-list="formValidate.qualification.importBusinessList" > +
+
+ {{ file.name }} +
+ + + + + + + + + + +
点击上传 @@ -455,12 +616,33 @@ class="upload-demo" :action="filePdf" :headers="pdfHeaders" - :on-remove="importAuthorizedRemoves" :on-success="importAuthorizedSuccess" :before-upload="beforeUpload" - + list-type="picture-card" :file-list="formValidate.qualification.importAuthorizedList" > +
+
+ {{ file.name }} +
+ + + + + + + + + + +
点击上传 @@ -473,12 +655,33 @@ class="upload-demo" :action="filePdf" :headers="pdfHeaders" - :on-remove="customsRemoves" :on-success="customsSuccess" :before-upload="beforeUpload" - + list-type="picture-card" :file-list="formValidate.qualification.customsList" > +
+
+ {{ file.name }} +
+ + + + + + + + + + +
点击上传 @@ -490,12 +693,33 @@ class="upload-demo" :action="filePdf" :headers="pdfHeaders" - :on-remove="packingRemoves" :on-success="packingSuccess" :before-upload="beforeUpload" - + list-type="picture-card" :file-list="formValidate.qualification.packingList" > +
+
+ {{ file.name }} +
+ + + + + + + + + + +
点击上传 @@ -507,12 +731,33 @@ class="upload-demo" :action="filePdf" :headers="pdfHeaders" - :on-remove="importOtherRemoves" :on-success="importOtherSuccess" :before-upload="beforeUpload" - + list-type="picture-card" :file-list="formValidate.qualification.importOtherList" > +
+
+ {{ file.name }} +
+ + + + + + + + + + +
点击上传 @@ -877,7 +1122,7 @@ class="upLoadPicBox" @click="modalPicTap('1', 'dan', 'pi')" > -
+
@@ -1432,7 +1677,7 @@ - + + - + { this.setSort() @@ -2307,148 +2554,78 @@ export default { console.log(this.importBusinessList); this.$refs[name].clearValidate() }, - beforeUpload(file) { + beforeUpload(file,fileList) { if (['application/pdf', 'image/jpeg', 'image/png', 'image/jpg', 'image/gif'].indexOf(file.type) == -1) { this.$message.error('只能上传图片和PDF文件') return false } }, - handleRemoves(file) { + handlePictureCardPreview(file) { console.log(file); - if (file.url) { - this.formValidate.qualification.businessList = this.formValidate.qualification.businessList.filter(res => { - return res.url !== file.url - }) + // 预览pdf + if (['application/pdf'].includes(file.type)) { + window.open(file.response.data.src) + return + } + // 预览pdf图片 + this.$refs[file.uid].clickHandler(); + }, + // 移除 + onRemoveHandler(file, name) { + // if (fileList) return + const { uploadFiles } = this.$refs[name] + uploadFiles.splice( + uploadFiles.findIndex((item) => item.uid === file.uid), + 1 + ) + this.formValidate.qualification[name].splice( + this.formValidate.qualification[name].findIndex( + (item) => item.url !== file.url + ), + 1 + ) + }, + initSuccess(name,res,fileList){ + if (res.status == 200) { + if (fileList.every(item => item.status == "success")) { + fileList.map(item => { + item.response && this.formValidate.qualification[name].push({ ...item,url: res.data.src,type:item.raw.type}); + }) + } } }, - handleSuccess(res, file) { - if (res.status === 200) { - this.formValidate.qualification.businessList.push({ name: file.name, url: res.data.src }) - } - console.log(this.formValidate.qualification.businessList) + handleSuccess(res, file,fileList) { + this.initSuccess('businessList',res,fileList) }, - licenRemoves(file) { - if (file.url) { - this.formValidate.qualification.licenceList = this.formValidate.qualification.licenceList.filter(res => { - return res.url !== file.url - }) - } + licenSuccess(res, file,fileList) { + this.initSuccess('licenceList',res,fileList) }, - licenSuccess(res, file) { - if (res.status === 200) { - this.formValidate.qualification.licenceList.push({ name: file.name, url: res.data.src }) - } + trademarkSuccess(res, file,fileList) { + this.initSuccess('trademarkList',res,fileList) }, - trademarkRemoves(file) { - if (file.url) { - this.formValidate.qualification.trademarkList = this.formValidate.qualification.trademarkList.filter(res => { - return res.url !== file.url - }) - } + authorizedSuccess(res, file,fileList) { + this.initSuccess('authorizedList',res,fileList) }, - trademarkSuccess(res, file) { - if (res.status === 200) { - this.formValidate.qualification.trademarkList.push({ name: file.name, url: res.data.src }) - } + commoditySuccess(res, file,fileList) { + this.initSuccess('commodityList',res,fileList) }, - authorizedRemoves(file) { - if (file.url) { - this.formValidate.qualification.authorizedList = this.formValidate.qualification.authorizedList.filter(res => { - return res.url !== file.url - }) - } + otherSuccess(res, file,fileList) { + this.initSuccess('otherList',res,fileList) }, - authorizedSuccess(res, file) { - if (res.status === 200) { - this.formValidate.qualification.authorizedList.push({ name: file.name, url: res.data.src }) - } + importHandleSuccess(res, file,fileList) { + this.initSuccess('importBusinessList',res,fileList) }, - commodityRemoves(file) { - if (file.url) { - this.formValidate.qualification.commodityList = this.formValidate.qualification.commodityList.filter(res => { - return res.url !== file.url - }) - } + importAuthorizedSuccess(res, file,fileList) { + this.initSuccess('importAuthorizedList',res,fileList) }, - commoditySuccess(res, file) { - if (res.status === 200) { - this.formValidate.qualification.commodityList.push({ name: file.name, url: res.data.src }) - } + customsSuccess(res, file,fileList) { + this.initSuccess('customsList',res,fileList) }, - otherRemoves(file) { - if (file.url) { - this.formValidate.qualification.otherList = this.formValidate.qualification.otherList.filter(res => { - return res.url !== file.url - }) - } + packingSuccess(res, file,fileList) { + this.initSuccess('packingList',res,fileList) }, - otherSuccess(res, file) { - if (res.status === 200) { - this.formValidate.qualification.otherList.push({ name: file.name, url: res.data.src }) - } - }, - importHandleRemoves(file) { - console.log(file); - if (file.url) { - this.formValidate.qualification.importBusinessList = this.formValidate.qualification.importBusinessList.filter(res => { - return res.url !== file.url - }) - } - }, - importHandleSuccess(res, file) { - console.log(file); - console.log(res); - if (res.status === 200) { - this.formValidate.qualification.importBusinessList.push({ name: file.name, url: res.data.src }) - } - }, - importAuthorizedRemoves(file) { - if (file.url) { - this.formValidate.qualification.importAuthorizedList = this.formValidate.qualification.importAuthorizedList.filter(res => { - return res.url !== file.url - }) - } - }, - importAuthorizedSuccess(res, file) { - if (res.status === 200) { - this.formValidate.qualification.importAuthorizedList.push({ name: file.name, url: res.data.src }) - } - }, - customsSuccess(res, file) { - if (res.status === 200) { - this.formValidate.qualification.customsList.push({ name: file.name, url: res.data.src }) - } - }, - customsRemoves(file) { - if (file.url) { - this.formValidate.qualification.customsList = this.formValidate.qualification.customsList.filter(res => { - return res.url !== file.url - }) - } - }, - packingSuccess(res, file) { - if (res.status === 200) { - this.formValidate.qualification.packingList.push({ name: file.name, url: res.data.src }) - } - }, - packingRemoves(file) { - if (file.url) { - this.formValidate.qualification.packingList = this.formValidate.qualification.packingList.filter(res => { - return res.url !== file.url - }) - } - }, - importOtherSuccess(res, file) { - if (res.status === 200) { - this.formValidate.qualification.importOtherList.push({ name: file.name, url: res.data.src }) - } - }, - importOtherRemoves(file) { - if (file.url) { - this.formValidate.qualification.importOtherList = this.formValidate.qualification.importOtherList.filter(res => { - return res.url !== file.url - }) - } + importOtherSuccess(res, file,fileList) { + this.initSuccess('importOtherList',res,fileList) }, setSort() { // ref一定跟table上面的ref一致 @@ -3397,6 +3574,7 @@ export default { svip_price_type: info.svip_price_type || 0, qualification:info.qualification }; + console.log(info.qualification); if (info.svip_price_type != 0 && info.mer_svip_status) this.attrVal = { price: null, @@ -3692,7 +3870,7 @@ export default { } .upload-demo{ /deep/ .el-upload-list__item{ - width:20% + width:10% } // /deep/ .el-upload{ // border: 1px dotted #0fc6c2; @@ -3701,6 +3879,49 @@ export default { // line-height: 50px; // } } +::v-deep .el-upload--picture-card{ + width: auto; + line-height: normal; + height: unset; +} +.noData { + padding: 10px 0; + text-align: center; + color: #ccc; +} + +.el_upload_tip { + margin-top: 15px; + line-height: 20px; + text-align: left; + color: red; +} + +.el_upload_preview_list { + height: 100%; + // el-uplaod组件卡片预览类型预览pdf样式 + .pdfContainer { + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + } +} + +.blue-theme { + .dialog_section_title { + border-top: 1px solid #202936; + border-bottom: 1px solid #202936; + } +} + +.night-theme { + .dialog_section_title { + border-top: 1px solid #202936; + border-bottom: 1px solid #202936; + } +} ::v-deep .specsList th{ line-height: 20px!important; diff --git a/src/views/product/productList/index.vue b/src/views/product/productList/index.vue index 1456814..5c36139 100644 --- a/src/views/product/productList/index.vue +++ b/src/views/product/productList/index.vue @@ -189,6 +189,7 @@
{{ scope.row.spec_type==0 ? '[单规格]' : '[多规格]' }}{{ scope.row.store_name || '-' }}
+ diff --git a/src/views/product/productList/proDetails.vue b/src/views/product/productList/proDetails.vue index 31a6a3b..097865f 100644 --- a/src/views/product/productList/proDetails.vue +++ b/src/views/product/productList/proDetails.vue @@ -47,11 +47,23 @@
  • 封面图:
    - + +
  • 轮播图:
    - + +
  • @@ -140,7 +152,13 @@ @@ -273,16 +291,20 @@
  • - +
      @@ -307,23 +329,10 @@
    -
  • + -
  • -
    审核图:
    - - -
  • @@ -395,6 +404,200 @@
    + + 商品名称: + + 国产 + 进口 + + +
    + 生产企业名称:{{ qualification.production_name }} + +
    生产营业执照:
    +
    +
    + {{ item.name }} +
    + +
    +
    +
    +
    + +
    商标注册证:
    +
    +
    + {{ item.name }} +
    + +
    +
    +
    +
    + +
    销售授权及其他:
    +
    +
    + {{ item.name }} +
    + +
    +
    +
    +
    + +
    商品检测报告:
    +
    +
    + {{ item.name }} +
    + +
    +
    +
    +
    + +
    其他资质:
    +
    +
    + {{ item.name }} +
    + +
    +
    +
    +
    +
    +
    + 进口/企业境内总代企业名称: {{ qualification.import_name }} + +
    生产营业执照:
    +
    +
    + {{ item.name }} +
    + +
    +
    +
    +
    + +
    销售授权及其他:
    +
    +
    + {{ item.name }} +
    + +
    +
    +
    +
    + +
    海关检验检疫证书及报关单:
    +
    +
    + {{ item.name }} +
    + +
    +
    +
    +
    + +
    产品外包装实物图:
    +
    +
    + {{ item.name }} +
    + +
    +
    +
    +
    + +
    其他资质:
    +
    +
    + {{ item.name }} +
    + +
    +
    +
    +
    +
    +
    @@ -567,6 +770,23 @@ export default { productId: '', direction: 'rtl', activeName: 'basic', + qualification:{ + production_name: '', + businessList: [], + licenceList: [], + trademarkList: [], + authorizedList: [], + commodityList: [], + otherList: [], + importBusinessList: [], + importAuthorizedList: [], + customsList: [], + packingList: [], + importOtherList: [], + commodity_type: 0, + brands_name: '', + import_name: '' + }, productData: {}, formThead: Object.assign({}, objTitle), manyTabDate: {}, @@ -607,6 +827,11 @@ export default { filters: { }, methods: { + getType(val){ + var regex = /(?:\.([^.]+))?$/; + let suffix = regex.exec(val.url)[1] + return suffix == 'pdf' + }, handleClose() { this.activeName = 'basic'; this.$emit('closeDrawer'); @@ -617,6 +842,7 @@ export default { productDetailApi(id).then(res => { this.loading = false; this.productData = res.data + this.qualification = res.data.qualification this.mer_svip_status = res.data.mer_svip_status this.svip_type = res.data.svip_price_type if (this.productData.spec_type === 0) { @@ -697,6 +923,40 @@ export default { };