修改订单传递使用期限与起止日期修改

dev_2022-03-03
e 3 years ago
parent 504ea3af98
commit 716a131683
  1. 10
      src/setting.js
  2. 1
      src/utils/api.js
  3. 22
      src/views/customer/AddCustomer.vue
  4. 143
      src/views/order/AddOrder.vue
  5. 3
      src/views/serve/Configure.vue
  6. 3
      src/views/serve/projectList.vue

@ -4,7 +4,7 @@
const url = location.host;
const isDev = process.env.NODE_ENV === 'development'; // 开发环境
const isTest = url.includes('39.108.250.202'); //测试服
const isPro = url.includes('huorantech'); //正式服
const isPro = url.includes('124.71.12.62'); //正式服
let jumpPath = "";
let host = "";
@ -12,7 +12,7 @@ if (isDev) {
// jumpPath = "http://www.huorantech.cn/judgmentPoint/";
jumpPath = "http://39.108.250.202/judgmentPoint/";
// jumpPath = "http://192.168.31.254:8087/"; // 本地调试-需要启动本地判分点系统
// host = "http://www.huorantech.cn:9000/";//线上
// host = "http://www.huorantech.cn:9000";//线上
host = "http://39.108.250.202:9000";//测试
// host = 'http://192.168.31.151:9000'// 榕
// host = 'http://192.168.31.125:9000'// 坤
@ -23,8 +23,10 @@ if (isDev) {
host = "http://39.108.250.202:9000";
// host = "http://124.71.12.62:9000";//线上
} else if (isPro) {
jumpPath = "http://www.huorantech.cn/judgmentPoint/";
host = "http://www.huorantech.cn:9000";//线上
jumpPath = "http://124.71.12.62/judgmentPoint/";
host = "http://124.71.12.62:9000";//线上
// jumpPath = "http://www.huorantech.cn/judgmentPoint/";
// host = "http://www.huorantech.cn:9000";//线上
}

@ -2,6 +2,7 @@ import Setting from "@/setting";
let host = Setting.host;
// let uploadURL = "http://www.huorantech.cn:9000";
// let uploadURL = "http://124.71.12.62:9000";
let uploadURL = "http://39.108.250.202:9000";
export default {

@ -97,14 +97,23 @@
</el-table-column>
<el-table-column prop="courseName" label="课程名称" align="center">
</el-table-column>
<el-table-column prop="periodOfUse" label="使用期限(月)" align="center">
<el-table-column label="使用期限" align="center">
<template slot-scope="scope">
{{scope.row.periodOfUse}}&nbsp;&nbsp;
<span v-if='scope.row.options == 0'></span>
<span v-if='scope.row.options == 1'></span>
<span v-if='scope.row.options == 2'></span>
</template>
</el-table-column>
<el-table-column label="起止日期" align="center">
<template slot-scope="scope">
{{scope.row.startTime}}~{{scope.row.endTime}}
</template>
</el-table-column>
<el-table-column prop="remainingPeriod" label="剩余期限(天)" align="center">
<el-table-column label="剩余期限" align="center">
<template slot-scope="scope">
{{scope.row.remainingPeriod}}&nbsp;&nbsp;
</template>
</el-table-column>
<el-table-column label="端口地址" align="center">
<template slot-scope="scope">
@ -130,9 +139,12 @@
<el-table-column type="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="productName" label="产品名称" align="center"></el-table-column>
<el-table-column prop="periodOfUse" label="使用期限(月)" align="center">
<el-table-column prop="periodOfUse" label="使用期限" align="center">
<template slot-scope="scope">
{{scope.row.periodOfUse}}&nbsp;&nbsp;
{{scope.row.periodOfUse}}&nbsp;&nbsp;
<span v-if='scope.row.options == 0'></span>
<span v-if='scope.row.options == 1'></span>
<span v-if='scope.row.options == 2'></span>
</template>
</el-table-column>
<el-table-column prop="usePeriod" label="起止日期" align="center">
@ -140,7 +152,7 @@
{{scope.row.startTime}}&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;{{scope.row.endTime}}
</template>
</el-table-column>
<el-table-column prop="remainingPeriod" label="剩余期限(天)" align="center">
<el-table-column prop="remainingPeriod" label="剩余期限" align="center">
<template slot-scope="scope">
{{scope.row.remainingPeriod}}&nbsp;&nbsp;
</template>

@ -121,17 +121,39 @@
<el-input onkeyup="value=this.value.replace(/\D+/g,'')"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="viewDisabled||editDisabled" maxlength="4"
@change="deadLine($event,scope.row),zero($event,scope.row)"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"
oninput="value=value.replace(/[^0-9.]/g,'')"
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input>
<span style="margin-left:5px"></span>
<span style="margin-left:5px">
<el-select v-model="scope.row.options" :disabled="viewDisabled||editDisabled" placeholder="请选择" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)">
<el-option label="日" :value="0"></el-option>
<el-option label="月" :value="1"></el-option>
<el-option label="年" :value="2"></el-option>
</el-select>
</span>
</div>
</template>
</el-table-column>
<el-table-column label="起止日期" align="center" min-width="100">
<el-table-column label="起止日期" align="center" min-width="150">
<template slot-scope="scope">
<p v-if="!scope.row.startTime">请输入使用期限</p>
<p v-else>{{ scope.row.startTime }} - {{ scope.row.endTime }}</p>
<p v-if="!scope.row.startTime">
<el-date-picker
style="width:130px"
v-model="scope.row.startTime"
type="date" :disabled="viewDisabled||editDisabled"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"
placeholder="请选择使用日期">
</el-date-picker>
</p>
<p v-else>
<el-date-picker
style="width:130px"
v-model="scope.row.startTime"
type="date" :disabled="viewDisabled||editDisabled"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"
placeholder="请选择使用日期">
</el-date-picker>
<span v-if="scope.row.startTime"><span v-if='scope.row.endTime'> - </span>{{ scope.row.endTime }}</span></p>
</template>
</el-table-column>
<el-table-column label="剩余期限" align="center" min-width="80">
@ -236,17 +258,39 @@
<el-input onkeyup="value=this.value.replace(/\D+/g,'')"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="viewDisabled||editDisabled" maxlength="4"
@change="deadLine($event,scope.row),zero($event,scope.row)"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"
oninput="value=value.replace(/[^0-9.]/g,'')"
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input>
<span style="margin-left:5px"></span>
<span style="margin-left:5px">
<el-select v-model="scope.row.options" :disabled="viewDisabled||editDisabled" placeholder="请选择" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)">
<el-option label="日" :value="0"></el-option>
<el-option label="月" :value="1"></el-option>
<el-option label="年" :value="2"></el-option>
</el-select>
</span>
</div>
</template>
</el-table-column>
<el-table-column label="起止日期" align="center" min-width="100">
<template slot-scope="scope">
<p v-if="!scope.row.startTime">请输入使用期限</p>
<p v-else>{{ scope.row.startTime }} - {{ scope.row.endTime }}</p>
<p v-if="!scope.row.startTime">
<el-date-picker
style="width:130px"
v-model="scope.row.startTime"
type="date" :disabled="viewDisabled||editDisabled"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"
placeholder="请选择使用日期">
</el-date-picker>
</p>
<p v-else>
<el-date-picker
style="width:130px"
v-model="scope.row.startTime"
type="date" :disabled="viewDisabled||editDisabled"
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"
placeholder="请选择使用日期">
</el-date-picker>
<span v-if="scope.row.startTime"><span v-if='scope.row.endTime'> - </span>{{ scope.row.endTime }}</span></p>
</template>
</el-table-column>
<el-table-column label="剩余期限" align="center" min-width="80">
@ -599,6 +643,7 @@ export default {
endTime: "" // -
// orderId: '', // id
},
value1:'',
contractTime: [],//
token: "",
orderOther: {//
@ -816,7 +861,8 @@ export default {
cityId: form.cityId,
phone: form.phone,
orderAmount: form.orderAmount,
orderId: form.orderId
orderId: form.orderId,
options: form.options,
};
this.coursePermissions = list.filter(i => i.authority === 1);
this.dataPlatformPermissions = list.filter(i => i.authority === 0);
@ -1002,7 +1048,8 @@ export default {
totalAmount: "",//
isEnable: 1, // 10
ship: 0,// 01
authority: 1 // 01
authority: 1, // 01
options: 0,
};
that.coursePermissions.push(obj);
};
@ -1113,7 +1160,8 @@ export default {
totalAmount: "",//
isEnable: 1, // 10
ship: 0,// 01
authority: 0//
authority: 0,//
options:0,
};
that.dataPlatformPermissions.push(obj);
};
@ -1181,7 +1229,7 @@ export default {
// /-
handleDeliver(e, row) {
if (this.editDisabled) {
this.$post(this.api.ship + "?id=" + `${row.dataOrCourseId}`).then(res => {});
this.$post(this.api.ship,row).then(res => {});
}
},
//
@ -1246,56 +1294,29 @@ export default {
}
},
// 使
deadLine(e, row) {
function completeDate(value) {
if (value == 0) return "12";
return value < 10 ? "0" + value : value;
}
let char = "-";
let nowDate = new Date();
let day = nowDate.getDate();
let month = nowDate.getMonth() + 1;
let year = nowDate.getFullYear();
if (this.renewDisabled || row.renew) {/* 处于续费状态 */
if (!e) return row.endTime = "";
let arr = row.startTime.split("-");
let renewY = arr.shift();/* 年 */
let renewM = arr.shift();/* 月 */
let renewD = arr.shift();/* 日 */
if ((+renewM + (+e)) > 12) {
renewY = +renewY + Math.ceil((+renewM + (+e)) / 12) - 1;
}
let endYear = renewY + char + completeDate((+renewM + (+e)) % 12) + char + renewD;
row.endTime = endYear;
//
let date1 = Date.parse(endYear);
let date2 = Date.parse(row.startTime);
let ms = Math.abs(date1 - date2);
row.remainingPeriod = Math.floor(ms / (24 * 3600 * 1000));
deadLine(e,row,options) {
let optionsData = ''
if(e > 0){
if (options == 1){
optionsData = e*30*24*60*60*1000
}else if(options == 2){
optionsData = e*365*24*60*60*1000
}else{
if (e === "" || (e.substr(0, 1) === "0")) {
row.startTime = "";
row.endTime = "";
return;
}
//0
let nowYear = year + char + completeDate(month) + char + completeDate(day);
//
if ((+month + (+e)) > 12) {
year = +year + Math.ceil((+month + (+e)) / 12) - 1;
}
let endYear = year + char + completeDate((+month + (+e)) % 12) + char + completeDate(day);
//
row.startTime = nowYear;
row.endTime = endYear;
//
let date1 = Date.parse(endYear);
let date2 = Date.parse(nowYear);
let ms = Math.abs(date1 - date2);
let days = Math.floor(ms / (24 * 3600 * 1000));
row.remainingPeriod = days;
optionsData = e*24*60*60*1000
}
}else{
optionsData = 0
}
let time = new Date(row.startTime).getTime();
let endTime = time + optionsData
row.endTime = time + optionsData
var timestamp = endTime;
var dt = new Date(timestamp); //
var date = (dt.getFullYear()) + "-" + (dt.getMonth() + 1) + "-" + (dt.getDate())
row.endTime = date;
let endYear = timestamp - time
let endYears = endYear/1000/60/60/24
row.remainingPeriod = endYears
},
//
clearprovince() {

@ -185,7 +185,8 @@ export default {
this.$router.push("/addconfigure");
},
getIntoProject(row) {
this.$router.push(`/projectList?systemId=${row.systemId}&show=1`)
// console.log()
this.$router.push(`/projectList?systemId=${row.systemId}&show=1&name=${row.systemName}`)
},
getIntoJudgement(row) {
// console.log(`${Setting.jumpPath}#/?systemId=${row.systemId}&token=${this.token}&referrer=${btoa(location.href)}`);

@ -3,7 +3,7 @@
<el-row :gutter="20">
<el-col :span="24">
<el-card v-if="showBack" shadow="hover" class="mgb20">
<el-page-header content="实验项目管理" @back="goBack"></el-page-header>
<el-page-header :content="'实验项目管理 / '+titleName" @back="goBack"></el-page-header>
</el-card>
</el-col>
@ -144,6 +144,7 @@ export default {
return {
showBack: Boolean(this.$route.query.show),
systemId: this.$route.query.systemId,
titleName: this.$route.query.name,
queryData: {
platformId: 3, // :1 :3
founder: 0, // (0: 1:)

Loading…
Cancel
Save