审核更新

master
lion 11 months ago
parent 237d9fe1f7
commit 8829939e12

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
<script src="tinymce/tinymce.min.js"></script> <!-- <script src="tinymce/tinymce.min.js"></script> -->
<!-- <script> <!-- <script>
window._AMapSecurityConfig = { window._AMapSecurityConfig = {
securityJsCode: '0d59d0a3fa5483849b52b0edc4bc97ec', securityJsCode: '0d59d0a3fa5483849b52b0edc4bc97ec',

@ -55,6 +55,14 @@ export function destroy(params) {
}) })
} }
export function batchSort(data) {
return request({
method: "post",
url: "/api/admin/product-category-applications/batch-sort",
data
})
}

@ -55,6 +55,14 @@ export function destroy(params) {
}) })
} }
export function phaseDel(params) {
return request({
method: "get",
url: "/api/admin/product-category/phase-destroy",
params
})
}

@ -486,49 +486,41 @@ export default {
enter-active-class="slide-in-bottom" enter-active-class="slide-in-bottom"
leave-to-class="slide-out-down" leave-to-class="slide-out-down"
> >
<Page <el-pagination
page-size-opts={this.pageSizeOpts} page-sizes={this.pageSizeOpts}
show-total={true}
page-size={this.pageSize} page-size={this.pageSize}
v-show={this.isShowPage} currentPage={this.selectOpt.page}
background
layout="total, sizes, prev, pager, next, jumper"
total={ total={
this.action this.action
? this.totalData || this.listData.length ? this.totalData || this.listData.length
: this.total : this.total
} }
size="small"
// show-elevator={true}
// show-sizer={this.showSizer}
class="xy-table__page" class="xy-table__page"
on={{ on={{
["on-page-size-change"]: (e) => { ['update:currentPage']:(newval)=>{
this.selectOpt.page = newval
},
["size-change"]: (e) => {
if (this.action) { if (this.action) {
this.selectOpt.page_size = e; this.selectOpt.page_size = e;
this.selectOpt.page = 1; this.selectOpt.page = 1;
this.getTableData(); this.getTableData();
} }
this.selectOpt.page = 1;
this.$emit("pageSizeChange", e); this.$emit("pageSizeChange", e);
}, },
["on-change"]: (e) => { ["current-change"]: (e) => {
if (this.action) { if (this.action) {
this.selectOpt.page = e; this.selectOpt.page = e;
this.getTableData(); this.getTableData();
} }
this.$emit("pageIndexChange", e); this.$emit("pageIndexChange", e);
}, },
}} }}>
scopedSlots={{ </el-pagination>
default: () => {
return (
<span>
A total of {this.action
? this.totalData || this.listData.length
: this.total} items
</span>
);
},
}}
></Page>
</transition> </transition>
<el-popover <el-popover

@ -1,6 +1,6 @@
<template> <template>
<div class="tinymce"> <div class="tinymce">
<Editor v-model="myValue" :id="keyid" :init="init" :disabled="disabled"></Editor> <Editor v-model="myValue" :init="init" :disabled="disabled"></Editor>
</div> </div>
</template> </template>
@ -30,6 +30,24 @@
import 'tinymce/plugins/code' import 'tinymce/plugins/code'
import "tinymce/plugins/image" import "tinymce/plugins/image"
import "tinymce/plugins/imagetools" import "tinymce/plugins/imagetools"
import 'tinymce/themes/silver/theme'
import "tinymce/plugins/searchreplace"
import "tinymce/plugins/template"
import "tinymce/plugins/directionality"
import "tinymce/plugins/paste"
import "tinymce/plugins/preview"
import "tinymce/plugins/visualchars"
import "tinymce/plugins/charmap"
import "tinymce/plugins/anchor"
import "tinymce/plugins/codesample"
import "tinymce/plugins/pagebreak"
import "tinymce/plugins/nonbreaking"
import "tinymce/plugins/advlist"
import "tinymce/plugins/emoticons"
import "tinymce/plugins/insertdatetime"
import "tinymce/plugins/autosave"
// import "/public/tinymce/plugins/axupimgs/plugin.js" // import "/public/tinymce/plugins/axupimgs/plugin.js"
export default { export default {
components: { components: {
@ -44,10 +62,6 @@
type: String, type: String,
default: "", default: "",
}, },
keyid:{
type: String,
default: "tinymce",
},
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false, default: false,
@ -55,14 +69,20 @@
plugins: { plugins: {
type: [String, Array], type: [String, Array],
// axupimgs // axupimgs
default: "code image paste preview searchreplace autolink directionality visualblocks visualchars fullscreen template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave ", default: "code image autolink visualblocks fullscreen table hr lists wordcount imagetools textpattern help",
// default: "code image paste preview searchreplace autolink directionality visualblocks visualchars fullscreen template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave ",
}, },
toolbar: { toolbar: {
type: [String, Array], type: [String, Array],
// axupimgs // axupimgs
default: ` undo redo restoredraft | code | image | imagetools | assignment | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough anchor | alignleft aligncenter alignright alignjustify outdent indent | default: ` undo redo restoredraft | code | image | imagetools | assignment | cut copy | forecolor backcolor bold italic underline strikethrough | alignleft aligncenter alignright alignjustify outdent indent |
styleselect formatselect fontselect fontsizeselect | table charmap emoticons hr pagebreak | bullist numlist | blockquote subscript superscript removeformat | styleselect formatselect fontselect fontsizeselect | table hr | bullist numlist | blockquote subscript superscript removeformat |
insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter`, print | fullscreen | bdmap indent2em lineheight formatpainter`,
// default: ` undo redo restoredraft | code | image | imagetools | assignment | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough anchor | alignleft aligncenter alignright alignjustify outdent indent |
// styleselect formatselect fontselect fontsizeselect | table charmap emoticons hr pagebreak | bullist numlist | blockquote subscript superscript removeformat |
// insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter`,
}, },
menubar: { menubar: {
type: String, type: String,
@ -70,14 +90,16 @@
}, },
}, },
data() { data() {
var random = Math.round(Math.random() * 5000)
return { return {
myValue: this.value, myValue: this.value,
showImg: false, showImg: false,
// tinymceId:,'tinymceId' + random
imgUploadUrl: `${process.env.VUE_APP_UPLOAD_API}`, imgUploadUrl: `${process.env.VUE_APP_UPLOAD_API}`,
init: { init: {
// language_url: "/public/tinymce/langs/zh_CN.js", // // language_url: "/public/tinymce/langs/zh_CN.js", //
// language: "zh_CN", // language: "zh_CN",
selector:`#${this.keyid}`, // selector:`#${this.keyid}`,
// selector: "#textarea", // selector: "#textarea",
height: this.height, height: this.height,
plugins: this.plugins, plugins: this.plugins,
@ -85,8 +107,9 @@
toolbar: this.toolbar, toolbar: this.toolbar,
branding: false, branding: false,
menubar: this.menubar, menubar: this.menubar,
inline: false,
// //
images_upload_url: this.imgUploadUrl, images_upload_url: `${process.env.VUE_APP_UPLOAD_API}`,
images_upload_handler: (blobInfo, success, failure) => { images_upload_handler: (blobInfo, success, failure) => {
this.handleImgUpload(blobInfo, success, failure); this.handleImgUpload(blobInfo, success, failure);
}, },
@ -120,6 +143,9 @@
mounted() { mounted() {
tinymce.init({}); tinymce.init({});
}, },
beforeDestroy() {
// tinymce.destroy();
},
watch: { watch: {
value(newValue) { value(newValue) {
this.myValue = newValue; this.myValue = newValue;

@ -9,6 +9,7 @@ export default{
brandList: [], brandList: [],
topicList: [], topicList: [],
equipmentList:[], equipmentList:[],
tagsList:[]
} }
}, },
@ -35,7 +36,7 @@ export default{
}) })
}, },
getResourcePara(){ getResourcePara(){
let number = ['topic','equipment'] let number = ['topic','equipment','tag']
getparameter({ getparameter({
number: number, number: number,
type:2 type:2
@ -48,6 +49,9 @@ export default{
if(item.number==='equipment'){ if(item.number==='equipment'){
this.equipmentList = item.detail this.equipmentList = item.detail
} }
if(item.number==='tag'){
this.tagsList = item.detail
}
}) })
}) })
} }

