fixLog V2.4.7
yujialong 2 years ago
parent a8e2b253c6
commit 3c362751b8
  1. 484
      src/views/course/AddCurriculum.vue
  2. 1420
      src/views/order/AddOrder.vue
  3. 829
      src/views/shop/addProduct/index.vue
  4. 134
      src/views/shop/list/market/index.vue
  5. 202
      src/views/shop/list/product/index.vue

@ -2,20 +2,28 @@
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<el-card shadow="hover"
class="mgb20">
<div class="flex-between">
<div class="per_title" v-preventReClick @click="goback()">
<div class="per_title"
v-preventReClick
@click="goback()">
<i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span>
<span class="per_school" v-text="form.cid ? '编辑课程' : '新建课程'"></span>
<span class="per_school"
v-text="form.cid ? '编辑课程' : '新建课程'"></span>
</div>
<el-button type="primary" round class="mag" v-preventReClick
<el-button type="primary"
round
class="mag"
v-preventReClick
@click="saveAdd">确定
</el-button>
</div>
</el-card>
<el-card shadow="hover" class="mgb20 ">
<el-card shadow="hover"
class="mgb20 ">
<div class="flex-center mgb20">
<p class="addhr_tag"></p>
<span>课程信息</span>
@ -23,66 +31,111 @@
<div class="border-b-dashed"></div>
<div>
<el-form :model="form" :rules="rules" ref="form" label-width="100px">
<el-col :span="6" :offset="5">
<el-form-item label="课程名称" prop="curriculumName">
<el-input placeholder="请输入课程名称" v-model.trim="form.curriculumName"></el-input>
<el-form :model="form"
:rules="rules"
ref="form"
label-width="100px">
<el-col :span="6"
:offset="5">
<el-form-item label="课程名称"
prop="curriculumName">
<el-input placeholder="请输入课程名称"
v-model.trim="form.curriculumName"></el-input>
</el-form-item>
<el-form-item label="学科类别" prop="categoryId">
<el-select v-model="form.categoryId" clearable placeholder="请选择学科类别"
@change="getProfessionalClass()" @clear="clearsubjectType()">
<el-option v-for="(item,index) in subjectList" :key="index"
:label="item.disciplineName" :value="item.disciplineId"></el-option>
<el-form-item label="学科类别"
prop="categoryId">
<el-select v-model="form.categoryId"
clearable
placeholder="请选择学科类别"
@change="getProfessionalClass()"
@clear="clearsubjectType()">
<el-option v-for="(item,index) in subjectList"
:key="index"
:label="item.disciplineName"
:value="item.disciplineId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="专业" prop="professionalId">
<el-select v-model="form.professionalId" clearable placeholder="请选择专业"
<el-form-item label="专业"
prop="professionalId">
<el-select v-model="form.professionalId"
clearable
placeholder="请选择专业"
:disabled="form.professionalCategoryId ? false : true">
<el-option v-for="(item,index) in ProfessionalList" :key="index"
<el-option v-for="(item,index) in ProfessionalList"
:key="index"
:label="item.professionalName"
:value="item.professionalId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="供应厂商" prop="supplier">
<el-select v-model="form.supplier" clearable placeholder="请选择供应厂商" multiple>
<el-option v-for="(item, i) in suppliers" :key="i" :label="item.supplierName" :value="item.supplierId"></el-option>
<el-form-item label="供应厂商"
prop="supplier">
<el-select v-model="form.supplier"
clearable
placeholder="请选择供应厂商"
multiple>
<el-option v-for="(item, i) in suppliers"
:key="i"
:label="item.supplierName"
:value="item.supplierId"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" :offset="2">
<el-col :span="6"
:offset="2">
<el-form-item label="课程类别">
<el-select v-model="form.curriculumType" clearable placeholder="请选择课程类型">
<el-option label="理论课程" :value="0"></el-option>
<el-option label="实训课程" :value="1"></el-option>
<el-select v-model="form.curriculumType"
clearable
placeholder="请选择课程类型">
<el-option label="理论课程"
:value="0"></el-option>
<el-option label="实训课程"
:value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="专业类" prop="professionalCategoryId">
<el-select v-model="form.professionalCategoryId" clearable placeholder="请选择专业类"
:disabled="form.categoryId ? false : true" @change="getProfessional()"
<el-form-item label="专业类"
prop="professionalCategoryId">
<el-select v-model="form.professionalCategoryId"
clearable
placeholder="请选择专业类"
:disabled="form.categoryId ? false : true"
@change="getProfessional()"
@clear="clearProfessionalClass()">
<el-option v-for="(item,index) in ProfessionalClassList" :key="index"
<el-option v-for="(item,index) in ProfessionalClassList"
:key="index"
:label="item.professionalClassName"
:value="item.professionalClassId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="预计课时" prop="expectedCourse">
<el-select v-model="form.expectedCourse" clearable placeholder="请选择预计课时">
<el-option label="32课时" value="32课时"></el-option>
<el-option label="64课时" value="64课时"></el-option>
<el-form-item label="预计课时"
prop="expectedCourse">
<el-select v-model="form.expectedCourse"
clearable
placeholder="请选择预计课时">
<el-option label="32课时"
value="32课时"></el-option>
<el-option label="64课时"
value="64课时"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="14" :offset="5">
<el-form-item label="课程简介" prop="briefIntroduction">
<el-input type="textarea" :autosize="{ minRows: 4 }" placeholder="请输入课程简介"
<el-col :span="14"
:offset="5">
<el-form-item label="课程简介"
prop="briefIntroduction">
<el-input type="textarea"
:autosize="{ minRows: 4 }"
placeholder="请输入课程简介"
v-model.trim="form.briefIntroduction"></el-input>
</el-form-item>
<el-form-item label="教学目标" prop="teachingObjectives">
<el-input type="textarea" :autosize="{ minRows: 4 }" placeholder="请输入教学目标"
<el-form-item label="教学目标"
prop="teachingObjectives">
<el-input type="textarea"
:autosize="{ minRows: 4 }"
placeholder="请输入教学目标"
v-model.trim="form.teachingObjectives"></el-input>
</el-form-item>
</el-col>
@ -91,7 +144,8 @@
</el-card>
<!-- 练习配置 -->
<el-card shadow="hover" class="mgb20">
<el-card shadow="hover"
class="mgb20">
<div class="mgb20 flex-between">
<div class="flex-center ">
<p class="addhr_tag"></p>
@ -99,41 +153,64 @@
</div>
<div>
<el-button @click="handleBatchDelete(0)">批量移除</el-button>
<el-button @click="handleConfig(0)" icon="el-icon-plus" circle></el-button>
<el-button @click="handleConfig(0)"
icon="el-icon-plus"
circle></el-button>
</div>
</div>
<div class="border-b-dashed"></div>
<div>
<el-table :data="practiceData" class="table" stripe header-align="center" max-height="400"
<el-table :data="practiceData"
class="table"
stripe
header-align="center"
max-height="400"
@selection-change="handleSelectionPractice">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column>
<el-table-column prop="applicationName" label="系统名称" align="center">
<el-table-column type="selection"
width="55"
align="center"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center"></el-table-column>
<el-table-column prop="projectName"
label="项目名称"
align="center"></el-table-column>
<el-table-column prop="remark"
label="备注名称"
align="center"></el-table-column>
<el-table-column prop="applicationName"
label="系统名称"
align="center">
<template slot-scope="scope">
{{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template>
</el-table-column>
<el-table-column label="排序" align="center" width="100">
<el-table-column label="排序"
align="center"
width="100">
<template slot-scope="scope">
<el-input v-model.trim="scope.row.sort"
@input="practiceSortChange(scope.row, scope.$index)"></el-input>
</template>
</el-table-column>
<el-table-column label="展示控制" align="center" width="100">
<el-table-column label="展示控制"
align="center"
width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShow"
<el-switch v-model="scope.row.isShow"
:active-value="0"
:inactive-value="1"
:disabled="scope.row.disabled">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<el-table-column label="操作"
align="center"
width="100">
<template slot-scope="scope">
<el-button :disabled="scope.row.disabled" @click.native.prevent="handleDelete(scope.$index, practiceData)">移除
<el-button :disabled="scope.row.disabled"
@click.native.prevent="handleDelete(scope.$index, practiceData)">移除
</el-button>
</template>
</el-table-column>
@ -142,7 +219,8 @@
</el-card>
<!-- 考核配置 -->
<el-card shadow="hover" class="mgb20">
<el-card shadow="hover"
class="mgb20">
<div class="mgb20 flex-between">
<div class="flex-center ">
<p class="addhr_tag"></p>
@ -150,42 +228,65 @@
</div>
<div>
<el-button @click="handleBatchDelete(1)">批量移除</el-button>
<el-button @click="handleConfig(1)" icon="el-icon-plus" circle></el-button>
<el-button @click="handleConfig(1)"
icon="el-icon-plus"
circle></el-button>
</div>
</div>
<div class="border-b-dashed"></div>
<!-- 实训配置 -->
<div>
<el-table :data="assessmentData" class="table" stripe header-align="center" max-height="400"
<el-table :data="assessmentData"
class="table"
stripe
header-align="center"
max-height="400"
@selection-change="handleSelectionAssessment">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column>
<el-table-column prop="applicationName" label="系统名称" align="center">
<el-table-column type="selection"
width="55"
align="center"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center"></el-table-column>
<el-table-column prop="projectName"
label="项目名称"
align="center"></el-table-column>
<el-table-column prop="remark"
label="备注名称"
align="center"></el-table-column>
<el-table-column prop="applicationName"
label="系统名称"
align="center">
<template slot-scope="scope">
{{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template>
</el-table-column>
<el-table-column label="排序" align="center" width="100">
<el-table-column label="排序"
align="center"
width="100">
<template slot-scope="scope">
<el-input v-model.trim="scope.row.sort"
@input="assessmentSortChange(scope.row, scope.$index)"></el-input>
</template>
</el-table-column>
<el-table-column label="展示控制" align="center" width="100">
<el-table-column label="展示控制"
align="center"
width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShow"
<el-switch v-model="scope.row.isShow"
:active-value="0"
:inactive-value="1"
:disabled="scope.row.disabled">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<el-table-column label="操作"
align="center"
width="100">
<template slot-scope="scope">
<el-button :disabled="scope.row.disabled" @click.native.prevent="handleDelete(scope.$index, assessmentData)">移除</el-button>
<el-button :disabled="scope.row.disabled"
@click.native.prevent="handleDelete(scope.$index, assessmentData)">移除</el-button>
</template>
</el-table-column>
</el-table>
@ -193,7 +294,8 @@
</el-card>
<!-- 竞赛配置 -->
<el-card shadow="hover" class="mgb20">
<el-card shadow="hover"
class="mgb20">
<div class="mgb20 flex-between">
<div class="flex-center ">
<p class="addhr_tag"></p>
@ -201,41 +303,62 @@
</div>
<div>
<el-button @click="handleBatchDelete(2)">批量移除</el-button>
<el-button @click="handleConfig(2)" icon="el-icon-plus" circle></el-button>
<el-button @click="handleConfig(2)"
icon="el-icon-plus"
circle></el-button>
</div>
</div>
<div class="border-b-dashed"></div>
<!-- 实训配置 -->
<div>
<el-table :data="matches" class="table" stripe header-align="center" max-height="400"
<el-table :data="matches"
class="table"
stripe
header-align="center"
max-height="400"
@selection-change="handleSelectionMatch">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column prop="applicationName" label="系统名称" align="center">
<el-table-column type="selection"
width="55"
align="center"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center"></el-table-column>
<el-table-column prop="projectName"
label="项目名称"
align="center"></el-table-column>
<el-table-column prop="applicationName"
label="系统名称"
align="center">
<template slot-scope="scope">
{{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template>
</el-table-column>
<el-table-column label="排序" align="center" width="100">
<el-table-column label="排序"
align="center"
width="100">
<template slot-scope="scope">
<el-input v-model.trim="scope.row.sort"
@input="assessmentSortChange(scope.row, scope.$index)"></el-input>
</template>
</el-table-column>
<el-table-column label="展示控制" align="center" width="100">
<el-table-column label="展示控制"
align="center"
width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShow"
<el-switch v-model="scope.row.isShow"
:active-value="0"
:inactive-value="1"
:disabled="scope.row.disabled">
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<el-table-column label="操作"
align="center"
width="100">
<template slot-scope="scope">
<el-button :disabled="scope.row.disabled" @click.native.prevent="handleDelete(scope.$index, matches)">移除</el-button>
<el-button :disabled="scope.row.disabled"
@click.native.prevent="handleDelete(scope.$index, matches)">移除</el-button>
</template>
</el-table-column>
</el-table>
@ -246,19 +369,29 @@
</el-row>
<!-- 配置弹窗 -->
<el-dialog :visible.sync="configVisible" width="1200px" center custom-class="config-dia">
<el-dialog :visible.sync="configVisible"
width="1200px"
center
custom-class="config-dia">
<div class="config-wrap">
<div class="item system">
<div class="title-wrap flex-center">
<p class="addhr_tag"></p>
<span>系统列表</span>
</div>
<el-input placeholder="请输入系统名称" prefix-icon="el-icon-search" v-model.trim="systemKeyword" clearable></el-input>
<el-input placeholder="请输入系统名称"
prefix-icon="el-icon-search"
v-model.trim="systemKeyword"
clearable></el-input>
<ul class="systems">
<li v-for="(item, i) in systems" :key="i" :title="item.systemName">
<el-checkbox v-model="item.check" @change="val => systemChange(val, item)"></el-checkbox>
<div :class="['name', {active: curSystem == item.systemId}]" @click="getProject(item)">
<li v-for="(item, i) in systems"
:key="i"
:title="item.systemName">
<el-checkbox v-model="item.check"
@change="val => systemChange(val, item)"></el-checkbox>
<div :class="['name', {active: curSystem == item.systemId}]"
@click="getProject(item)">
<span>{{ item.systemName }}</span>
<i class="el-icon-arrow-right"></i>
</div>
@ -271,12 +404,22 @@
<p class="addhr_tag"></p>
<span>项目列表</span>
</div>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="projectKeyword" clearable></el-input>
<el-input placeholder="请输入项目名称"
prefix-icon="el-icon-search"
v-model.trim="projectKeyword"
clearable></el-input>
<ul class="systems">
<el-checkbox v-if="projects.length" v-model="checkAll" label="全选" @change="val => checkAllChange(val, projects[0].systemId)"></el-checkbox>
<li v-for="(item, i) in projects" :key="i" :title="item.projectName">
<el-checkbox v-model="item.check" :label="item.remark ? item.remark + '(' + item.projectName + ')' : item.projectName" @change="val => projectChange(val, item)"></el-checkbox>
<el-checkbox v-if="projects.length"
v-model="checkAll"
label="全选"
@change="val => checkAllChange(val, projects[0].systemId)"></el-checkbox>
<li v-for="(item, i) in projects"
:key="i"
:title="item.projectName">
<el-checkbox v-model="item.check"
:label="item.remark ? item.remark + '(' + item.projectName + ')' : item.projectName"
@change="val => projectChange(val, item)"></el-checkbox>
</li>
</ul>
</div>
@ -286,33 +429,58 @@
<p class="addhr_tag"></p>
<span>已选择项目{{ checkeds.length }}</span>
</div>
<el-input style="width: 200px;margin-bottom: 20px;" placeholder="请输入项目名称" prefix-icon="el-icon-search" v-model.trim="checkedKeyword" clearable></el-input>
<el-table :data="checkeds" class="table" stripe header-align="center" max-height="470">
<el-table-column type="index" width="55" label="序号" align="center"></el-table-column>
<el-table-column prop="applicationName" label="系统名称" align="center">
<el-input style="width: 200px;margin-bottom: 20px;"
placeholder="请输入项目名称"
prefix-icon="el-icon-search"
v-model.trim="checkedKeyword"
clearable></el-input>
<el-table :data="checkeds"
class="table"
stripe
header-align="center"
max-height="470">
<el-table-column type="index"
width="55"
label="序号"
align="center"></el-table-column>
<el-table-column prop="applicationName"
label="系统名称"
align="center">
<template slot-scope="scope">
{{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template>
</el-table-column>
<el-table-column prop="projectName" width="80" label="系统类型" align="center">
<el-table-column prop="projectName"
width="80"
label="系统类型"
align="center">
<template slot-scope="scope">
{{ scope.row.type ? '流程类' : '编程类' }}
</template>
</el-table-column>
<el-table-column prop="remark" label="备注名称" align="center"></el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="55">
<el-table-column prop="remark"
label="备注名称"
align="center"></el-table-column>
<el-table-column prop="projectName"
label="项目名称"
align="center"></el-table-column>
<el-table-column label="操作"
align="center"
width="55">
<template slot-scope="scope">
<i :class="['el-icon-delete rm', {disabled: scope.row.disabled}]" @click="delProject(scope.$index, scope.row)"></i>
<i :class="['el-icon-delete rm', {disabled: scope.row.disabled}]"
@click="delProject(scope.$index, scope.row)"></i>
</template>
</el-table-column>
</el-table>
</div>
</div>
<span slot="footer" class="dialog-footer">
<span slot="footer"
class="dialog-footer">
<el-button @click="configVisible = false"> </el-button>
<el-button type="primary" @click="handleConfirm"> </el-button>
<el-button type="primary"
@click="handleConfirm"> </el-button>
</span>
</el-dialog>
</div>
@ -320,7 +488,7 @@
<script>
export default {
data() {
data () {
return {
headers: {
token: sessionStorage.getItem("token")
@ -330,15 +498,15 @@ export default {
cid: this.$route.query.cid,
curriculumName: "",
courseType: "",
categoryId: "",
professionalCategoryId: "",
professionalId: "",
categoryId: 1,
professionalCategoryId: 1,
professionalId: 1,
expectedCourse: "",
briefIntroduction: "",
teachingObjectives: "",
systemIdByAssessment: [],
systemIdByPractice: [],
supplier: '',
supplier: []
},
rules: {
curriculumName: [
@ -350,6 +518,9 @@ export default {
professionalId: [
{ required: true, message: "请选择专业", trigger: "change" }
],
supplier: [
{ required: true, message: "请选择供应厂商", trigger: "change" }
],
expectedCourse: [
{ required: true, message: "请选择预计课时", trigger: "change" }
],
@ -422,34 +593,34 @@ export default {
watch: {
// ,
form: {
handler(){
handler () {
this.updateTime++
},
deep:true
deep: true
},
systemKeyword: function(val) {
systemKeyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.getConfig();
}, 500);
},
projectKeyword: function(val) {
projectKeyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.filterProject();
}, 500);
},
checkedKeyword: function(val) {
checkedKeyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.filterChecked();
}, 500);
}
},
created() {
created () {
},
mounted() {
mounted () {
this.getSubject()
this.getConfig()
this.getSystem()
@ -457,18 +628,18 @@ export default {
this.form.cid && this.getInfoData()
},
methods: {
getInfoData() {
getInfoData () {
this.$post(`${this.api.curriculumDetail}?cid=${this.form.cid}`).then(({ data }) => {
if (data.supplier) data.supplier = data.supplier.split(',').map(e => +e)
if (data.categoryId) {
this.$get(this.api.courseProfessionalClass, { disciplineId: data.categoryId }).then(res => {
this.ProfessionalClassList = res.list;
}).catch(res => {});
}).catch(res => { });
}
if (data.professionalCategoryId) {
this.$get(this.api.courseProfessional, { professionalClassId: data.professionalCategoryId }).then(res => {
this.ProfessionalList = res.list;
}).catch(res => {});
}).catch(res => { });
}
this.$nextTick(() => {
this.form = data;
@ -495,16 +666,16 @@ export default {
});
},
//
getSupplier() {
getSupplier () {
const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
this.$get(this.api.getSupplierListByRole, {
permissionId: sid.permissionId
}).then(res => {
this.suppliers = res.supplierList
}).catch(res => {})
}).catch(res => { })
},
//
getSystem() {
getSystem () {
const checked = this[!this.permissions ?
'practiceData' :
this.permissions == 1 ?
@ -518,39 +689,41 @@ export default {
supplierId: sid ? sid.supplierId : ''
}).then(({ serviceList }) => {
this.systemsAll = serviceList.records
}).catch(err => {})
}).catch(err => { })
},
getSubject() { //
getSubject () { //
this.$get(this.api.courseDiscipline).then(res => {
this.subjectList = res.list;
this.subjectList = res.list
this.form.categoryId === 1 && this.getProfessionalClass()
}).catch(err => {
});
},
clearsubjectType() { //
this.form.professionalCategoryId = "",
this.form.professionalId = "";
clearsubjectType () { //
this.form.professionalCategoryId = this.form.categoryId === 1 ? 1 : ''
this.form.professionalId = this.form.categoryId === 1 ? 1 : ''
},
getProfessionalClass() { //
getProfessionalClass () { //
this.clearsubjectType();
this.getProfessionalClassData();
},
getProfessionalClassData() {
getProfessionalClassData () {
let data = {
disciplineId: this.form.categoryId
};
this.$get(this.api.courseProfessionalClass, data).then(res => {
this.ProfessionalClassList = res.list;
this.form.professionalCategoryId === 1 && this.getProfessional()
}).catch(err => {
});
},
clearProfessionalClass() { //
this.form.professionalId = "";
clearProfessionalClass () { //
this.form.professionalId = this.form.professionalCategoryId === 1 ? 1 : ''
},
getProfessional() { //
getProfessional () { //
this.clearProfessionalClass();
this.getProfessionalData();
},
getProfessionalData() {
getProfessionalData () {
let data = {
professionalClassId: this.form.professionalCategoryId
};
@ -560,7 +733,7 @@ export default {
});
},
//
handleConfig(type) {
handleConfig (type) {
this.systemKeyword = ''
this.projectKeyword = ''
this.checkedKeyword = ''
@ -571,7 +744,7 @@ export default {
this.checkeds = JSON.parse(JSON.stringify(type == 1 ? this.assessmentData : type == 2 ? this.matches : this.practiceData))
},
//
getConfig() {
getConfig () {
const checked = this[!this.permissions ?
'practiceData' :
this.permissions == 1 ?
@ -598,10 +771,10 @@ export default {
this.systems = result
this.checkAll = !!checked.find(n => n.systemId == result[0].systemId) //
result.length && this.getProject(result[0])
}).catch(err => {})
}).catch(err => { })
},
//
getProject(item) {
getProject (item) {
const checked = this.checkeds
this.curSystem = item.systemId
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => {
@ -615,15 +788,15 @@ export default {
})
this.checkAll = !result.filter(e => !e.check).length
this.projects = result
}).catch(err => {})
}).catch(err => { })
},
//
filterProject() {
filterProject () {
const val = this.projectKeyword
this.projects = this.projectAll.filter(e => e.projectName.includes(val))
},
//
systemChange(val, item) {
systemChange (val, item) {
//
const { projects, checkeds } = this
if (projects.length && projects[0].systemId == item.systemId) {
@ -652,17 +825,17 @@ export default {
}
this.checkedAll = JSON.parse(JSON.stringify(checkeds)) //
this.getProject(item)
}).catch(err => {})
}).catch(err => { })
},
//
checkAllChange(val, systemId) {
checkAllChange (val, systemId) {
this.systemChange(val, { systemId })
this.systems.map(e => {
if (e.systemId == systemId) e.check = val
})
},
//
projectChange(val, item) {
projectChange (val, item) {
const { systemId } = item
const i = this.checkeds.findIndex(e => e.projectId == item.projectId && e.systemId == systemId)
// push
@ -680,12 +853,12 @@ export default {
console.log("🚀 ~ file: AddCurriculum.vue ~ line 728 ~ projectChange ~ checkedAll", this.checkeds, item)
},
//
filterChecked() {
filterChecked () {
const val = this.checkedKeyword
this.checkeds = this.checkedAll.filter(e => e.projectName.includes(val))
},
//
delProject(i, e) {
delProject (i, e) {
if (e.disabled) return
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
@ -704,10 +877,10 @@ export default {
this.systems.map(n => {
if (n.systemId == e.systemId) n.check = false
})
}).catch(() => {})
}).catch(() => { })
},
//
handleConfirm() {
handleConfirm () {
const list = this.checkeds
if (!list.length) {
this.$message.warning("请选择系统!");
@ -729,22 +902,22 @@ export default {
}
}
},
practiceSortChange(row, index) { //
practiceSortChange (row, index) { //
this.practiceData.splice(index, 1, row);
},
assessmentSortChange(row, index) { //
assessmentSortChange (row, index) { //
this.assessmentData.splice(index, 1, row);
},
handleSelectionPractice(val) { //
handleSelectionPractice (val) { //
this.multiplePractice = val;
},
handleSelectionAssessment(val) { //
handleSelectionAssessment (val) { //
this.multipleAssessment = val;
},
handleSelectionMatch(val) { //
handleSelectionMatch (val) { //
this.multipleMatch = val;
},
handleBatchDelete(type) { //
handleBatchDelete (type) { //
if (type == 1 && !this.multipleAssessment.length) {
this.$message.warning("请勾选考核项目!");
return;
@ -791,7 +964,7 @@ export default {
this.$message.info("已取消批量移除");
});
},
handleDelete(index, data) { //
handleDelete (index, data) { //
this.$confirm("此操作将移除该项目, 是否继续?", "提示", {
type: "warning"
}).then(() => {
@ -801,7 +974,7 @@ export default {
this.$message.info("已取消移除");
});
},
saveAdd(fromBack) {
saveAdd (fromBack) {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.submiting) return false
@ -885,7 +1058,7 @@ export default {
}
});
},
goback() {
goback () {
const id = this.form.cid
const updateTime = this.updateTime
//
@ -902,7 +1075,7 @@ export default {
}
},
//
backPage() {
backPage () {
this.$router.back()
this.loadIns.close()
}
@ -923,7 +1096,7 @@ $avatar-width: 104px;
overflow: hidden;
&:hover {
border-color: #409EFF;
border-color: #409eff;
}
.uploader-default {
@ -1018,8 +1191,9 @@ $avatar-width: 104px;
align-items: center;
margin-left: 5px;
cursor: pointer;
&.active, &:hover {
color: #9076FF;
&.active,
&:hover {
color: #9076ff;
}
span {
max-width: 200px;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -2,68 +2,110 @@
<!-- 营销推广管理 -->
<div style="padding-top: 24px">
<div style="margin-bottom: 10px;text-align: right;">
<el-button v-auth="'/shop:营销推广管理:新增'" type="primary" round @click="add">新增</el-button>
<el-button v-auth="'/shop:营销推广管理:新增'"
type="primary"
round
@click="add">新增</el-button>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="courseName" label="图片" min-width="150" align="center">
<el-table :data="list"
class="table"
ref="table"
stripe
header-align="center"
row-key="id">
<el-table-column type="index"
width="100"
label="序号"
align="center"></el-table-column>
<el-table-column prop="courseName"
label="图片"
min-width="150"
align="center">
<template slot-scope="scope">
<img width="100" :src="scope.row.banner" alt="">
<img width="100"
:src="scope.row.banner"
alt="">
</template>
</el-table-column>
<el-table-column prop="title" label="标题" min-width="150" align="center"></el-table-column>
<el-table-column prop="url" label="链接" min-width="150" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="250">
<el-table-column prop="title"
label="标题"
min-width="150"
align="center"></el-table-column>
<el-table-column prop="url"
label="链接"
min-width="150"
align="center"></el-table-column>
<el-table-column label="操作"
align="center"
width="250">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isOpen"
<el-switch v-model="scope.row.isOpen"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row)"
v-auth="'/shop:营销推广管理:禁用'">
</el-switch>
<el-button style="margin-left: 10px;" v-auth="'/shop:营销推广管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/shop:营销推广管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-button style="margin-left: 10px;"
v-auth="'/shop:营销推广管理:编辑'"
type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/shop:营销推广管理:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :title="(form.id ? '编辑' : '新增') + 'banner'" :visible.sync="bannerVisible" width="500px" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="60px">
<el-dialog :title="(form.id ? '编辑' : '新增') + 'banner'"
:visible.sync="bannerVisible"
width="500px"
class="dialog"
:close-on-click-modal="false">
<el-form ref="form"
label-width="60px">
<el-form-item label="图片">
<el-upload
class="avatar-uploader"
<el-upload class="avatar-uploader"
accept=".jpg,.png,.jpeg,.gif"
:on-change="changeFile"
:show-file-list="false"
:action="this.api.fileupload"
:auto-upload="false"
>
<img v-if="form.banner" :src="form.banner" class="avatar">
<div class="uploader-default" v-else>
:auto-upload="false">
<img v-if="form.banner"
:src="form.banner"
class="avatar">
<div class="uploader-default"
v-else>
<i class="el-icon-plus"></i>
<p>上传图片</p>
</div>
</el-upload>
</el-form-item>
<el-form-item label="标题">
<el-input v-model="form.title" placeholder="请输入标题" maxlength="100"></el-input>
<el-input v-model="form.title"
placeholder="请输入标题"
maxlength="100"></el-input>
</el-form-item>
<el-form-item label="链接">
<el-input v-model="form.url" placeholder="请输入链接" maxlength="100"></el-input>
<el-input v-model="form.url"
placeholder="请输入链接"
maxlength="100"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<span slot="footer"
class="dialog-footer">
<el-button @click="bannerVisible = false">取消</el-button>
<el-button type="primary" @click="submitBanner">确定</el-button>
<el-button type="primary"
@click="submitBanner">确定</el-button>
</span>
</el-dialog>
<!-- 剪裁组件弹窗 -->
<el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false">
<Cropper
ref="cropper"
<el-dialog title="图片裁剪"
append-to-body
:visible.sync="cropperModel"
width="1100px"
:close-on-click-modal="false">
<Cropper ref="cropper"
:img-file.sync="file"
:is-upload="isUpload"
:fixed="true"
@ -79,7 +121,7 @@ import Setting from '@/setting'
import Cropper from '@/components/img-upload/Cropper'
import Axios from 'axios'
export default {
data() {
data () {
return {
headers: {
token: sessionStorage.getItem("token")
@ -94,18 +136,18 @@ export default {
},
cropperModel: false,
isUpload: false,
fixedNumber: [5.7, 1],
fixedNumber: [5.48, 1],
file: ''
};
},
components: {
Cropper
},
mounted() {
mounted () {
this.getList()
},
methods: {
getList() {
getList () {
this.$post(this.api.listMarketing, {
pageNum: 1,
pageSize: 1000
@ -116,13 +158,13 @@ export default {
});
},
//
customUpload(data) {
customUpload (data) {
const formData = new FormData()
formData.append('file', data, this.file.name)
this.imgUpload(formData)
},
//
compress(img) {
compress (img) {
const canvas = document.createElement('canvas')
const ctx = canvas.getContext('2d')
// let initSize = img.src.length;
@ -139,7 +181,7 @@ export default {
return ndata
},
// base64bolb
dataURItoBlob(base64Data) {
dataURItoBlob (base64Data) {
let byteString
if (base64Data.split(',')[0].indexOf('base64') >= 0) {
byteString = atob(base64Data.split(',')[1])
@ -159,7 +201,7 @@ export default {
})
},
//
imgUpload(formData) {
imgUpload (formData) {
this.isUpload = true
Axios({
method: 'post',
@ -171,13 +213,13 @@ export default {
},
}).then(({ data }) => {
this.form.banner = data.filesResult.fileUrl
}).catch(res => {})
}).catch(res => { })
this.$refs.cropper.isDisabled = false
this.isUpload = false
this.cropperModel = false
},
//
changeFile(file) {
changeFile (file) {
const { size, name } = file
const ext = name.substring(name.lastIndexOf('.') + 1)
if (!Util.isImg(ext)) {
@ -193,7 +235,7 @@ export default {
})
})
},
add() {
add () {
this.form = {
id: '',
banner: '',
@ -202,20 +244,20 @@ export default {
}
this.bannerVisible = true
},
edit(row) {
edit (row) {
this.form = JSON.parse(JSON.stringify(row))
this.bannerVisible = true
},
// banner
submitBanner() {
submitBanner () {
const { form } = this
if (!form.banner) return Util.errorMsg('请上传图片')
this.$post(this.api[form.id ? 'updateMarketing' : 'saveMarketing'], form).then(res => {
this.getList()
this.bannerVisible = false
}).catch(res => {})
}).catch(res => { })
},
handleDelete(row) {
handleDelete (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
@ -229,8 +271,8 @@ export default {
.catch(() => {
});
},
switchOff(val, row) {
this.$post(`${this.api.bannerEnableOrDisable}?id=${row.id}&isDisable=${row.isOpen}`).then(res => {}).catch(err => {})
switchOff (val, row) {
this.$post(`${this.api.bannerEnableOrDisable}?id=${row.id}&isDisable=${row.isOpen}`).then(res => { }).catch(err => { })
}
}
};
@ -253,7 +295,7 @@ $avatar-width: 104px;
overflow: hidden;
&:hover {
border-color: #409EFF;
border-color: #409eff;
}
.uploader-default {

@ -2,80 +2,146 @@
<!-- 产品管理 -->
<div style="padding-top: 24px">
<div class="tool">
<ul class="filter" style="align-items: flex-start">
<ul class="filter"
style="align-items: flex-start">
<li>
<label>学科类</label>
<el-select v-model="form.categoryId" clearable
@change="getProfessionalClass()" @clear="clearClass()">
<el-option v-for="(item,index) in subjectList" :key="index"
<el-select v-model="form.categoryId"
clearable
@change="getProfessionalClass()"
@clear="clearClass()">
<el-option v-for="(item,index) in subjectList"
:key="index"
:label="item.disciplineName"
:value="item.disciplineId"></el-option>
</el-select>
</li>
<li>
<label>专业类</label>
<el-select v-model="form.professionalCategoryId" clearable
<el-select v-model="form.professionalCategoryId"
clearable
:disabled="form.categoryId ? false : true"
@change="getProfessional" @clear="clearProfess()">
<el-option v-for="(item,index) in professionalClassList" :key="index"
@change="getProfessional"
@clear="clearProfess()">
<el-option v-for="(item,index) in professionalClassList"
:key="index"
:label="item.professionalClassName"
:value="item.professionalClassId"></el-option>
</el-select>
</li>
<li>
<label>专业</label>
<el-select v-model="form.professionalId" clearable
<el-select v-model="form.professionalId"
clearable
:disabled="form.professionalCategoryId ? false : true"
@change="initData">
<el-option v-for="(item,index) in professionalList" :key="index"
<el-option v-for="(item,index) in professionalList"
:key="index"
:label="item.professionalName"
:value="item.professionalId"></el-option>
</el-select>
</li>
<li>
<label>产品分类</label>
<el-select v-model="form.productClassification" clearable placeholder="请选择产品分类" @change="initData">
<el-option v-for="(item, i) in productCategoryList" :key="i" :label="item.classificationName" :value="item.classificationId"></el-option>
<el-select v-model="form.productClassification"
clearable
placeholder="请选择产品分类"
@change="initData">
<el-option v-for="(item, i) in productCategoryList"
:key="i"
:label="item.classificationName"
:value="item.classificationId"></el-option>
</el-select>
</li>
<li>
<label>搜索</label>
<el-input placeholder="请输入" suffix-icon="el-icon-search" v-model="form.productName" clearable size="small"></el-input>
<el-input placeholder="请输入"
suffix-icon="el-icon-search"
v-model="form.productName"
clearable
size="small"></el-input>
</li>
</ul>
<div>
<el-button v-auth="'/shop:产品管理:新增'" type="primary" round @click="addCourse">新增</el-button>
<el-button v-auth="'/shop:产品管理:新增'"
type="primary"
round
@click="addCourse">新增</el-button>
</div>
</div>
<el-table :data="list" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange">
<el-table-column type="selection" width="80" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<el-table :data="list"
class="table"
ref="table"
stripe
header-align="center"
@selection-change="handleSelectionChange"
row-key="id"
@sort-change="sortChange">
<el-table-column type="selection"
width="80"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="100"
label="序号"
align="center">
<template slot-scope="scope">
{{ scope.$index + (page - 1) * pageSize + 1 }}
</template>
</el-table-column>
<el-table-column prop="productName" label="产品名称" min-width="150" align="center"></el-table-column>
<el-table-column prop="supplierName" label="厂商" min-width="150" align="center"></el-table-column>
<el-table-column prop="classificationName" label="产品分类" min-width="150" align="center"></el-table-column>
<el-table-column prop="typeName" label="产品类型" min-width="150" align="center"></el-table-column>
<el-table-column prop="associatedProductName" label="关联产品" min-width="140" align="center"></el-table-column>
<el-table-column prop="courseName" label="状态" min-width="140" align="center">
<el-table-column prop="productName"
label="产品名称"
min-width="150"
align="center"></el-table-column>
<el-table-column prop="supplierName"
label="厂商"
min-width="150"
align="center"></el-table-column>
<el-table-column prop="classificationName"
label="产品分类"
min-width="150"
align="center"></el-table-column>
<el-table-column prop="typeName"
label="产品类型"
min-width="150"
align="center"></el-table-column>
<el-table-column prop="associatedProductName"
label="关联产品"
min-width="140"
align="center"></el-table-column>
<el-table-column prop="courseName"
label="状态"
min-width="140"
align="center">
<template slot-scope="scope">
{{ scope.row.isShelves ? '下架' : '上架' }}
</template>
</el-table-column>
<el-table-column prop="orderQuantity" label="订单量" min-width="150" align="center"></el-table-column>
<el-table-column prop="userName" label="最近编辑人" min-width="150" align="center"></el-table-column>
<el-table-column prop="selected" label="精选" min-width="150" align="center" sortable="custom">
<el-table-column prop="orderQuantity"
label="订单量"
min-width="150"
align="center"></el-table-column>
<el-table-column prop="userName"
label="最近编辑人"
min-width="150"
align="center"></el-table-column>
<el-table-column prop="selected"
label="精选"
min-width="150"
align="center"
sortable="custom">
<template slot-scope="scope">
<i v-auth="'/shop:产品管理:精选'" :class="['icon', scope.row.selected ? 'el-icon-check' : 'el-icon-close']" @click="selected(scope.row)"></i>
<i v-auth="'/shop:产品管理:精选'"
:class="['icon', scope.row.selected ? 'el-icon-check' : 'el-icon-close']"
@click="selected(scope.row)"></i>
</template>
</el-table-column>
<el-table-column label="上架/下架" align="center" width="90">
<el-table-column label="上架/下架"
align="center"
width="90">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShelves"
<el-switch v-model="scope.row.isShelves"
:active-value="0"
:inactive-value="1"
@change="changeSwitch($event, scope.row)"
@ -83,18 +149,31 @@
</el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120">
<el-table-column label="操作"
align="center"
width="120">
<template slot-scope="scope">
<template v-if="scope.row.isShelves">
<el-button v-auth="'/shop:产品管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/shop:产品管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-button v-auth="'/shop:产品管理:编辑'"
type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/shop:产品管理:删除'"
type="text"
@click="handleDelete(scope.row)">删除</el-button>
</template>
<el-button v-else v-auth="'/shop:产品管理:查看'" type="text" @click="edit(scope.row, 1)">查看</el-button>
<el-button v-else
v-auth="'/shop:产品管理:查看'"
type="text"
@click="edit(scope.row, 1)">查看</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page">
<el-pagination background
layout="total, prev, pager, next"
:total="total"
@current-change="handleCurrentChange"
:current-page="page">
</el-pagination>
</div>
</div>
@ -104,7 +183,7 @@
import Util from "@/libs/util";
import Setting from '@/setting'
export default {
data() {
data () {
return {
timer: null,
form: {
@ -128,20 +207,20 @@ export default {
};
},
watch: {
'form.productName': function(val) {
'form.productName': function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
}
},
mounted() {
mounted () {
this.getSubject()
this.getCategory()
this.initData()
},
methods: {
getData() {
getData () {
this.$post(this.api.listOfGoods, {
pageNum: this.page,
pageSize: this.pageSize,
@ -152,37 +231,37 @@ export default {
}).catch(res => {
});
},
initData() {
initData () {
this.page = 1;
this.getData();
},
//
getCategory() {
getCategory () {
this.$get(this.api.productCategoryList).then(res => {
this.productCategoryList = res.classificationList
}).catch(err => {})
}).catch(err => { })
},
//
getSubject() {
getSubject () {
this.$get(this.api.courseDiscipline).then(res => {
this.subjectList = res.list;
}).catch(err => {
});
},
//
clearClass() {
clearClass () {
this.form.professionalCategoryId = "";
this.form.professionalId = "";
},
//
getProfessionalClass() {
getProfessionalClass () {
this.clearClass();
this.getProfessionalClassData();
this.page = 1;
this.initData();
},
getProfessionalClassData() {
getProfessionalClassData () {
let data = {
disciplineId: this.form.categoryId
};
@ -192,17 +271,17 @@ export default {
});
},
//
clearProfess() {
clearProfess () {
this.form.professionalId = "";
},
//
getProfessional() {
getProfessional () {
this.clearProfess();
this.getProfessionalData();
this.page = 1;
this.initData();
},
getProfessionalData() {
getProfessionalData () {
let data = {
professionalClassId: this.form.professionalCategoryId
};
@ -211,13 +290,13 @@ export default {
}).catch(err => {
});
},
addCourse() {
addCourse () {
this.$router.push("/shop/addProduct");
},
edit(row, show = 0) {
edit (row, show = 0) {
this.$router.push(`/shop/addProduct?id=${row.mallId}&show=${show}`)
},
handleDelete(row) {
handleDelete (row) {
this.$confirm("此删除操作不可逆,是否确认删除选中项?", "提示", {
type: "warning"
})
@ -231,10 +310,10 @@ export default {
.catch(() => {
});
},
handleSelectionChange(val) {
handleSelectionChange (val) {
this.multipleSelection = val;
},
delAllData() {
delAllData () {
const list = this.multipleSelection
if (list.length != "") {
this.$confirm(`确定要删除吗?`, "提示", {
@ -257,12 +336,12 @@ export default {
Util.errorMsg("请先选择数据 !");
}
},
handleCurrentChange(val) {
handleCurrentChange (val) {
this.page = val;
this.getData();
},
//
async changeSwitch(value, row) {
async changeSwitch (value, row) {
const res = await this.$get(`${this.api.detailsOfGoods}?mallId=${row.mallId}`)
const form = res.orderDetails
const { mall } = form
@ -323,13 +402,13 @@ export default {
})
},
//
selected(row) {
selected (row) {
this.$post(`${this.api.goodsSelection}?mallId=${row.mallId}&selected=${row.selected ? 0 : 1}`).then((res) => {
this.getData();
}).catch((res) => {})
}).catch((res) => { })
},
//
sortChange(column) {
sortChange (column) {
const { order } = column
if (column.prop === 'selected') {
this.form.sort = order ? order === 'ascending' ? 4 : 3 : 0
@ -342,7 +421,12 @@ export default {
<style lang="scss" scoped>
/deep/ .tool {
margin-bottom: 14px;
.filter {
flex-wrap: wrap;
li {
margin-bottom: 10px;
}
.el-input {
min-width: 215px;
}
@ -350,7 +434,7 @@ export default {
}
.icon {
font-size: 16px;
color: #9076FF;
color: #9076ff;
cursor: pointer;
}
</style>
Loading…
Cancel
Save