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 }) {
// socket
// this.socket = new WebSocket(`ws://${Setting.isDev ? '192.168.31.51' : location.host}:9100/nakadai/websocket/${id}/${account}`)
this.socket = new WebSocket(`ws://121.37.12.51: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}`)
// socket
this.socket.onopen = this.open;
// socket

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

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

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

File diff suppressed because it is too large Load Diff

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

@ -1,112 +1,148 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<el-card shadow="hover"
class="mgb20">
<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>
<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>
</el-card>
<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">
<el-form-item prop="title" label="标题">
<el-input
placeholder="请输入标题"
<el-form-item prop="title"
label="标题">
<el-input placeholder="请输入标题"
v-model.trim="form.title"
clearable
maxlength="30"
class="inline-input"
></el-input>
class="inline-input"></el-input>
</el-form-item>
<el-form-item prop="classificationId" label="所属分类">
<el-select style="width: 234px;" v-model="form.classificationId">
<el-form-item prop="classificationId"
label="所属分类">
<el-select style="width: 234px;"
v-model="form.classificationId">
<template v-for="item in classifications">
<el-option
v-if="item.id"
<el-option v-if="item.id"
:key="item.id"
:label="item.classificationName"
:value="item.id">
</el-option>
</template>
</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>
</div>
<el-form-item prop="applicableMajor" label="适用专业">
<el-input
style="width: 940px"
<el-form-item prop="applicableMajor"
label="适用专业">
<el-input style="width: 940px"
type="textarea"
v-model.trim="form.applicableMajor"
:rows="3"
clearable
></el-input>
clearable></el-input>
</el-form-item>
<el-form-item prop="schemeIntroduction" label="方案简介">
<el-input
style="width: 940px"
<el-form-item prop="schemeIntroduction"
label="方案简介">
<el-input style="width: 940px"
type="textarea"
v-model.trim="form.schemeIntroduction"
:rows="3"
clearable
></el-input>
clearable></el-input>
</el-form-item>
<el-form-item prop="product" label="产品">
<el-input
style="width: 940px"
type="textarea"
v-model.trim="form.product"
:rows="3"
clearable
></el-input>
<el-form-item prop="product"
label="产品">
<el-button style="margin-bottom: 5px"
type="primary"
@click="showProduct">请选择</el-button>
<div>
<el-tag v-for="(tag, i) in form.productList"
:key="i"
class="tag"
closable
@close="delCheckedProduct(i)">
{{tag.productName}}
</el-tag>
</div>
</el-form-item>
<el-form-item prop="schemeFile" label="方案文件">
<el-upload
:before-upload="fileBeforeUpload"
<el-form-item prop="schemeFile"
label="方案文件">
<el-upload :before-upload="fileBeforeUpload"
:on-success="uploadSuccessFile"
:action="this.api.fileUploadNakadai"
:file-list="fileList"
:limit="1"
:on-exceed="handleExceed"
:headers="headers"
>
:headers="headers">
<el-button>上传</el-button>
</el-upload>
</el-form-item>
</el-form>
<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="back">取消</el-button>
</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">
<i class="el-icon-circle-plus-outline" @click="addClass"></i>
<i class="el-icon-circle-plus-outline"
@click="addClass"></i>
</div>
<el-table :data="classifications" ref="table" 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">
<el-table :data="classifications"
ref="table"
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">
<el-input
v-if="scope.row.edit"
<el-input v-if="scope.row.edit"
placeholder="请输入分类名称"
v-model="scope.row.classificationName"
clearable
maxlength="30"
></el-input>
maxlength="30"></el-input>
<span v-else>{{ scope.row.classificationName }}</span>
</template>
</el-table-column>
<el-table-column prop="updateTime1" label="是否引用" align="center" min-width="60"></el-table-column>
<el-table-column label="操作" align="center" min-width="60">
<el-table-column prop="updateTime1"
label="是否引用"
align="center"
min-width="60"></el-table-column>
<el-table-column label="操作"
align="center"
min-width="60">
<template slot-scope="scope">
<i v-if="scope.row.edit" class="el-icon-check edit" @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>
<i v-if="scope.row.edit"
class="el-icon-check edit"
@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>
</el-table-column>
</el-table>
@ -114,6 +150,112 @@
<el-button @click="closeClass">返回</el-button>
</span>
</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>
</template>
<script>
@ -124,7 +266,7 @@ import editorConfig from '@/utils/editor'
import Cropper from '@/components/img-upload/Cropper'
import Axios from 'axios'
export default {
data() {
data () {
return {
headers: {
token: sessionStorage.getItem('token')
@ -134,7 +276,7 @@ export default {
id: this.$route.query.id || '',
applicableMajor: '',
classificationId: '',
product: '',
productList: [],
fileName: '',
schemeFile: '',
title: '',
@ -173,7 +315,19 @@ export default {
classifications: [],
classVisible: false,
labels: [],
labelVisible: false
labelVisible: false,
productVisible: false,
productCategories: [],
curType: 1,
checkeds: [],
total: 0,
page: 1,
pageSize: 10,
products: [],
multipleSelection: [],
keyword: '',
loading: false,
};
},
components: {
@ -183,14 +337,20 @@ export default {
watch: {
// ,
form: {
handler(val){
handler (val) {
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) {
next()
} else if (!this.pass) {
@ -210,21 +370,22 @@ export default {
next()
}
},
mounted() {
mounted () {
this.getArticle()
},
methods: {
//
getArticle() {
getArticle () {
const { id } = this.form
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.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.classifications = data
// id
@ -235,14 +396,14 @@ export default {
this.updateTime = 0
})
}
}).catch(err => {})
}).catch(err => { })
},
//
setClass() {
setClass () {
this.classVisible = true
},
//
addClass() {
addClass () {
this.classifications.push({
edit: true,
id: '',
@ -250,11 +411,11 @@ export default {
})
},
//
editClass(row) {
editClass (row) {
this.$set(row, 'edit', 1)
},
//
delClass(row, i) {
delClass (row, i) {
if (row.id) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
@ -262,14 +423,14 @@ export default {
this.$post(`${this.api.batchDeletionParnerClass}?ids=${row.id}`).then(res => {
Util.successMsg('删除成功')
this.getClassification()
}).catch(res => {})
}).catch(() => {})
}).catch(res => { })
}).catch(() => { })
} else {
this.classifications.splice(i, 1)
}
},
//
submitClass(row, showMsg = 1) {
submitClass (row, showMsg = 1) {
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[row.id ? 'updateParnerClass' : 'saveParnerClass'], {
@ -279,11 +440,11 @@ export default {
}).then(res => {
showMsg && Util.successMsg((row.id ? '修改' : '新增') + '成功')
this.getClassification()
}).catch(res => {})
}).catch(res => {})
}).catch(res => { })
}).catch(res => { })
},
//
closeClass() {
closeClass () {
const list = this.classifications
if (list.find(e => e.edit && e.classificationName)) {
this.$confirm('所填写内容暂未保存,是否保存?', '提示', {
@ -303,23 +464,108 @@ export default {
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++
},
//
uploadSuccessFile({ filesResult }) {
uploadSuccessFile ({ filesResult }) {
this.form.fileName = filesResult.originalFileName
this.form.schemeFile = filesResult.fileUrl
},
//
handleExceed(files, fileList) {
handleExceed (files, fileList) {
Util.warningMsg(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
)
},
//
back() {
back () {
this.pass = true
//
if (this.updateTime) {
@ -335,27 +581,27 @@ export default {
}
},
//
updateFile(files, form, quoteId) {
updateFile (files, form, quoteId) {
files.map(e => {
this.$post(this.api.updateFile, {
id: e,
isRelease: form.isRelease,
quote: form.title,
quoteId
}).then(res => {}).catch(err => {})
}).then(res => { }).catch(err => { })
})
},
//
submit(isRelease, next) {
submit (isRelease, next) {
if (this.submiting) return false
const form = JSON.parse(JSON.stringify(this.form))
if (!form.title) return Util.errorMsg('请填写标题')
//
if (isRelease) {
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.product) return Util.errorMsg('请输入产品')
if (!form.productList.length) return Util.errorMsg('请选择产品')
if (!form.schemeFile) return Util.errorMsg('请上传方案文件')
}
// if (this.uploading) return Util.errorMsg('')
@ -383,112 +629,10 @@ export default {
</script>
<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 {
margin-bottom: 10px;
font-size: 18px;
color: #9278FF;
color: #9278ff;
text-align: right;
cursor: pointer;
}
@ -496,7 +640,8 @@ $upload-lg-height: 102px;
margin-left: 10px !important;
}
.manage-dia {
.edit, .del {
.edit,
.del {
font-size: 14px;
cursor: pointer;
}
@ -524,12 +669,13 @@ $upload-lg-height: 102px;
}
.line {
margin-bottom: 24px;
border-bottom: 1px dashed #C2C2C2;
border-bottom: 1px dashed #c2c2c2;
}
.el-form-item--small.el-form-item {
margin-bottom: 24px;
}
.el-input, .el-select {
.el-input,
.el-select {
width: 300px;
}
.el-select .el-input {
@ -538,16 +684,56 @@ $upload-lg-height: 102px;
.el-textarea {
width: 550px;
}
.auto, .auto .el-input {
.auto,
.auto .el-input {
width: auto;
}
.el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label:before {
font-size: 18px;
vertical-align: -4px;
color: #F5222D;
color: #f5222d;
}
}
.btns {
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>
Loading…
Cancel
Save