@ -38,7 +38,7 @@ export default{
}) })
}, },
getResourcePara(){ getResourcePara(){
let number = ['catalogTypeList','specificSampleList'] let number = ['catalogTypeList']
getparameter({ getparameter({
number: number, number: number,
type:3 type:3

@ -12,24 +12,39 @@
</div> </div>
</div> </div>
</template> </template>
<template v-slot:type>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Sample Type
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" v-model="form.type" placeholder="Please Select">
<el-option v-for="item in sampleTypeList" :key="item.id" :label="item.value" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:sort> <template v-slot:sort>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Sort <span style="color: red;font-weight: bold;padding-right: 4px;"></span>Sort
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input placeholder="Please Input" style="width:100%" v-model="form.sort"></el-input> <el-input placeholder="Please Input" style="width:100%" v-model="form.sort"></el-input>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:size> <template v-slot:size>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Size Exclusion <span style="color: red;font-weight: bold;padding-right: 4px;"></span>Size Exclusion
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.size" placeholder="Please Select"> <el-select style="width:100%" multiple filterable collapse-tags v-model="form.size"
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name" :value="item.id"></el-option> placeholder="Please Select">
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
@ -40,8 +55,10 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Ion Exchange <span style="color: red;font-weight: bold;padding-right: 4px;"></span>Ion Exchange
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.lon" placeholder="Please Select"> <el-select style="width:100%" multiple filterable collapse-tags v-model="form.lon"
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name" :value="item.id"></el-option> placeholder="Please Select">
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
@ -52,8 +69,10 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Reversed phase <span style="color: red;font-weight: bold;padding-right: 4px;"></span>Reversed phase
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.phase" placeholder="Please Select"> <el-select style="width:100%" multiple filterable collapse-tags v-model="form.phase"
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name" :value="item.id"></el-option> placeholder="Please Select">
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
@ -64,12 +83,28 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Hydrophobic Interaction <span style="color: red;font-weight: bold;padding-right: 4px;"></span>Hydrophobic Interaction
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable="" collapse-tags v-model="form.interaction" placeholder="Please Select"> <el-select style="width:100%" multiple filterable collapse-tags v-model="form.interaction"
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name" :value="item.id"></el-option> placeholder="Please Select">
<el-option v-for="item in productPhaseList" :key="item.id" :label="item.name"
:value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:webinar_ids>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Webinar
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.webinar_ids"
placeholder="Please Select">
<el-option v-for="item in webinarList" :key="item.id" :label="item.title" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
</xy-dialog> </xy-dialog>
</div> </div>
@ -80,6 +115,9 @@
save, save,
show show
} from "@/api/application/category.js" } from "@/api/application/category.js"
import {
index as getBaseList
} from "@/api/system/baseForm.js"
import { import {
index index
} from "@/api/product/category.js" } from "@/api/product/category.js"
@ -89,31 +127,60 @@
isShow: false, isShow: false,
id: '', id: '',
type: 'add', type: 'add',
productPhaseList:[], productPhaseList: [],
webinarList: [],
sampleTypeList: [{
id: 0,
value: 'Normal'
}, {
id: 1,
value: 'Special'
}],
form: { form: {
name: '', name: '',
sort:0, type: 0,
sort: 0,
size: [], size: [],
lon: [], lon: [],
phase: [], phase: [],
interaction: [], interaction: [],
webinar_ids: []
}, },
rules: { rules: {
name: [{ name: [{
required: true, required: true,
message: 'Please Input' message: 'Please Input'
}], }],
type: [{
required: true,
message: 'Please Select'
}],
} }
} }
}, },
created() { created() {
this.getProductPhase() this.getProductPhase()
this.getWebList()
}, },
methods: { methods: {
async getProductPhase(){ async getProductPhase() {
const res = await index({page:1,page_size:999,type:2,sort_type: 'ASC',sort_name: 'sort'}) const res = await index({
page: 1,
page_size: 9999,
type: 2,
sort_type: 'ASC',
sort_name: 'sort'
})
this.productPhaseList = res.data this.productPhaseList = res.data
}, },
async getWebList() {
const res = await getBaseList({
table_name: 'webinars',
page: 1,
page_size: 9999,
})
this.webinarList = res.data
},
submit() { submit() {
if (this.id) { if (this.id) {
this.form.id = this.id this.form.id = this.id
@ -141,10 +208,12 @@
show_relation: [] show_relation: []
}).then(res => { }).then(res => {
this.form = this.base.requestToForm(res, this.form) this.form = this.base.requestToForm(res, this.form)
this.form.size= res.size?res.size:[] this.form.type = res.type ? res.type : 0
this.form.lon= res.lon?res.lon:[] this.form.size = res.size ? res.size : []
this.form.phase= res.phase?res.phase:[] this.form.lon = res.lon ? res.lon : []
this.form.interaction= res.interaction?res.interaction:[] this.form.phase = res.phase ? res.phase : []
this.form.interaction = res.interaction ? res.interaction : [],
this.form.webinar_ids = res.webinar_ids ? res.webinar_ids : []
}) })
} }
}, },
@ -158,11 +227,13 @@
this.id = '' this.id = ''
this.form = { this.form = {
name: '', name: '',
sort:0, type: 0,
sort: 0,
size: [], size: [],
lon: [], lon: [],
phase: [], phase: [],
interaction: [], interaction: [],
webinar_ids: []
} }
this.$refs['dialog'].reset() this.$refs['dialog'].reset()
} }

