fixLog V2.4.8
yujialong 1 year ago
parent 7f1c4ef666
commit 117dcd2537
  1. 4
      src/components/Header.vue
  2. 98
      src/components/codemirror.vue
  3. 2
      src/setting.js
  4. 1
      src/utils/api.js
  5. 742
      src/views/customer/AddCustomer.vue
  6. 98
      src/views/order/AddOrder.vue
  7. 568
      src/views/parnerOperation/schemeSet.vue

@ -74,8 +74,8 @@ export default {
}, },
initSocket ({ id, account }) { initSocket ({ id, account }) {
// socket // socket
// this.socket = new WebSocket(`ws://${Setting.isDev ? '192.168.31.51' : location.host}:9100/nakadai/websocket/${id}/${account}`) this.socket = new WebSocket(`wss://${Setting.isDev ? '192.168.31.51' : location.host}/nakadai/websocket/${id}/${account}`)
this.socket = new WebSocket(`ws://121.37.12.51:9100/nakadai/websocket/${id}/${account}`) // this.socket = new WebSocket(`ws://121.37.12.51:9100/nakadai/websocket/${id}/${account}`)
// socket // socket
this.socket.onopen = this.open; this.socket.onopen = this.open;
// socket // socket

@ -1,37 +1,45 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="left"> <div class="left">
<codemirror <codemirror v-model="codeVal"
v-model="codeVal"
:options="cmOption" :options="cmOption"
class="code-mirror" class="code-mirror"
@ready="ready" @ready="ready"
ref="codemirror" ref="codemirror"></codemirror>
></codemirror> <el-button class="run btn"
<el-button
class="run btn"
type="primary" type="primary"
@click="runCode" @click="runCode">运行</el-button>
>运行</el-button>
</div> </div>
<div class="code-right answer"> <div class="code-right answer">
<p class="text-wrapper">{{ runResult }}</p> <p class="text-wrapper">{{ runResult }}</p>
<div class="pic-wrap" v-if="picSrcList.length"> <div class="pic-wrap"
<div class="pic-item" v-for="(img, i) in picSrcList" :key="i"> v-if="picSrcList.length">
<el-image <div class="pic-item"
class="pic" v-for="(img, i) in picSrcList"
:key="i">
<el-image class="pic"
:src="img" :src="img"
:preview-src-list="picSrcList"> :preview-src-list="picSrcList">
</el-image> </el-image>
<el-button class="download-btn btn" type="primary" size="mini" @click="downloadPic(i)">下载图片</el-button> <el-button class="download-btn btn"
<a :ref="'picLink' + i" style="display: none;" download="运行结果.png" :href="img">下载图片</a> type="primary"
size="mini"
@click="downloadPic(i)">下载图片</el-button>
<a :ref="'picLink' + i"
style="display: none;"
download="运行结果.png"
:href="img">下载图片</a>
</div> </div>
</div> </div>
<div class="result-right t-color" v-show="isError"> <div class="result-right t-color"
<img src="@/assets/img/yes.png" alt />运行成功 v-show="isError">
<img src="@/assets/img/yes.png"
alt />运行成功
</div> </div>
<div class="result-wrong" v-show="isError === 0"> <div class="result-wrong"
<img src="@/assets/img/error.png" alt /> v-show="isError === 0">
<img src="@/assets/img/error.png"
alt />
{{errLine}}行出现错误 {{errLine}}行出现错误
</div> </div>
</div> </div>
@ -82,7 +90,7 @@ import "codemirror/theme/base16-light.css";
import { Loading } from 'element-ui'; import { Loading } from 'element-ui';
export default { export default {
props: ['code', 'codeId', 'projectId', 'retResult', 'readOnly'], props: ['code', 'codeId', 'projectId', 'retResult', 'readOnly'],
data() { data () {
return { return {
codeVal: this.code, codeVal: this.code,
runResult: '', // runResult: '', //
@ -122,25 +130,25 @@ export default {
codemirror codemirror
}, },
watch: { watch: {
codeVal(val) { codeVal (val) {
this.$emit("update:code", val) this.$emit("update:code", val)
} }
}, },
mounted() { mounted () {
}, },
methods: { methods: {
// //
ready() { ready () {
const code = this.$refs.codemirror.codemirror const code = this.$refs.codemirror.codemirror
code.setSize("auto", "calc(100vh - 370px)"); code.setSize("auto", "calc(100vh - 370px)");
code.on('keypress', function() { code.on('keypress', function () {
// //
code.showHint() code.showHint()
}); });
}, },
// //
runCode() { runCode () {
let code = this.codeVal let code = this.codeVal
if (!code) { if (!code) {
this.$message({ this.$message({
@ -169,7 +177,7 @@ export default {
let firtImg = '' let firtImg = ''
try { try {
imgList = eval(result) imgList = eval(result)
} catch (error) {} } catch (error) { }
if (imgList && imgList.length) firtImg = imgList[0] if (imgList && imgList.length) firtImg = imgList[0]
// //
if (photo) { if (photo) {
@ -182,7 +190,7 @@ export default {
* 这段是为要下载图片的项目案例写的后端会返回图片名称的数组前端负责循环这个数组然后下载下来 * 这段是为要下载图片的项目案例写的后端会返回图片名称的数组前端负责循环这个数组然后下载下来
* 只有该系统有这段代码因为其他7个系统没有下载图片的项目后续如果加了直接把这段代码复制过去即可 * 只有该系统有这段代码因为其他7个系统没有下载图片的项目后续如果加了直接把这段代码复制过去即可
*/ */
imgList.map((n,i) => { imgList.map((n, i) => {
// util.downloadFile(`${i+1}.jpg`,n) // util.downloadFile(`${i+1}.jpg`,n)
}) })
this.isError = 0 this.isError = 0
@ -202,7 +210,7 @@ export default {
} }
}, },
// //
downloadPic(i) { downloadPic (i) {
this.$refs['picLink' + i][0].click() this.$refs['picLink' + i][0].click()
} }
} }
@ -217,15 +225,18 @@ export default {
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
width: 5px; width: 5px;
border-radius: 6px; border-radius: 6px;
background: rgba(173,173,173,.7); background: rgba(173, 173, 173, 0.7);
} }
.wrap { .wrap {
display: flex; display: flex;
} }
.left{ .left {
position: relative; position: relative;
width: calc(100% - 400px); width: calc(100% - 400px);
} }
.code-mirror {
line-height: 30px;
}
.text-wrapper { .text-wrapper {
white-space: pre-wrap; white-space: pre-wrap;
} }
@ -286,11 +297,6 @@ export default {
} }
} }
} }
/deep/.CodeMirror-wrap pre.CodeMirror-line,
.CodeMirror-wrap pre.CodeMirror-line-like {
height: 30px;
line-height: 30px;
}
.result-right { .result-right {
background-color: rgba(43, 40, 22, 1); background-color: rgba(43, 40, 22, 1);
} }
@ -355,7 +361,7 @@ export default {
margin: 0 auto 10px; margin: 0 auto 10px;
} }
} }
.code-mask{ .code-mask {
z-index: 2; z-index: 2;
position: absolute; position: absolute;
top: 0; top: 0;
@ -363,23 +369,23 @@ export default {
bottom: 0; bottom: 0;
right: 0; right: 0;
} }
.run{ .run {
z-index:99; z-index: 99;
position:absolute; position: absolute;
right: 50px; right: 50px;
bottom:15px; bottom: 15px;
width:100px; width: 100px;
color:#fff; color: #fff;
} }
.download-btn{ .download-btn {
color:#fff; color: #fff;
} }
/deep/.answer-wrap{ /deep/.answer-wrap {
pre{ pre {
width: 100%; width: 100%;
white-space: pre-wrap; white-space: pre-wrap;
} }
img{ img {
max-width: 100%; max-width: 100%;
} }
} }

@ -11,7 +11,7 @@ if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统 jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/' // host = 'https://huorantech.cn/'
host = 'http://192.168.31.152:9000/'// 榕 // host = 'http://192.168.31.152:9000/'// 榕
// host = 'http://192.168.31.51:9000/'// 赓 // host = 'http://192.168.31.51:9000/'// 赓
} else if (isPro) { } else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/' jumpPath = 'https://www.huorantech.cn/judgmentPoint/'

@ -44,6 +44,7 @@ export default {
getProductsSubscribedByCustomers: `nakadai/nakadai/customer/getProductsSubscribedByCustomers`, getProductsSubscribedByCustomers: `nakadai/nakadai/customer/getProductsSubscribedByCustomers`,
orderBulkDisableEnable: `nakadai/nakadai/orderOther/orderBulkDisableEnable`, orderBulkDisableEnable: `nakadai/nakadai/orderOther/orderBulkDisableEnable`,
exportSubscribedRecords: `nakadai/nakadai/order/exportSubscribedRecords`, exportSubscribedRecords: `nakadai/nakadai/order/exportSubscribedRecords`,
addNewCustomersByOneself: `nakadai/nakadai/school/addNewCustomersByOneself`,
resetPwdCustomer: `nakadai/nakadai/customer/resetPwd`, resetPwdCustomer: `nakadai/nakadai/customer/resetPwd`,
queryCustomerIsExists: `nakadai/nakadai/customer/queryCustomerIsExists`, queryCustomerIsExists: `nakadai/nakadai/customer/queryCustomerIsExists`,

File diff suppressed because it is too large Load Diff

@ -187,7 +187,7 @@
round round
@click="batchDeliver(0, 0)">取消全部发货</el-button> @click="batchDeliver(0, 0)">取消全部发货</el-button>
</template> </template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" <el-button v-if="!viewDisabled&&!isEdit&&!renewDisabled"
type="primary" type="primary"
round round
@click="addCourseJurisdiction(1)">添加</el-button> @click="addCourseJurisdiction(1)">添加</el-button>
@ -216,7 +216,7 @@
<div class="small"> <div class="small">
<el-input class="time-input" <el-input class="time-input"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''" :class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
maxlength="4" maxlength="4"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
@input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')" @input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')"
@ -224,7 +224,7 @@
placeholder="输入时间"></el-input> placeholder="输入时间"></el-input>
<el-select class="time-select" <el-select class="time-select"
v-model="scope.row.options" v-model="scope.row.options"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
placeholder="请选择" placeholder="请选择"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"> @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)">
<el-option label="日" <el-option label="日"
@ -246,7 +246,7 @@
style="width:130px" style="width:130px"
v-model="scope.row.startTime" v-model="scope.row.startTime"
type="date" type="date"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期"> placeholder="请选择使用日期">
</el-date-picker> </el-date-picker>
@ -256,7 +256,7 @@
style="width:130px" style="width:130px"
v-model="scope.row.startTime" v-model="scope.row.startTime"
type="date" type="date"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期"> placeholder="请选择使用日期">
</el-date-picker> </el-date-picker>
@ -341,7 +341,7 @@
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex-c-c"> <div class="flex-c-c">
<el-button v-if="!editDisabled&&!viewDisabled" <el-button v-if="!isEdit&&!viewDisabled"
type="text" type="text"
@click="delCourseForm(scope.$index, scope.row)" @click="delCourseForm(scope.$index, scope.row)"
style="margin-right:10px;">删除</el-button> style="margin-right:10px;">删除</el-button>
@ -399,7 +399,7 @@
round round
@click="batchDeliver(0, 5)">取消全部发货</el-button> @click="batchDeliver(0, 5)">取消全部发货</el-button>
</template> </template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" <el-button v-if="!viewDisabled&&!isEdit&&!renewDisabled"
type="primary" type="primary"
round round
@click="addCourseJurisdiction(2)">添加</el-button> @click="addCourseJurisdiction(2)">添加</el-button>
@ -428,7 +428,7 @@
<div class="small"> <div class="small">
<el-input class="time-input" <el-input class="time-input"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''" :class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
maxlength="4" maxlength="4"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
@input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')" @input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')"
@ -436,7 +436,7 @@
placeholder="输入时间"></el-input> placeholder="输入时间"></el-input>
<el-select class="time-select" <el-select class="time-select"
v-model="scope.row.options" v-model="scope.row.options"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
placeholder="请选择" placeholder="请选择"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"> @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)">
<el-option label="日" <el-option label="日"
@ -458,7 +458,7 @@
style="width:130px" style="width:130px"
v-model="scope.row.startTime" v-model="scope.row.startTime"
type="date" type="date"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期"> placeholder="请选择使用日期">
</el-date-picker> </el-date-picker>
@ -468,7 +468,7 @@
style="width:130px" style="width:130px"
v-model="scope.row.startTime" v-model="scope.row.startTime"
type="date" type="date"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期"> placeholder="请选择使用日期">
</el-date-picker> </el-date-picker>
@ -553,7 +553,7 @@
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex-c-c"> <div class="flex-c-c">
<el-button v-if="!editDisabled&&!viewDisabled" <el-button v-if="!isEdit&&!viewDisabled"
type="text" type="text"
@click="delCourseDataForm(scope.$index, scope.row)" @click="delCourseDataForm(scope.$index, scope.row)"
style="margin-right:10px;">删除</el-button> style="margin-right:10px;">删除</el-button>
@ -611,7 +611,7 @@
round round
@click="batchDeliver(0, 1)">取消全部发货</el-button> @click="batchDeliver(0, 1)">取消全部发货</el-button>
</template> </template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" <el-button v-if="!viewDisabled&&!isEdit&&!renewDisabled"
type="primary" type="primary"
round round
class="mag" class="mag"
@ -641,7 +641,7 @@
<div class="small"> <div class="small">
<el-input class="time-input" <el-input class="time-input"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''" :class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
maxlength="4" maxlength="4"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"
@input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')" @input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')"
@ -650,7 +650,7 @@
<span style="margin-left:5px"> <span style="margin-left:5px">
<el-select class="time-select" <el-select class="time-select"
v-model="scope.row.options" v-model="scope.row.options"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
placeholder="请选择" placeholder="请选择"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"> @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)">
<el-option label="日" <el-option label="日"
@ -673,7 +673,7 @@
style="width:130px" style="width:130px"
v-model="scope.row.startTime" v-model="scope.row.startTime"
type="date" type="date"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期"> placeholder="请选择使用日期">
</el-date-picker> </el-date-picker>
@ -683,7 +683,7 @@
style="width:130px" style="width:130px"
v-model="scope.row.startTime" v-model="scope.row.startTime"
type="date" type="date"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期"> placeholder="请选择使用日期">
</el-date-picker> </el-date-picker>
@ -794,7 +794,7 @@
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex-c-c"> <div class="flex-c-c">
<el-button v-if="!editDisabled&&!viewDisabled" <el-button v-if="!isEdit&&!viewDisabled"
type="text" type="text"
@click="delDataForm(scope.$index, scope.row)" @click="delDataForm(scope.$index, scope.row)"
style="margin-right:10px;">删除</el-button> style="margin-right:10px;">删除</el-button>
@ -845,7 +845,7 @@
round round
@click="batchDeliver(0, 2)">取消全部发货</el-button> @click="batchDeliver(0, 2)">取消全部发货</el-button>
</template> </template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" <el-button v-if="!viewDisabled&&!isEdit&&!renewDisabled"
type="primary" type="primary"
round round
class="mag" class="mag"
@ -875,7 +875,7 @@
<div class="small"> <div class="small">
<el-input class="time-input" <el-input class="time-input"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''" :class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
maxlength="4" maxlength="4"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"
@input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')" @input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')"
@ -884,7 +884,7 @@
<span style="margin-left:5px"> <span style="margin-left:5px">
<el-select class="time-select" <el-select class="time-select"
v-model="scope.row.options" v-model="scope.row.options"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
placeholder="请选择" placeholder="请选择"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"> @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)">
<el-option label="日" <el-option label="日"
@ -907,7 +907,7 @@
style="width:130px" style="width:130px"
v-model="scope.row.startTime" v-model="scope.row.startTime"
type="date" type="date"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
placeholder="请选择使用日期"> placeholder="请选择使用日期">
</el-date-picker> </el-date-picker>
</p> </p>
@ -916,7 +916,7 @@
style="width:130px" style="width:130px"
v-model="scope.row.startTime" v-model="scope.row.startTime"
type="date" type="date"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期"> placeholder="请选择使用日期">
</el-date-picker> </el-date-picker>
@ -994,7 +994,7 @@
width="180"> width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex-c-c"> <div class="flex-c-c">
<el-button v-if="!editDisabled&&!viewDisabled" <el-button v-if="!isEdit&&!viewDisabled"
type="text" type="text"
@click="delDataFormList(scope.$index, scope.row)" @click="delDataFormList(scope.$index, scope.row)"
style="margin-right:10px;">删除</el-button> style="margin-right:10px;">删除</el-button>
@ -1045,7 +1045,7 @@
round round
@click="batchDeliver(0, 3)">取消全部发货</el-button> @click="batchDeliver(0, 3)">取消全部发货</el-button>
</template> </template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" <el-button v-if="!viewDisabled&&!isEdit&&!renewDisabled"
type="primary" type="primary"
round round
class="mag" class="mag"
@ -1076,7 +1076,7 @@
<div class="small"> <div class="small">
<el-input class="time-input" <el-input class="time-input"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''" :class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
maxlength="4" maxlength="4"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
@input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')" @input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')"
@ -1084,7 +1084,7 @@
placeholder="输入时间"></el-input> placeholder="输入时间"></el-input>
<el-select class="time-select" <el-select class="time-select"
v-model="scope.row.options" v-model="scope.row.options"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
placeholder="请选择" placeholder="请选择"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"> @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)">
<el-option label="日" <el-option label="日"
@ -1106,7 +1106,7 @@
style="width:130px" style="width:130px"
v-model="scope.row.startTime" v-model="scope.row.startTime"
type="date" type="date"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期"> placeholder="请选择使用日期">
</el-date-picker> </el-date-picker>
@ -1116,7 +1116,7 @@
style="width:130px" style="width:130px"
v-model="scope.row.startTime" v-model="scope.row.startTime"
type="date" type="date"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期"> placeholder="请选择使用日期">
</el-date-picker> </el-date-picker>
@ -1197,7 +1197,7 @@
<el-button style="margin-right: 10px;" <el-button style="margin-right: 10px;"
type="text" type="text"
@click="showShip(scope.row)">{{ viewDisabled ? '' : '编辑' }}发货内容</el-button> @click="showShip(scope.row)">{{ viewDisabled ? '' : '编辑' }}发货内容</el-button>
<el-button v-if="!editDisabled&&!viewDisabled" <el-button v-if="!isEdit&&!viewDisabled"
type="text" type="text"
@click="delPracticalCourses(scope.$index, scope.row)" @click="delPracticalCourses(scope.$index, scope.row)"
style="margin: 0 10px;">删除</el-button> style="margin: 0 10px;">删除</el-button>
@ -1255,7 +1255,7 @@
round round
@click="batchDeliver(0, 4)">取消全部发货</el-button> @click="batchDeliver(0, 4)">取消全部发货</el-button>
</template> </template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" <el-button v-if="!viewDisabled&&!isEdit&&!renewDisabled"
type="primary" type="primary"
round round
class="mag" class="mag"
@ -1286,7 +1286,7 @@
<div class="small"> <div class="small">
<el-input class="time-input" <el-input class="time-input"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''" :class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
maxlength="4" maxlength="4"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
@input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')" @input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')"
@ -1294,7 +1294,7 @@
placeholder="输入时间"></el-input> placeholder="输入时间"></el-input>
<el-select class="time-select" <el-select class="time-select"
v-model="scope.row.options" v-model="scope.row.options"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
placeholder="请选择" placeholder="请选择"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"> @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)">
<el-option label="日" <el-option label="日"
@ -1316,7 +1316,7 @@
style="width:130px" style="width:130px"
v-model="scope.row.startTime" v-model="scope.row.startTime"
type="date" type="date"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期"> placeholder="请选择使用日期">
</el-date-picker> </el-date-picker>
@ -1326,7 +1326,7 @@
style="width:130px" style="width:130px"
v-model="scope.row.startTime" v-model="scope.row.startTime"
type="date" type="date"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled||isEdit"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"
placeholder="请选择使用日期"> placeholder="请选择使用日期">
</el-date-picker> </el-date-picker>
@ -1407,7 +1407,7 @@
<el-button style="margin-right: 10px;" <el-button style="margin-right: 10px;"
type="text" type="text"
@click="showShip(scope.row)">{{ viewDisabled ? '' : '编辑' }}发货内容</el-button> @click="showShip(scope.row)">{{ viewDisabled ? '' : '编辑' }}发货内容</el-button>
<el-button v-if="!editDisabled&&!viewDisabled" <el-button v-if="!isEdit&&!viewDisabled"
type="text" type="text"
@click="delExpTool(scope.$index, scope.row)" @click="delExpTool(scope.$index, scope.row)"
style="margin-right:10px;">删除</el-button> style="margin-right:10px;">删除</el-button>
@ -1743,11 +1743,12 @@ export default {
loading: false,// loading: false,//
isAdd: false, // isAdd: false, //
viewDisabled: false,// viewDisabled: false,//
editDisabled: false,// editDisabled: false,//
isEdit: false, //
renewDisabled: false,// renewDisabled: false,//
dataLoading: false,// dataLoading: false,//
whetherSubmit: false,/* 提交否 */ whetherSubmit: false,/* 提交否 */
dispose: false, dispose: false, //
showSelectClient: false,// showSelectClient: false,//
form: {// form: {//
// orderNumber: '',// // orderNumber: '',//
@ -1954,6 +1955,7 @@ export default {
this.dispose = true; this.dispose = true;
} else { } else {
this.titlesw = '修改订单' this.titlesw = '修改订单'
this.isEdit = true
} }
this.editDisabled = true; this.editDisabled = true;
await this.getDetail(this.$route.query.orderId); await this.getDetail(this.$route.query.orderId);
@ -2031,8 +2033,7 @@ export default {
this.$post(this.api.renew, { this.$post(this.api.renew, {
authority: 1, authority: 1,
customerId, customerId,
productId: orderOther.filter(e => e.authority === 1).map(e => e.dataOrCourseId), productId: orderOther.filter(e => e.authority === 1).map(e => e.mallId),
mallId: orderOther.filter(e => e.authority === 1).map(e => e.mallId),
}).then(({ orderOthers }) => { }).then(({ orderOthers }) => {
list.push(...orderOthers) list.push(...orderOthers)
resolve() resolve()
@ -2044,8 +2045,7 @@ export default {
this.$post(this.api.renew, { this.$post(this.api.renew, {
authority: 0, authority: 0,
customerId, customerId,
productId: orderOther.filter(e => !e.authority).map(e => e.dataOrCourseId), productId: orderOther.filter(e => !e.authority).map(e => e.mallId),
mallId: orderOther.filter(e => !e.authority).map(e => e.mallId),
}).then(({ orderOthers }) => { }).then(({ orderOthers }) => {
list.push(...orderOthers) list.push(...orderOthers)
resolve() resolve()
@ -2057,8 +2057,7 @@ export default {
this.$post(this.api.renew, { this.$post(this.api.renew, {
authority: 2, authority: 2,
customerId, customerId,
productId: orderOther.filter(e => e.authority === 2).map(e => e.dataOrCourseId), productId: orderOther.filter(e => e.authority === 2).map(e => e.mallId),
mallId: orderOther.filter(e => e.authority === 2).map(e => e.mallId),
}).then(({ orderOthers }) => { }).then(({ orderOthers }) => {
list.push(...orderOthers) list.push(...orderOthers)
resolve() resolve()
@ -2070,8 +2069,7 @@ export default {
this.$post(this.api.renew, { this.$post(this.api.renew, {
authority: 3, authority: 3,
customerId, customerId,
productId: orderOther.filter(e => e.authority === 3).map(e => e.dataOrCourseId), productId: orderOther.filter(e => e.authority === 3).map(e => e.mallId),
mallId: orderOther.filter(e => e.authority === 3).map(e => e.mallId),
}).then(({ orderOthers }) => { }).then(({ orderOthers }) => {
list.push(...orderOthers) list.push(...orderOthers)
resolve() resolve()
@ -2084,8 +2082,7 @@ export default {
authority: 4, authority: 4,
// authority: 3, // authority: 3,
customerId, customerId,
productId: orderOther.filter(e => e.authority === 4).map(e => e.dataOrCourseId), productId: orderOther.filter(e => e.authority === 4).map(e => e.mallId),
mallId: orderOther.filter(e => e.authority === 4).map(e => e.mallId),
}).then(({ orderOthers }) => { }).then(({ orderOthers }) => {
list.push(...orderOthers) list.push(...orderOthers)
resolve() resolve()
@ -2580,10 +2577,8 @@ export default {
}) })
}; };
const productId = [] const productId = []
const mallId = []
this.practicalCoursesSelect.map(e => {// this.practicalCoursesSelect.map(e => {//
e.associatedProduct && productId.push(+e.associatedProduct); productId.push(e.mallId)
mallId.push(e.mallId)
let find = this[name].some(i => e.mallId === i.mallId);// id let find = this[name].some(i => e.mallId === i.mallId);// id
if (!find) { if (!find) {
// //
@ -2605,7 +2600,6 @@ export default {
authority, authority,
customerId: this.form.customerId, customerId: this.form.customerId,
productId, productId,
mallId
}).then(res => { }).then(res => {
this[name].map(e => { this[name].map(e => {
res.orderOthers.map(el => { res.orderOthers.map(el => {

@ -1,112 +1,148 @@
<template> <template>
<div> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover"
class="mgb20">
<div class="flex-between"> <div class="flex-between">
<div class="per_title" v-preventReClick @click="back"> <div class="per_title"
v-preventReClick
@click="back">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span> <span class="per_back">返回</span>
<span class="per_school" v-text="form.id ? '编辑方案' : '新建方案'"></span> <span class="per_school"
v-text="form.id ? '编辑方案' : '新建方案'"></span>
</div> </div>
</div> </div>
</el-card> </el-card>
<div class="page"> <div class="page">
<el-form :model="form" :rules="rules" class="input-form model" label-width="140px"> <el-form :model="form"
:rules="rules"
class="input-form model"
label-width="140px">
<div class="item-line"> <div class="item-line">
<el-form-item prop="title" label="标题"> <el-form-item prop="title"
<el-input label="标题">
placeholder="请输入标题" <el-input placeholder="请输入标题"
v-model.trim="form.title" v-model.trim="form.title"
clearable clearable
maxlength="30" maxlength="30"
class="inline-input" class="inline-input"></el-input>
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="classificationId" label="所属分类"> <el-form-item prop="classificationId"
<el-select style="width: 234px;" v-model="form.classificationId"> label="所属分类">
<el-select style="width: 234px;"
v-model="form.classificationId">
<template v-for="item in classifications"> <template v-for="item in classifications">
<el-option <el-option v-if="item.id"
v-if="item.id"
:key="item.id" :key="item.id"
:label="item.classificationName" :label="item.classificationName"
:value="item.id"> :value="item.id">
</el-option> </el-option>
</template> </template>
</el-select> </el-select>
<el-button class="set-btn" type="primary" @click="setClass">设置</el-button> <el-button class="set-btn"
type="primary"
@click="setClass">设置</el-button>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item prop="applicableMajor" label="适用专业"> <el-form-item prop="applicableMajor"
<el-input label="适用专业">
style="width: 940px" <el-input style="width: 940px"
type="textarea" type="textarea"
v-model.trim="form.applicableMajor" v-model.trim="form.applicableMajor"
:rows="3" :rows="3"
clearable clearable></el-input>
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="schemeIntroduction" label="方案简介"> <el-form-item prop="schemeIntroduction"
<el-input label="方案简介">
style="width: 940px" <el-input style="width: 940px"
type="textarea" type="textarea"
v-model.trim="form.schemeIntroduction" v-model.trim="form.schemeIntroduction"
:rows="3" :rows="3"
clearable clearable></el-input>
></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="product" label="产品"> <el-form-item prop="product"
<el-input label="产品">
style="width: 940px" <el-button style="margin-bottom: 5px"
type="textarea" type="primary"
v-model.trim="form.product" @click="showProduct">请选择</el-button>
:rows="3" <div>
clearable <el-tag v-for="(tag, i) in form.productList"
></el-input> :key="i"
class="tag"
closable
@close="delCheckedProduct(i)">
{{tag.productName}}
</el-tag>
</div>
</el-form-item> </el-form-item>
<el-form-item prop="schemeFile" label="方案文件"> <el-form-item prop="schemeFile"
<el-upload label="方案文件">
:before-upload="fileBeforeUpload" <el-upload :before-upload="fileBeforeUpload"
:on-success="uploadSuccessFile" :on-success="uploadSuccessFile"
:action="this.api.fileUploadNakadai" :action="this.api.fileUploadNakadai"
:file-list="fileList" :file-list="fileList"
:limit="1" :limit="1"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:headers="headers" :headers="headers">
>
<el-button>上传</el-button> <el-button>上传</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="btns"> <div class="btns">
<el-button type="primary" @click="submit(1)">发布</el-button> <el-button type="primary"
@click="submit(1)">发布</el-button>
<el-button @click="submit(0)">保存草稿</el-button> <el-button @click="submit(0)">保存草稿</el-button>
<el-button @click="back">取消</el-button> <el-button @click="back">取消</el-button>
</div> </div>
</div> </div>
<el-dialog title="所属分类设置" :visible.sync="classVisible" width="500px" :close-on-click-modal="false" class="manage-dia" :before-close="closeClass"> <el-dialog title="所属分类设置"
:visible.sync="classVisible"
width="500px"
:close-on-click-modal="false"
class="manage-dia"
:before-close="closeClass">
<div class="plus"> <div class="plus">
<i class="el-icon-circle-plus-outline" @click="addClass"></i> <i class="el-icon-circle-plus-outline"
@click="addClass"></i>
</div> </div>
<el-table :data="classifications" ref="table" header-align="center" row-key="id"> <el-table :data="classifications"
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> ref="table"
<el-table-column prop="classificationName" label="分类名称" align="center" min-width="130"> header-align="center"
row-key="id">
<el-table-column type="index"
width="60"
label="序号"
align="center"></el-table-column>
<el-table-column prop="classificationName"
label="分类名称"
align="center"
min-width="130">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input <el-input v-if="scope.row.edit"
v-if="scope.row.edit"
placeholder="请输入分类名称" placeholder="请输入分类名称"
v-model="scope.row.classificationName" v-model="scope.row.classificationName"
clearable clearable
maxlength="30" maxlength="30"></el-input>
></el-input>
<span v-else>{{ scope.row.classificationName }}</span> <span v-else>{{ scope.row.classificationName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="updateTime1" label="是否引用" align="center" min-width="60"></el-table-column> <el-table-column prop="updateTime1"
<el-table-column label="操作" align="center" min-width="60"> label="是否引用"
align="center"
min-width="60"></el-table-column>
<el-table-column label="操作"
align="center"
min-width="60">
<template slot-scope="scope"> <template slot-scope="scope">
<i v-if="scope.row.edit" class="el-icon-check edit" @click="submitClass(scope.row)"></i> <i v-if="scope.row.edit"
<i v-else class="el-icon-edit edit" @click="editClass(scope.row)"></i> class="el-icon-check edit"
<i class="el-icon-delete del" @click="delClass(scope.row, scope.$index)"></i> @click="submitClass(scope.row)"></i>
<i v-else
class="el-icon-edit edit"
@click="editClass(scope.row)"></i>
<i class="el-icon-delete del"
@click="delClass(scope.row, scope.$index)"></i>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -114,6 +150,112 @@
<el-button @click="closeClass">返回</el-button> <el-button @click="closeClass">返回</el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="productVisible"
width="1200px"
center
custom-class="product-dia">
<div class="product-wrap">
<div class="item type">
<div class="title-wrap flex-center">
<p class="addhr_tag"></p>
<span>产品分类</span>
</div>
<ul class="types">
<li v-for="(item, i) in productCategories"
:key="i"
:class="{active: curType == item.classificationId}"
@click="typeClick(item)">
{{ item.classificationName }}
</li>
</ul>
</div>
<div class="item products">
<div class="title-wrap flex-center">
<p class="addhr_tag"></p>
<span>产品列表</span>
</div>
<el-input class="mgb10"
placeholder="请输入产品名称"
prefix-icon="el-icon-search"
v-model.trim="keyword"
clearable></el-input>
<el-table :data="products"
class="table"
ref="table"
stripe
header-align="center"
max-height="470"
@selection-change="handleSelectionChange"
row-key="mallId">
<el-table-column type="selection"
width="55"
align="center"
:reserve-selection="true"></el-table-column>
<el-table-column type="index"
width="55"
label="序号"
align="center"></el-table-column>
<el-table-column prop="productName"
label="产品名称"
align="center"></el-table-column>
<el-table-column prop="supplierName"
label="厂商"
align="center"></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>
</div>
</div>
<div class="item checked">
<div class="title-wrap flex-center">
<p class="addhr_tag"></p>
<span>已选择产品{{ checkeds.length }}</span>
</div>
<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="productName"
label="产品名称"
align="center"></el-table-column>
<el-table-column prop="supplierName"
label="厂商"
align="center"></el-table-column>
<el-table-column prop="typeName"
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="delProduct(scope.$index, scope.row)"></i>
</template>
</el-table-column>
</el-table>
</div>
</div>
<span slot="footer"
class="dialog-footer">
<el-button @click="productVisible = false"> </el-button>
<el-button type="primary"
@click="productSubmit"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
@ -124,7 +266,7 @@ import editorConfig from '@/utils/editor'
import Cropper from '@/components/img-upload/Cropper' import Cropper from '@/components/img-upload/Cropper'
import Axios from 'axios' import Axios from 'axios'
export default { export default {
data() { data () {
return { return {
headers: { headers: {
token: sessionStorage.getItem('token') token: sessionStorage.getItem('token')
@ -134,7 +276,7 @@ export default {
id: this.$route.query.id || '', id: this.$route.query.id || '',
applicableMajor: '', applicableMajor: '',
classificationId: '', classificationId: '',
product: '', productList: [],
fileName: '', fileName: '',
schemeFile: '', schemeFile: '',
title: '', title: '',
@ -173,7 +315,19 @@ export default {
classifications: [], classifications: [],
classVisible: false, classVisible: false,
labels: [], labels: [],
labelVisible: false labelVisible: false,
productVisible: false,
productCategories: [],
curType: 1,
checkeds: [],
total: 0,
page: 1,
pageSize: 10,
products: [],
multipleSelection: [],
keyword: '',
loading: false,
}; };
}, },
components: { components: {
@ -183,14 +337,20 @@ export default {
watch: { watch: {
// , // ,
form: { form: {
handler(val){ handler (val) {
this.updateTime++ this.updateTime++
}, },
deep:true deep: true
},
keyword: function (val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(() => {
this.initData();
}, 500);
} }
}, },
// //
beforeRouteLeave(to, from, next) { beforeRouteLeave (to, from, next) {
if (this.submiting) { if (this.submiting) {
next() next()
} else if (!this.pass) { } else if (!this.pass) {
@ -210,21 +370,22 @@ export default {
next() next()
} }
}, },
mounted() { mounted () {
this.getArticle() this.getArticle()
}, },
methods: { methods: {
// //
getArticle() { getArticle () {
const { id } = this.form const { id } = this.form
id ? this.$post(`${this.api.findByIdScheme}?id=${id}`).then(({ data }) => { id ? this.$post(`${this.api.findByIdScheme}?id=${id}`).then(({ data }) => {
if (data.schemeFile) this.fileList = [{name: data.fileName, url: data.schemeFile}] if (data.schemeFile) this.fileList = [{ name: data.fileName, url: data.schemeFile }]
if (!data.productList) data.productList = []
this.form = data this.form = data
this.getClassification(1) this.getClassification(1)
}).catch(err => {}) : this.getClassification(1) }).catch(err => { }) : this.getClassification(1)
}, },
// //
getClassification(detail) { getClassification (detail) {
this.$post(`${this.api.queryClassificationByType}?typeId=3`).then(({ data }) => { this.$post(`${this.api.queryClassificationByType}?typeId=3`).then(({ data }) => {
this.classifications = data this.classifications = data
// id // id
@ -235,14 +396,14 @@ export default {
this.updateTime = 0 this.updateTime = 0
}) })
} }
}).catch(err => {}) }).catch(err => { })
}, },
// //
setClass() { setClass () {
this.classVisible = true this.classVisible = true
}, },
// //
addClass() { addClass () {
this.classifications.push({ this.classifications.push({
edit: true, edit: true,
id: '', id: '',
@ -250,11 +411,11 @@ export default {
}) })
}, },
// //
editClass(row) { editClass (row) {
this.$set(row, 'edit', 1) this.$set(row, 'edit', 1)
}, },
// //
delClass(row, i) { delClass (row, i) {
if (row.id) { if (row.id) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
@ -262,14 +423,14 @@ export default {
this.$post(`${this.api.batchDeletionParnerClass}?ids=${row.id}`).then(res => { this.$post(`${this.api.batchDeletionParnerClass}?ids=${row.id}`).then(res => {
Util.successMsg('删除成功') Util.successMsg('删除成功')
this.getClassification() this.getClassification()
}).catch(res => {}) }).catch(res => { })
}).catch(() => {}) }).catch(() => { })
} else { } else {
this.classifications.splice(i, 1) this.classifications.splice(i, 1)
} }
}, },
// //
submitClass(row, showMsg = 1) { submitClass (row, showMsg = 1) {
if (!row.classificationName) return Util.errorMsg('请输入分类名称') if (!row.classificationName) return Util.errorMsg('请输入分类名称')
this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=1&classificationId=${row.id}`).then(res => { this.$post(`${this.api.checkForHeavyParnerClass}?classificationName=${row.classificationName}&typeId=1&classificationId=${row.id}`).then(res => {
this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], { this.$post(this.api[row.id ? 'updateParnerClass' : 'saveParnerClass'], {
@ -279,11 +440,11 @@ export default {
}).then(res => { }).then(res => {
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功') showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功')
this.getClassification() this.getClassification()
}).catch(res => {}) }).catch(res => { })
}).catch(res => {}) }).catch(res => { })
}, },
// //
closeClass() { closeClass () {
const list = this.classifications const list = this.classifications
if (list.find(e => e.edit && e.classificationName)) { if (list.find(e => e.edit && e.classificationName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', { this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
@ -303,23 +464,108 @@ export default {
if (!list.find(e => e.id == this.form.classificationId)) this.form.classificationId = '' if (!list.find(e => e.id == this.form.classificationId)) this.form.classificationId = ''
}, },
//
showProduct () {
// this.multipleSelection = this.form.productList
this.getCategory()
this.checkeds = []
// debugger
this.productVisible = true
this.page = 1
this.getProduct(1)
},
//
async getCategory () {
const res = await this.$get(this.api.productCategoryList)
this.productCategories = res.classificationList
},
//
typeClick (item) {
// this.$refs.table.clearSelection()
this.curType = item.classificationId
console.log("🚀 ~ file: schemeSet.vue:472 ~ typeClick ~ curType:", this.checkeds)
this.initData()
},
//
async getProduct (set) {
const { page } = await this.$post(this.api.listOfGoods, {
pageNum: this.page,
pageSize: this.pageSize,
productClassification: this.curType,
hotTag: 1,
sort: 0,
isShelves: 0,
productName: this.keyword
})
this.products = page.records
this.total = page.total
if (set) {
const { table } = this.$refs
table.clearSelection()
this.form.productList.forEach(e => {
table.toggleRowSelection(e, true)
})
}
},
initData () {
this.page = 1
this.getProduct()
},
handleCurrentChange (val) {
this.page = val;
this.getData();
},
handleSelectionChange (val) {
console.log("🚀 ~ file: schemeSet.vue:516 ~ handleSelectionChange ~ val:", val)
this.checkeds = JSON.parse(JSON.stringify(val))
this.multipleSelection = val
},
//
delProduct (i, row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.checkeds.splice(i, 1)
}).catch(() => { })
},
//
productSubmit () {
const result = []
this.checkeds.map(e => {
result.push({
mallId: e.mallId,
productName: e.productName,
schemeId: this.form.id
})
})
this.form.productList = result
this.productVisible = false
},
//
delCheckedProduct (i) {
this.form.productList.splice(i, 1)
},
// //
fileBeforeUpload(file) { fileBeforeUpload (file) {
this.uploading++ this.uploading++
}, },
// //
uploadSuccessFile({ filesResult }) { uploadSuccessFile ({ filesResult }) {
this.form.fileName = filesResult.originalFileName this.form.fileName = filesResult.originalFileName
this.form.schemeFile = filesResult.fileUrl this.form.schemeFile = filesResult.fileUrl
}, },
// //
handleExceed(files, fileList) { handleExceed (files, fileList) {
Util.warningMsg( Util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
) )
}, },
// //
back() { back () {
this.pass = true this.pass = true
// //
if (this.updateTime) { if (this.updateTime) {
@ -335,27 +581,27 @@ export default {
} }
}, },
// //
updateFile(files, form, quoteId) { updateFile (files, form, quoteId) {
files.map(e => { files.map(e => {
this.$post(this.api.updateFile, { this.$post(this.api.updateFile, {
id: e, id: e,
isRelease: form.isRelease, isRelease: form.isRelease,
quote: form.title, quote: form.title,
quoteId quoteId
}).then(res => {}).catch(err => {}) }).then(res => { }).catch(err => { })
}) })
}, },
// //
submit(isRelease, next) { submit (isRelease, next) {
if (this.submiting) return false if (this.submiting) return false
const form = JSON.parse(JSON.stringify(this.form)) const form = JSON.parse(JSON.stringify(this.form))
if (!form.title) return Util.errorMsg('请填写标题') if (!form.title) return Util.errorMsg('请填写标题')
// //
if (isRelease) { if (isRelease) {
if (!form.classificationId) return Util.errorMsg('请选择所属分类') if (!form.classificationId) return Util.errorMsg('请选择所属分类')
if (!form.applicableMajor ) return Util.errorMsg('请输入适用专业') if (!form.applicableMajor) return Util.errorMsg('请输入适用专业')
if (!form.schemeIntroduction) return Util.errorMsg('请输入方案简介') if (!form.schemeIntroduction) return Util.errorMsg('请输入方案简介')
if (!form.product) return Util.errorMsg('请输入产品') if (!form.productList.length) return Util.errorMsg('请选择产品')
if (!form.schemeFile) return Util.errorMsg('请上传方案文件') if (!form.schemeFile) return Util.errorMsg('请上传方案文件')
} }
// if (this.uploading) return Util.errorMsg('') // if (this.uploading) return Util.errorMsg('')
@ -383,112 +629,10 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
$upload-width: 220px;
$upload-height: 102px;
$upload-lg-height: 102px;
/deep/ .avatar-uploader {
.el-upload {
position: relative;
width: $upload-width;
height: $upload-height;
border: 1px solid #DCDEE0;
border-radius: 2px;
cursor: pointer;
overflow: hidden;
.uploader-default {
display: flex;
height: $upload-height;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
background: #FAFAFA;
p {
margin-top: 10px;
font-size: 14px;
color: #333;
line-height: 20px;
}
}
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 820px;
height: $upload-lg-height;
.uploader-default {
height: $upload-lg-height;
}
}
}
.avatar {
display: block;
width: $upload-width;
height: $upload-height;
}
.avatar-lg {
display: block;
width: 100%;
height: $upload-lg-height;
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 12px;
color: #333;
}
}
}
.style-wrap {
display: flex;
margin-top: 10px;
.label {
margin-right: 30px;
}
}
.styles {
display: flex;
flex-wrap: wrap;
width: 955px;
// height: 320px;
margin-top: 20px;
overflow: auto;
li {
margin: 0 20px 10px 0;
text-align: center;
cursor: pointer;
&:hover .review {
border-color: #2962FF;
}
}
.review {
display: flex;
justify-content: center;
align-items: center;
width: 170px;
height: 112px;
margin-bottom: 10px;
border: 1px solid #DCDEE0;
border-radius: 2px;
img {
width: 80px;
}
.is-link {
width: 50px;
}
}
}
.info {
position: absolute;
top: 8px;
left: -32px;
cursor: pointer;
}
.plus { .plus {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 18px; font-size: 18px;
color: #9278FF; color: #9278ff;
text-align: right; text-align: right;
cursor: pointer; cursor: pointer;
} }
@ -496,7 +640,8 @@ $upload-lg-height: 102px;
margin-left: 10px !important; margin-left: 10px !important;
} }
.manage-dia { .manage-dia {
.edit, .del { .edit,
.del {
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
} }
@ -524,12 +669,13 @@ $upload-lg-height: 102px;
} }
.line { .line {
margin-bottom: 24px; margin-bottom: 24px;
border-bottom: 1px dashed #C2C2C2; border-bottom: 1px dashed #c2c2c2;
} }
.el-form-item--small.el-form-item { .el-form-item--small.el-form-item {
margin-bottom: 24px; margin-bottom: 24px;
} }
.el-input, .el-select { .el-input,
.el-select {
width: 300px; width: 300px;
} }
.el-select .el-input { .el-select .el-input {
@ -538,16 +684,56 @@ $upload-lg-height: 102px;
.el-textarea { .el-textarea {
width: 550px; width: 550px;
} }
.auto, .auto .el-input { .auto,
.auto .el-input {
width: auto; width: auto;
} }
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before { .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before {
font-size: 18px; font-size: 18px;
vertical-align: -4px; vertical-align: -4px;
color: #F5222D; color: #f5222d;
} }
} }
.btns { .btns {
text-align: center; text-align: center;
} }
.tag {
margin: 0 5px 5px 0;
}
/deep/.product-dia {
.product-wrap {
display: flex;
}
.title-wrap {
margin-bottom: 15px;
}
.item {
width: 130px;
max-height: 600px;
margin-right: 20px;
overflow: hidden;
}
.types {
li {
margin: 10px 0;
cursor: pointer;
&.active {
color: #9278ff;
}
}
}
.products {
width: 400px;
}
.checked {
flex: 1;
.el-table .cell {
font-size: 12px;
}
}
.rm {
font-size: 16px;
cursor: pointer;
}
}
</style> </style>
Loading…
Cancel
Save