@ -5,7 +5,7 @@
<template v-slot:application_type_id> <template v-slot:application_type_id>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Application Category <span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Application Samples
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select style="width:100%" filterable v-model="form.application_type_id" placeholder="Please Select"> <el-select style="width:100%" filterable v-model="form.application_type_id" placeholder="Please Select">
@ -101,6 +101,20 @@
</div> </div>
</div> </div>
</template> </template>
<template v-slot:tag_ids>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Tags
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.tag_ids"
placeholder="Please Select">
<el-option v-for="item in tagsList" :key="item.id" :label="item.value" :value="item.id"></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:file_ids> <template v-slot:file_ids>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
@ -208,6 +222,7 @@
branch: [], branch: [],
topic: [], topic: [],
equipment: [], equipment: [],
tag_ids: [],
file_ids: '', file_ids: '',
application_details: [], application_details: [],
}, },
@ -304,7 +319,8 @@
show_relation: ['applicationDetails'] show_relation: ['applicationDetails']
}).then(res => { }).then(res => {
this.form = this.base.requestToForm(res, this.form) this.form = this.base.requestToForm(res, this.form)
this.form.application_details = res.application_details ? res.application_details : [] this.form.application_details = res.application_details ? res.application_details : [],
this.form.tag_ids = res.tag_ids?res.tag_ids:[]
if (res.files && res.files.length > 0) { if (res.files && res.files.length > 0) {
this.filesList = [] this.filesList = []
res.files.map(item => { res.files.map(item => {
@ -336,6 +352,7 @@
branch: [], branch: [],
topic: [], topic: [],
equipment: [], equipment: [],
tag_ids: [],
file_ids: '', file_ids: '',
application_details: [], application_details: [],
} }

@ -35,8 +35,7 @@
visitLog visitLog
} from "@/api/customer"; } from "@/api/customer";
export default { export default {
components: { components: {},
},
data() { data() {
return { return {
select: { select: {
@ -50,20 +49,30 @@
width: 50, width: 50,
fixed: 'left' fixed: 'left'
}, { }, {
prop: 'email', prop: 'user.email',
label: 'email', label: 'User Email',
align: 'left',
width: 180,
}, {
prop: 'title',
label: 'Title',
align: 'left', align: 'left',
width: 240, width: 180,
}, { }, {
prop: 'web', prop: 'url',
label: 'Visit Web', label: 'Url',
align: 'left' align: 'left',
},
{
prop: 'product_category.name',
label: 'Product Phase',
align: 'left',
}, },
{ {
prop: 'Created_At', prop: 'created_at',
label: 'created_at(创建时间)', label: 'Access Time',
align: 'left', align: 'left',
width: 240 width: 180
} }
] ]
@ -89,7 +98,8 @@
}, },
async getList() { async getList() {
const res = await visitLog({ const res = await visitLog({
...this.select ...this.select,
show_relation: ['user', 'productCategory'],
}) })
this.list = res.data this.list = res.data
this.total = res.total this.total = res.total

@ -24,13 +24,55 @@
</lx-header> </lx-header>
</div> </div>
</div> </div>
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" <xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
@pageSizeChange="pageSizeChange" :table-item="table_item"> :table-item="table_item">
<template v-slot:product>
<el-table-column align='left' label="Product" minWidth="360" header-align="center">
<!-- <template slot-scope="scope">
<el-table :data="scope.row.order_products" style="width: 100%; margin-top: 10px;">
<el-table-column prop="name" label="订单名称"></el-table-column>
<el-table-column prop="number" label="订单日期"></el-table-column>
<el-table-column prop="total" label="金额"></el-table-column>
</el-table>
</template> -->
<el-table-column align='left' label="name" width="360" header-align="center">
<template slot-scope="scope">
<template v-if="scope.row.order_products && scope.row.order_products.length>0">
<template v-for="item in scope.row.order_products">
<div class="product-item">{{item.product.name}}</div>
</template>
</template>
</template>
</el-table-column>
<el-table-column align='left' label="number" width="360" header-align="center">
<template slot-scope="scope">
<template v-if="scope.row.order_products && scope.row.order_products.length>0">
<template v-for="item in scope.row.order_products">
<div class="product-item">{{item.product.number}}</div>
</template>
</template>
</template>
</el-table-column>
<el-table-column align='left' label="total" width="120" header-align="center">
<template slot-scope="scope">
<template v-if="scope.row.order_products && scope.row.order_products.length>0">
<template v-for="item in scope.row.order_products">
<div class="product-item">{{item.total}}</div>
</template>
</template>
</template>
</el-table-column>
</el-table-column>
</template>
<template v-slot:btns> <template v-slot:btns>
<el-table-column align='left' fixed="right" label="Operate" width="180" header-align="center"> <el-table-column align='center' fixed="right" label="Operate" width="120" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-button type="primary" size="small" @click="editNote('editor',scope.row.id)">edit</el-button> --> <!-- <el-button type="primary" size="small" @click="editNote('editor',scope.row.id)">edit</el-button> -->
<el-popconfirm confirm-button-text="confirm" cancel-button-text="cancel" style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="Are you sure to delete it?"> <el-popconfirm confirm-button-text="confirm" cancel-button-text="cancel" style="margin:0 10px"
@confirm="deleteList(scope.row.id)" title="Are you sure to delete it?">
<el-button type="danger" size="small" slot="reference">delete</el-button> <el-button type="danger" size="small" slot="reference">delete</el-button>
</el-popconfirm> </el-popconfirm>
</template> </template>
@ -46,8 +88,7 @@
destroy destroy
} from "@/api/order/index.js" } from "@/api/order/index.js"
export default { export default {
components: { components: {},
},
data() { data() {
return { return {
select: { select: {
@ -61,32 +102,41 @@
type: 'index', type: 'index',
width: 50, width: 50,
fixed: 'left' fixed: 'left'
},{ }, {
prop: 'customer', prop: 'number',
label: 'Customer', label: 'Order Number',
align: 'left', align: 'left',
},{ width: 240
}, {
prop: 'product', prop: 'product',
label: 'Product', label: 'Product',
align: 'left', align: 'left',
},{ minWidth: 360,
prop: 'list_price', // multiHd:[{
label: 'List Price', // prop: 'name',
align: 'left', // label: 'Name',
},{ // align: 'left',
prop: 'quantity', // },{
label: 'Quantity', // prop: 'number',
align: 'left', // label: 'Number',
},{ // align: 'left',
prop: 'email', // }]
}, {
prop: 'user.email',
label: 'Email', label: 'Email',
align: 'left', align: 'left',
},{ width: 180
prop: 'address', }, {
prop: 'user.country',
label: 'Country',
align: 'left',
width: 180
}, {
prop: 'user.address',
label: 'Address', label: 'Address',
align: 'left', align: 'left',
} width: 360
] }]
} }
}, },
created() { created() {
@ -110,11 +160,11 @@
async getList() { async getList() {
const res = await index({ const res = await index({
...this.select, ...this.select,
show_relation:['orderProducts','user'], show_relation: ['orderProducts.product', 'user'],
filter:[{ filter: [{
key:'number', key: 'number',
op:'like', op: 'like',
value:this.select.number value: this.select.number
}] }]
}) })
this.list = res.data this.list = res.data
@ -123,7 +173,7 @@
deleteList(id) { deleteList(id) {
var that = this; var that = this;
destroy({ destroy({
id:id id: id
}).then(response => { }).then(response => {
this.$Message.success('Success'); this.$Message.success('Success');
this.getList() this.getList()
@ -137,5 +187,15 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .product-item {
margin: 0 -10px;
padding: 5px 10px;
border-bottom: 1px solid #EBEEF5;
height: 50px;
display: flex;
align-items: center;
}
::v-deep .el-table td.el-table__cell div .product-item:last-child{
border-bottom:none;
}
</style> </style>

@ -111,6 +111,7 @@
type:this.select.type, type:this.select.type,
sort_type: 'ASC', sort_type: 'ASC',
sort_name: 'sort', sort_name: 'sort',
name:this.select.name
}) })
this.list = res.data this.list = res.data
this.total = res.total this.total = res.total

@ -44,6 +44,8 @@
type: 'add', type: 'add',
showWang: false, showWang: false,
form: { form: {
product_category_id:'',
sort:'',
title: '', title: '',
content: '' content: ''
}, },
@ -62,6 +64,14 @@
changeEditor(e) { changeEditor(e) {
this.form.content = e this.form.content = e
}, },
setProductCategoryId(e){
if(e){
this.form.product_category_id = e
}
},
setSort(e){
this.form.sort = e?e:0
},
submit() { submit() {
if (this.id) { if (this.id) {
@ -90,6 +100,7 @@
}).then(res => { }).then(res => {
this.form = this.base.requestToForm(res, this.form) this.form = this.base.requestToForm(res, this.form)
this.form.content = res.content ? res.content : '' this.form.content = res.content ? res.content : ''
this.form.sort = res.sort?res.sort:0
this.showWang = true this.showWang = true
}) })
} }

@ -30,6 +30,8 @@
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input type="textarea" :rows="5" v-model="form.description"></el-input> <el-input type="textarea" :rows="5" v-model="form.description"></el-input>
<!-- <my-tinymce v-if="showWang" :height="200" :id="'description'" @input="(e)=>{changeEditor(e,'description')}"
:value="form.description"></my-tinymce> -->
</div> </div>
</div> </div>
</template> </template>
@ -124,6 +126,7 @@
uploadOther: { uploadOther: {
token: "" token: ""
}, },
showWang:false,
action: `${process.env.VUE_APP_UPLOAD_API}`, action: `${process.env.VUE_APP_UPLOAD_API}`,
pictureList: [], pictureList: [],
selectList:[], selectList:[],
@ -172,6 +175,9 @@
} }
this.pictureList = fileList this.pictureList = fileList
}, },
// changeEditor(e,type){
// this.form[type] = e
// },
addRow() { addRow() {
this.form.product_category_details.push({ this.form.product_category_details.push({
key: '', key: '',

@ -50,27 +50,72 @@
</div> </div>
</div> </div>
</template> </template>
<template v-slot:picture_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Poster
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' :limit="1" list-type="picture-card"
accept=".PNG,.jpg,.jpeg,.bmp,.svg" :file-list="pictureList" ref="pictureUpload" :auto-upload="true"
:on-success="handlesuccessP" :on-remove="handleRemoveP">
<i class="el-icon-plus"></i>
</el-upload>
</div>
</div>
</template>
<template v-slot:description> <template v-slot:description>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Description <span style="color: red;font-weight: bold;padding-right: 4px;"></span>Description
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input type="textarea" :rows="5" v-model="form.description"></el-input> <!-- <el-input type="textarea" :rows="5" v-model="form.description"></el-input> -->
<my-tinymce v-if="showWang" :id="'description'" @input="(e)=>{changeEditor(e,'description')}"
:value="form.description"></my-tinymce>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:picture_id> <template v-slot:application_note_desc>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Poster <span style="color: red;font-weight: bold;padding-right: 4px;"></span>Application Note Description
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' :limit="1" list-type="picture-card" <!-- <el-input type="textarea" :rows="5" v-model="form.application_note_desc"></el-input> -->
accept=".PNG,.jpg,.jpeg,.bmp,.svg" :file-list="pictureList" ref="pictureUpload" :auto-upload="true" <my-tinymce v-if="showWang" :id="'application_note_desc'"
:on-success="handlesuccessP" :on-remove="handleRemoveP"> @input="(e)=>{changeEditor(e,'application_note_desc')}" :value="form.application_note_desc"></my-tinymce>
<i class="el-icon-plus"></i> </div>
</el-upload> </div>
</template>
<template v-slot:product_category_phase>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Sub Phase
</div>
<div class="xy-table-item-content">
<el-button type="primary" style="margin-bottom:10px" size="small" @click="addSubPhase">Add</el-button>
<xy-table key="1" style="width:850px" :list="form.product_category_phase" :isPage="false" :height="350"
:table-item="sub_detail_item">
<template v-slot:value>
<el-table-column align='left' label="value" width="680">
<template slot-scope="scope">
<el-input placeholder="Please Input" style="width:100%" v-model="scope.row.value"></el-input>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='center' label="operate" width="120" header-align="center">
<template slot-scope="scope">
<el-popconfirm confirm-button-text="confirm" cancel-button-text="cancel" style="margin:0 10px"
@confirm="delSubPhase(scope.row.id,scope.$index)" title="Are you sure to delete it?">
<el-button type="danger" size="small" slot="reference">delete</el-button>
</el-popconfirm>
</template>
</el-table-column>
</template>
</xy-table>
</div> </div>
</div> </div>
</template> </template>
@ -133,8 +178,8 @@
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-button type="primary" style="margin-bottom:10px" size="small" @click="addAppRow('','add')">Add <el-button type="primary" style="margin-bottom:10px" size="small" @click="addAppRow('','add')">Add
Application</el-button> Application</el-button>
<xy-table key="2" style="width:850px" :list="applicationsList" :isPage="false" :height="350" <xy-table ref="applications" row-key="id" key="2" style="width:850px" :list="applicationsList"
:table-item="application_detail_item"> :isPage="false" :height="350" :table-item="application_detail_item">
<template v-slot:btns> <template v-slot:btns>
<el-table-column align='center' label="operate" width="180" header-align="center"> <el-table-column align='center' label="operate" width="180" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -174,7 +219,7 @@
<!-- <wangEditor :isShow="isShow" v-show="showWang" :value="form.character" <!-- <wangEditor :isShow="isShow" v-show="showWang" :value="form.character"
@change="(e)=>{changeEditor(e,'character')}"></wangEditor> --> @change="(e)=>{changeEditor(e,'character')}"></wangEditor> -->
<my-tinymce v-if="showWang" :keyid="'character'" @input="(e)=>{changeEditor(e,'character')}" <my-tinymce v-if="showWang" :id="'character'" @input="(e)=>{changeEditor(e,'character')}"
:value="form.character"></my-tinymce> :value="form.character"></my-tinymce>
</div> </div>
</div> </div>
@ -185,7 +230,7 @@
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Packing <span style="color: red;font-weight: bold;padding-right: 4px;"></span>Packing
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<my-tinymce :keyid="'packing'" v-if="showWang" @input="(e)=>{changeEditor(e,'packing')}" <my-tinymce :id="'packing'" v-if="showPacking" @input="(e)=>{changeEditor(e,'packing')}"
:value="form.packing"></my-tinymce> :value="form.packing"></my-tinymce>
</div> </div>
</div> </div>
@ -203,17 +248,21 @@
import { import {
save, save,
show, show,
index index,
phaseDel
} from "@/api/product/category.js" } from "@/api/product/category.js"
import { import {
getToken getToken
} from '@/utils/auth' } from '@/utils/auth'
import { import {
destroy, destroy,
index as getApp index as getApp,
batchSort
} from "@/api/product/application.js" } from "@/api/product/application.js"
import addApplication from './addApplication.vue'; import addApplication from './addApplication.vue';
import productMixin from "@/mixin/product.js" import productMixin from "@/mixin/product.js"
import Sortable from 'sortablejs';
export default { export default {
mixins: [productMixin], mixins: [productMixin],
components: { components: {
@ -222,6 +271,7 @@
data() { data() {
return { return {
showWang: false, showWang: false,
showPacking: false,
isShow: false, isShow: false,
type: 'add', type: 'add',
id: '', id: '',
@ -244,6 +294,15 @@
align: 'left', align: 'left',
width: 620 width: 620
}], }],
sub_detail_item: [{
type: 'index',
width: 50,
}, {
prop: 'value',
label: 'Name',
align: 'left',
width: 680
}],
detail_item: [{ detail_item: [{
type: 'index', type: 'index',
width: 50, width: 50,
@ -263,13 +322,13 @@
name: '', name: '',
sort: 0, sort: 0,
is_recommend: 0, is_recommend: 0,
description: '',
picture_id: '', picture_id: '',
description: '',
application_note_desc: '',
product_category_phase:[],
product_category_details: [], product_category_details: [],
product_category_applications: [], product_category_applications: [],
download_ids: [], download_ids: [],
character: '', character: '',
packing: '', packing: '',
pid: 0, pid: 0,
@ -284,9 +343,13 @@
}, },
created() { created() {
this.uploadOther.token = getToken(); this.uploadOther.token = getToken();
}, },
mounted() { watch: {
},
mounted() {
this.initSort()
}, },
methods: { methods: {
handleRemoved(file, fileList) { handleRemoved(file, fileList) {
@ -343,14 +406,36 @@
row.list = this.productDetailsKeyList[e].list row.list = this.productDetailsKeyList[e].list
row.value = row.type == 'select' ? [] : '' row.value = row.type == 'select' ? [] : ''
}, },
// sub phase
addSubPhase() {
this.form.product_category_phase.push({
value: '',
sort:0
})
},
delSubPhase(id,index) {
if(id){
phaseDel({
id:id
}).then(res=>{
this.form.product_category_phase.splice(index, 1)
})
}else{
this.form.product_category_phase.splice(index, 1)
}
},
// addApplication // addApplication
addAppRow(id, type) { addAppRow(id, type) {
if (id) { if (id) {
this.$refs.addApplication.id = id this.$refs.addApplication.id = id
} }
// id
if (this.id) {
this.$refs.addApplication.setProductCategoryId(this.id)
}
this.$refs.addApplication.setSort(this.applicationsList.length + 1)
this.$refs.addApplication.type = type this.$refs.addApplication.type = type
this.$refs.addApplication.isShow = true this.$refs.addApplication.isShow = true
}, },
delAppRow(id, index) { delAppRow(id, index) {
destroy({ destroy({
@ -366,8 +451,59 @@
reject(error) reject(error)
}) })
}, },
//
initSort() {
const el = this.$refs['applications'].$el.querySelector('.el-table__body-wrapper > table > tbody')
let _this = this;
const ops = {
animation: 200, //
handle: ".el-table__row", //class
//
onMove: ({
dragged,
related
}) => {
const oldRow = _this.applicationsList[dragged.rowIndex] //
const newRow = _this.applicationsList[related.rowIndex] //
},
//
onEnd: evt => {
const curRow = _this.applicationsList.splice(evt.oldIndex, 1)[0]
_this.applicationsList.splice(evt.newIndex, 0, curRow)
this.updateSort()
}
}
Sortable.create(el, ops)
},
// application sort
async updateSort() {
let sortArr = []
this.applicationsList.map((item, index) => {
sortArr.push({
id: item.id,
sort: index + 1
})
})
await batchSort({
data: sortArr
})
},
//idapplicaitonlist
async getApplicationList(id) {
const res = await getApp({
page: 1,
page_size: 9999,
product_category_id: id,
sort_name: 'sort',
sort_type: 'ASC'
})
this.applicationsList = res.data
},
// application phase
// applicationList id
getApplication(res) { getApplication(res) {
console.log(res) if (this.type === 'add') {
let _arr = this.base.deepCopy(this.applicationsList) let _arr = this.base.deepCopy(this.applicationsList)
if (this.applicationsList.length > 0) { if (this.applicationsList.length > 0) {
let count = -1 let count = -1
@ -376,7 +512,6 @@
count = index count = index
} }
}) })
console.log(count)
if (count > -1) { if (count > -1) {
_arr[count] = this.base.deepCopy(res) _arr[count] = this.base.deepCopy(res)
} else { } else {
@ -387,6 +522,13 @@
this.applicationsList.push(res) this.applicationsList.push(res)
} }
this.$forceUpdate() this.$forceUpdate()
} else {
this.getApplicationList(this.id)
}
},
checkSubmit() {
this.$refs.dialog.submit()
}, },
submit() { submit() {
if (this.id) { if (this.id) {
@ -485,11 +627,16 @@
}).then(res => { }).then(res => {
this.form = this.base.requestToForm(res, this.form) this.form = this.base.requestToForm(res, this.form)
this.form.description = res.description ? res.description : '' this.form.description = res.description ? res.description : ''
this.form.application_note_desc = res.application_note_desc ? res.application_note_desc : ''
this.form.product_category_phase = res.phase?res.phase:[]
this.form.character = res.character ? res.character : '' this.form.character = res.character ? res.character : ''
this.form.packing = res.packing ? res.packing : '' this.form.packing = res.packing ? res.packing : ''
this.applicationsList = res.product_category_applications // this.applicationsList = res.product_category_applications
this.form.is_recommend = res.is_recommend ? res.is_recommend : 0 this.form.is_recommend = res.is_recommend ? res.is_recommend : 0
this.showWang = true this.showWang = true
this.showPacking = true
// applicaitonlist
// category // category
if (res.product_category_links_by_sub.length > 0) { if (res.product_category_links_by_sub.length > 0) {
@ -534,6 +681,7 @@
this.getCategoryList() this.getCategoryList()
if (this.type === 'editor') { if (this.type === 'editor') {
this.getDetail() this.getDetail()
this.getApplicationList(this.id)
} }
for (var k in this.productDetailsKeyList) { for (var k in this.productDetailsKeyList) {
if (this.productDetailsKeyList[k]["type"] === 'select') { if (this.productDetailsKeyList[k]["type"] === 'select') {
@ -549,10 +697,13 @@
} }
} }
this.showWang = true this.showWang = true
this.showPacking = true
} else { } else {
this.id = '' this.id = ''
this.type = "add" this.type = "add"
this.showWang = false this.showWang = false
this.showPacking = false
this.downloadsList = [] this.downloadsList = []
this.pictureList = [] this.pictureList = []
this.applicationsList = [] this.applicationsList = []
@ -564,10 +715,13 @@
sort: 0, sort: 0,
is_recommend: 0, is_recommend: 0,
picture_id: '', picture_id: '',
description: '',
application_note_desc: '',
product_category_phase:[],
product_category_details: [], product_category_details: [],
product_category_applications: [], product_category_applications: [],
download_ids: [], download_ids: [],
description: '',
character: '', character: '',
packing: '', packing: '',
pid: 0, pid: 0,
@ -587,6 +741,7 @@
::v-deep .product_category_applications, ::v-deep .product_category_applications,
::v-deep .download_ids, ::v-deep .download_ids,
::v-deep .description, ::v-deep .description,
::v-deep .application_note_desc,
::v-deep .packing, ::v-deep .packing,
::v-deep .character, ::v-deep .character,
{ {

@ -28,13 +28,26 @@
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Product Phase <span style="color: red;font-weight: bold;padding-right: 4px;">*</span>Product Phase
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select multiple style="width:100%" filterable v-model="form.category_id" placeholder="Please Select"> <el-select multiple style="width:100%" filterable @change="changeSub" v-model="form.category_id" placeholder="Please Select">
<el-option v-for="(item,index) in categoryList" :key="index" :label="item.name" :value="item.id"> <el-option v-for="(item,index) in categoryList" :key="index" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
</template> </template>
<template v-slot:phase>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Sub Phase
</div>
<div class="xy-table-item-content">
<el-select style="width:100%" filterable multiple v-model="form.phase" placeholder="Please Select">
<el-option v-for="(item,index) in subPhaseList" :key="index" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:list_price> <template v-slot:list_price>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
@ -48,7 +61,7 @@
<template v-slot:is_visible> <template v-slot:is_visible>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Visible <span style="color: red;font-weight: bold;padding-right: 4px;"></span>Visible前台是否显示
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-radio-group v-model="form.is_visible"> <el-radio-group v-model="form.is_visible">
@ -61,7 +74,7 @@
<template v-slot:is_sell> <template v-slot:is_sell>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Active <span style="color: red;font-weight: bold;padding-right: 4px;"></span>Active当前是否售卖
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-radio-group v-model="form.is_sell"> <el-radio-group v-model="form.is_sell">
@ -74,12 +87,14 @@
<template v-slot:show_price> <template v-slot:show_price>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Web Visibility <span style="color: red;font-weight: bold;padding-right: 4px;"></span>Web Visibility(是否显示价格)
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-radio-group v-model="form.show_price" @change="changeWeb"> <el-radio-group v-model="form.show_price" @change="changeWeb">
<el-radio :label="1">Yes</el-radio> <!-- <el-radio style="margin-bottom:5px" :label="2">Direct display(直接显示价格)</el-radio> -->
<el-radio :label="0">No</el-radio> <el-radio style="margin-bottom:5px" :label="0">Need to log in(需要登录)</el-radio>
<el-radio style="margin-bottom:5px" :label="1">Need to contact sales(需要联系销售)</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
</div> </div>
@ -195,14 +210,16 @@
prop: 'value', prop: 'value',
label: 'value', label: 'value',
}], }],
subPhaseList:[],
form: { form: {
name: "", name: "",
number: '', number: '',
category_id: [], category_id: [],
phase:[],
list_price: '', list_price: '',
is_visible: 1, is_visible: 1,
is_sell: 1, is_sell: 1,
show_price: 1, show_price: 0,
// file_ids: '', // file_ids: '',
product_details: [], product_details: [],
// content: '', // content: '',
@ -259,11 +276,26 @@
}, },
changeWeb(e){ changeWeb(e){
console.log(e) console.log(e)
if(e===0){ if(e===1){
if(this.base.isNull(this.form.list_price)){ if(this.base.isNull(this.form.list_price)){
this.form.list_price = 99999 this.form.list_price = 99999
} }
} }
},
changeSub(e){
this.subPhaseList = []
if(e.length>0){
let phase = this.categoryList.filter(item=>{return e.includes(item.id)})
console.log(phase)
phase.map(item=>{
this.subPhaseList.push(...item.phase)
})
console.log("this.subPhaseList",this.subPhaseList)
}else{
this.subPhaseList = []
}
}, },
submit() { submit() {
if (this.id) { if (this.id) {
@ -327,7 +359,15 @@
}).then(res => { }).then(res => {
this.form = this.base.requestToForm(res, this.form) this.form = this.base.requestToForm(res, this.form)
// this.form.content = res.content ? res.content : '' // this.form.content = res.content ? res.content : ''
this.form.category_id = res.category_id ? res.category_id : [], this.form.category_id = res.category_id ? res.category_id : []
this.form.phase = res.phase?res.phase:[]
let phase = this.categoryList.filter(item=>{return res.category_id.includes(item.id)})
phase.map(item=>{
this.subPhaseList.push(...item.phase)
})
this.form.is_visible = res.is_visible?res.is_visible:0 this.form.is_visible = res.is_visible?res.is_visible:0
this.form.is_sell = res.is_sell?res.is_sell:0 this.form.is_sell = res.is_sell?res.is_sell:0
this.form.show_price = res.show_price?res.show_price:0 this.form.show_price = res.show_price?res.show_price:0
@ -374,14 +414,16 @@
this.id = '' this.id = ''
// this.filesList = [] // this.filesList = []
this.showWang = false this.showWang = false
this.subPhaseList = []
this.form = { this.form = {
name: "", name: "",
number: '', number: '',
category_id: [], category_id: [],
phase:[],
list_price: '', list_price: '',
is_visible: 1, is_visible: 1,
is_sell: 1, is_sell: 1,
show_price: 1, show_price: 0,
file_ids: '', file_ids: '',
product_details: [], product_details: [],
content: '', content: '',
@ -404,7 +446,7 @@
::v-deep .is_sell, ::v-deep .is_sell,
::v-deep .is_visible, ::v-deep .is_visible,
::v-deep .show_price { ::v-deep .show_price {
flex-basis: 33%; flex-basis: 50%;
} }
::v-deep .el-checkbox__input .el-checkbox__inner { ::v-deep .el-checkbox__input .el-checkbox__inner {

@ -12,6 +12,30 @@
<div> <div>
<el-input v-model="select.number" placeholder="Part Number"></el-input> <el-input v-model="select.number" placeholder="Part Number"></el-input>
</div> </div>
<div>
<el-select multiple collapse-tags clearable style="width:100%" filterable v-model="select.category_id" placeholder="Product Phase">
<el-option v-for="(item,index) in categoryList" :key="index" :label="item.name" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-select style="width:100%" clearable v-model="select.is_visible" placeholder="Visible">
<el-option v-for="(item,index) in valueList" :key="index" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-select style="width:100%" clearable v-model="select.is_sell" placeholder="Active">
<el-option v-for="(item,index) in valueList" :key="index" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
<div>
<el-select style="width:100%" clearable v-model="select.show_price" placeholder="Web Visibility">
<el-option v-for="(item,index) in webList" :key="index" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
<div> <div>
<el-button type="primary" size="small" @click="select.page=1,getList()">search</el-button> <el-button type="primary" size="small" @click="select.page=1,getList()">search</el-button>
</div> </div>
@ -74,12 +98,36 @@
select: { select: {
name: '', name: '',
number:'', number:'',
category_id:[],
is_sell:'',
show_price:'',
is_visible:'',
page: 1, page: 1,
page_size: 10, page_size: 10,
}, },
categoryList: [], categoryList: [],
total: 0, total: 0,
list: [], list: [],
valueList:[{
id:1,
value:'Yes'
},{
id:0,
value:'No'
}],
webList:[
// {
// id:2,
// value:'Direct display()'
// },
{
id:0,
value:'Need to log in(需要登录)'
},
{
id:1,
value:'Need to contact sales(需要联系销售)'
}],
table_item: [{ table_item: [{
type: 'index', type: 'index',
width: 50, width: 50,
@ -127,9 +175,13 @@
prop: 'show_price', prop: 'show_price',
label: 'Web Visibility(是否显示价格)', label: 'Web Visibility(是否显示价格)',
align: 'center', align: 'center',
width: 120, width: 180,
formatter: (cell, data, value) => { formatter: (cell, data, value) => {
return value == 1 ? 'Yes' : 'No' if(value==1){
return 'Need to contact sales(需要联系销售)'
}else{
return 'Need to log in(需要登录)'
}
} }
} }
] ]
@ -162,11 +214,16 @@
this.select.page = 1 this.select.page = 1
this.select.name = '' this.select.name = ''
this.select.number = '' this.select.number = ''
this.select.is_sell = ''
this.select.show_price = ''
this.select.is_visible = ''
this.select.category_id = []
this.getList() this.getList()
}, },
async getList() { async getList() {
const res = await index({ const res = await index({
...this.select, ...this.select,
category_id:this.select.category_id,
filter: [{ filter: [{
key: 'name', key: 'name',
op: 'like', op: 'like',
@ -175,7 +232,19 @@
key: 'number', key: 'number',
op: 'like', op: 'like',
value: this.select.number value: this.select.number
}] },{
key: 'is_sell',
op: 'like',
value: this.select.is_sell
},{
key: 'show_price',
op: 'like',
value: this.select.show_price
},{
key: 'is_visible',
op: 'like',
value: this.select.is_visible
}],
}) })
this.list = res.data this.list = res.data
this.total = res.total this.total = res.total

@ -135,15 +135,9 @@
type:this.select.type, type:this.select.type,
sort_type: 'ASC', sort_type: 'ASC',
sort_name: 'sort', sort_name: 'sort',
filter: [{ name:this.select.name,
key: 'name', is_recommend:this.select.is_recommend
op: 'like',
value: this.select.name
},{
key: 'is_recommend',
op: 'eq',
value: this.select.is_recommend
}]
}) })
this.list = res.data this.list = res.data
this.total = res.total this.total = res.total

@ -135,6 +135,9 @@
} else { } else {
this.form.id = '' this.form.id = ''
} }
if(this.form.type_parameter_details_id_relation){
delete this.form.type_parameter_details_id_relation
}
let _files = [] let _files = []
if (this.filesList.length > 0) { if (this.filesList.length > 0) {
for (var h of this.filesList) { for (var h of this.filesList) {
@ -167,8 +170,7 @@
getDetail() { getDetail() {
show({ show({
table_name: this.table_name, table_name: this.table_name,
id: this.id, id: this.id
json_data_fields: ['files']
}).then(res => { }).then(res => {
this.form = this.base.requestToForm(res, this.form) this.form = this.base.requestToForm(res, this.form)
if (res.files_details && res.files_details.length > 0) { if (res.files_details && res.files_details.length > 0) {

@ -59,6 +59,7 @@
showWang: false, showWang: false,
id: '', id: '',
type: 'add', type: 'add',
filesList:[],
uploadOther: { uploadOther: {
token: "" token: ""
}, },

@ -25,6 +25,28 @@
</div> </div>
</div> </div>
</template> </template>
<template v-slot:date v-if="table_name==='technical_newsletters'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Release Time
</div>
<div class="xy-table-item-content">
<el-date-picker v-model="form.date" style="width:100%" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
type="datetime" placeholder="Please Select">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:link v-if="table_name==='technical_newsletters'">
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>Link
</div>
<div class="xy-table-item-content">
<el-input placeholder="Please Input" style="width:100%" v-model="form.link"></el-input>
</div>
</div>
</template>
<template v-slot:files> <template v-slot:files>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
@ -80,12 +102,14 @@
action: `${process.env.VUE_APP_UPLOAD_API}`, action: `${process.env.VUE_APP_UPLOAD_API}`,
filesList: [], filesList: [],
categoryList: [], categoryList: [],
showWang:false, showWang: false,
form: { form: {
category_ids: '', category_ids: '',
title: "", title: "",
date: '',
link:'',
files: [], files: [],
content:'' content: ''
}, },
rules: { rules: {
title: [{ title: [{
@ -120,7 +144,7 @@
page: 1, page: 1,
sort_type: 'ASC', sort_type: 'ASC',
sort_name: 'sort', sort_name: 'sort',
type:2 type: 2
}) })
this.categoryList = res.data this.categoryList = res.data
@ -168,8 +192,9 @@
json_data_fields: ['files'] json_data_fields: ['files']
}).then(res => { }).then(res => {
this.form = this.base.requestToForm(res, this.form) this.form = this.base.requestToForm(res, this.form)
if(table_name==='technical_newsletters'){ if (this.table_name === 'technical_newsletters') {
this.form.content = res.content ? res.content : '' this.form.content = res.content ? res.content : ''
this.form.date = res.date?res.date:this.$moment().format('YYYY-MM-DD HH:mm:ss')
this.showWang = true this.showWang = true
} }
@ -189,11 +214,15 @@
watch: { watch: {
isShow(newVal) { isShow(newVal) {
if (newVal) { if (newVal) {
if(this.table_name==='technical_newsletters'){
this.showWang = true
}
if (this.type === 'editor') { if (this.type === 'editor') {
this.getDetail() this.getDetail()
}else{
if (this.table_name === 'technical_newsletters') {
this.form.date = this.$moment().format('YYYY-MM-DD HH:mm:ss')
this.showWang = true
}
} }
} else { } else {
@ -202,8 +231,9 @@
this.form = { this.form = {
category_ids: '', category_ids: '',
title: "", title: "",
date: '',
files: [], files: [],
content:'' content: ''
} }
this.$refs['dialog'].reset() this.$refs['dialog'].reset()
} }
@ -215,9 +245,11 @@
<style scoped lang="scss"> <style scoped lang="scss">
::v-deep .category_ids, ::v-deep .category_ids,
::v-deep .date,
::v-deep .link,
::v-deep .title, ::v-deep .title,
::v-deep .files, ::v-deep .files,
::v-deep .content{ ::v-deep .content {
flex-basis: 100%; flex-basis: 100%;
} }
</style> </style>

@ -97,7 +97,7 @@
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-select style="width:100%" multiple filterable collapse-tags v-model="form.specific_sample" placeholder="Please Select"> <el-select style="width:100%" multiple filterable collapse-tags v-model="form.specific_sample" placeholder="Please Select">
<el-option v-for="item in resourceList.specificSampleList" :key="item.id" :label="item.value" <el-option v-for="item in appSpecialList" :key="item.id" :label="item.value"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@ -136,6 +136,7 @@
productList: [], productList: [],
categoryList: [], categoryList: [],
applicationList: [], applicationList: [],
appSpecialList:[],
form: { form: {
category_ids: [], category_ids: [],
application_ids:[], application_ids:[],
@ -167,6 +168,7 @@
this.getCategoryList() this.getCategoryList()
this.getProductList() this.getProductList()
this.getApplicationList() this.getApplicationList()
this.getAppSpecial()
}, },
methods: { methods: {
async getCategoryList() { async getCategoryList() {
@ -181,13 +183,32 @@
}, },
async getApplicationList() { async getApplicationList() {
const res = await getApplication({ const res = await getApplication({
page_size: 999, page_size: 9999,
page: 1, page: 1,
sort_type: 'ASC', sort_type: 'ASC',
sort_name: 'sort' sort_name: 'sort',
filter:[{
key:'type',
op:'eq',
value:0
}]
}) })
this.applicationList = res.data this.applicationList = res.data
}, },
async getAppSpecial() {
const res = await getApplication({
page_size: 9999,
page: 1,
sort_type: 'ASC',
sort_name: 'sort',
filter:[{
key:'type',
op:'eq',
value:1
}]
})
this.appSpecialList = res.data
},
async getProductList() { async getProductList() {
const res = await getProduct({ const res = await getProduct({

@ -26,6 +26,18 @@
</div> </div>
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" <xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange"
@pageSizeChange="pageSizeChange" :table-item="table_item"> @pageSizeChange="pageSizeChange" :table-item="table_item">
<template v-slot:created_at>
<el-table-column align='left' label="Relase Time" width="180" header-align="center">
<template slot-scope="scope">
<div v-if="select.table_name==='technical_newsletters'">
{{scope.row.date?scope.row.date:''}}
</div>
<div v-else>
{{scope.row.created_at}}
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns> <template v-slot:btns>
<el-table-column align='left' fixed="right" label="Operate" width="180" header-align="center"> <el-table-column align='left' fixed="right" label="Operate" width="180" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -71,11 +83,16 @@
table_item: [{ table_item: [{
type: 'index', type: 'index',
width: 50, width: 50,
fixed: 'left' fixed:'left'
}, { }, {
prop: 'title', prop: 'title',
label: 'Title', label: 'Title',
align: 'left', align: 'left',
},{
prop: 'created_at',
label: 'Relase Time',
align: 'left',
width:180
} }
] ]
@ -114,6 +131,8 @@
async getList() { async getList() {
const res = await index({ const res = await index({
...this.select, ...this.select,
sort_name:this.select.table_name==='technical_newsletters'?"date":'',
sort_type:this.select.table_name==='technical_newsletters'?"DESC":'',
filter:[{ filter:[{
key:'title', key:'title',
op:'like', op:'like',

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath * Detail: https://cli.vuejs.org/config/#publicpath
*/ */
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin', publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
outputDir: '/Users/mac/Documents/朗业/2024/s-美国赛分/saifen/public/admin', outputDir: '/Users/mac/Documents/朗业/2024/s-美国赛分/saifen/public/admin_test',
assetsDir: 'static', assetsDir: 'static',
css: { css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项 loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save