中台订单--70%

dev
e 3 years ago
parent 9dde30cceb
commit b26d59d32b
  1. 548
      src/views/order/AddOrder.vue
  2. 2
      src/views/order/Order.vue
  3. 19
      src/views/order/selectClient.vue

@ -1,5 +1,5 @@
<template> <template>
<div> <div v-loading="loading">
<!-- 订单详情 --> <!-- 订单详情 -->
<div v-show="!showSelectClient"> <div v-show="!showSelectClient">
<el-row :gutter="20"> <el-row :gutter="20">
@ -11,7 +11,7 @@
<span class="per_back">返回</span> <span class="per_back">返回</span>
<span class="per_school">订单处理</span> <span class="per_school">订单处理</span>
</div> </div>
<el-button type="primary" size="small" round class="mag" v-preventReClick @click="saveOrder('form')">确定</el-button> <el-button type="primary" size="small" round class="mag" v-preventReClick @click="addOrder">确定</el-button>
</div> </div>
</el-card> </el-card>
@ -22,17 +22,18 @@
<span>基本信息</span> <span>基本信息</span>
</div> </div>
<div> <div>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-col :span="6" :offset="5"> <el-col :span="6" :offset="5">
<el-form-item label="订单编号"> <el-form-item label="订单编号">
<el-input v-model="form.orderNumber" disabled placeholder="自动生成"></el-input> <el-input v-model="form.orderNumber" disabled placeholder="自动生成"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="订单时间" prop="createTime" required> <el-form-item label="订单时间" prop="createTime" >
<el-date-picker <el-date-picker
disabled
style="width:100%" style="width:100%"
v-model="form.createTime" v-model="form.createTime"
type="date" type="date"
placeholder="选择日期"> placeholder="自动生成">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="省份"> <el-form-item label="省份">
@ -40,21 +41,21 @@
<el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option> <el-option v-for="(item,index) in provinceList" :key="index" :label="item.provinceName" :value="item.provinceId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="联系人" prop="orderContact" required> <el-form-item label="联系人" prop="orderContact" >
<el-input v-model="form.orderContact" placeholder="请输入联系人姓名"></el-input> <el-input v-model="form.orderContact" placeholder="请输入联系人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="邮箱" required> <el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" placeholder="请输入邮箱地址"></el-input> <el-input v-model="form.email" placeholder="请输入邮箱地址"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" :offset="2"> <el-col :span="6" :offset="2">
<el-form-item prop="customerName" label="订单客户" required> <el-form-item prop="customerName" label="订单客户">
<div @click="gotoClient" style="cursor: pointer"> <div @click="gotoClient" style="cursor: pointer">
<el-input v-model="form.customerName" clearable placeholder="请选择客户"></el-input> <el-input v-model="form.customerName" placeholder="请选择客户"></el-input>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item prop="orderType" label="订单类型" required> <el-form-item prop="orderType" label="订单类型">
<el-select v-model="form.orderType" clearable placeholder="请选择订单类型"> <el-select v-model="form.orderType" clearable placeholder="请选择订单类型">
<el-option v-for="(item,index) in orderTypeList" :key="index" :label="item.name" :value="item.value"></el-option> <el-option v-for="(item,index) in orderTypeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select> </el-select>
@ -69,18 +70,18 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="电话" prop="phone" required> <el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话号码" maxlength="11"></el-input> <el-input v-model="form.phone" placeholder="请输入电话号码" maxlength="11"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="订单金额" prop="orderAmount"> <el-form-item label="订单金额(万)" prop="orderAmount">
<el-input type="number" v-model="form.orderAmount" placeholder="请输入订单金额"></el-input> <el-input disabled oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" type="number" v-model="form.orderAmount" placeholder="请输入订单金额"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-form> </el-form>
</div> </div>
</div> </div>
</el-card> </el-card>
<!-- 课程 -->
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
<div> <div>
<div class="flex-between mgb20 user_header"> <div class="flex-between mgb20 user_header">
@ -94,12 +95,12 @@
<el-table :data="jurisdictionData" class="orderTable" stripe header-align="center" show-summary :summary-method="getSummaries"> <el-table :data="jurisdictionData" class="orderTable" stripe header-align="center" show-summary :summary-method="getSummaries">
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="courseName" label="课程名称" align="center"> <el-table-column prop="productName" label="课程名称" align="center">
</el-table-column> </el-table-column>
<el-table-column label="使用期限" align="center" width="200"> <el-table-column label="使用期限" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="course-input"> <div class="course-input">
<el-input @change="deadLine($event,scope.row)" maxlength="10" oninput="value=value.replace(/[^0-9.]/g,'')" v-model="scope.row.date" placeholder="输入时间"></el-input> <el-input @change="deadLine($event,scope.row)" maxlength="4" oninput="value=value.replace(/[^0-9.]/g,'')" v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input>
<span></span> <span></span>
</div> </div>
</template> </template>
@ -108,14 +109,14 @@
<template slot-scope="scope"> <template slot-scope="scope">
<p v-if="!scope.row.startDate">请输入使用期限且确认发货</p> <p v-if="!scope.row.startDate">请输入使用期限且确认发货</p>
<div v-else style="display:flex;justify-content:center;"> <div v-else style="display:flex;justify-content:center;">
<p>{{scope.row.startDate}}</p><span>&nbsp;&nbsp;-&nbsp;&nbsp;</span><p>{{scope.row.endDate}}</p> <p>{{scope.row.startTime}}</p><span>&nbsp;&nbsp;-&nbsp;&nbsp;</span><p>{{scope.row.endTime}}</p>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="剩余期限" align="center"> <el-table-column label="剩余期限" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
<el-input v-model="scope.row.transactionPrice" placeholder="请输入"type="text"></el-input> <el-input v-model="scope.row.remainingPeriod" placeholder="请输入"type="text"></el-input>
<span></span> <span></span>
</div> </div>
</template> </template>
@ -123,7 +124,7 @@
<el-table-column label="市场价" align="center"> <el-table-column label="市场价" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
<el-input v-model="scope.row.transactionPrice" placeholder="请输入"type="text"></el-input> <el-input v-model="scope.row.marketValue" placeholder="请输入"type="text"></el-input>
<span></span> <span></span>
</div> </div>
</template> </template>
@ -131,7 +132,7 @@
<el-table-column label="成交价 " align="center"> <el-table-column label="成交价 " align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
<el-input v-model="scope.row.transactionPrice" placeholder="请输入"type="text"></el-input> <el-input @change="discount($event,scope.row)" v-model="scope.row.finalPrice" placeholder="请输入"type="text"></el-input>
<span></span> <span></span>
</div> </div>
</template> </template>
@ -139,7 +140,7 @@
<el-table-column label="折扣率 " align="center"> <el-table-column label="折扣率 " align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
<el-input v-model="scope.row.transactionPrice" placeholder="请输入"type="text"></el-input> <el-input v-model="scope.row.discountRate" placeholder="请输入"type="text"></el-input>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -151,17 +152,18 @@
<el-table-column label="发货" align="center"> <el-table-column label="发货" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.consignment" :disabled="scope.row.ship"
v-model="scope.row.ship"
:active-value="1" :active-value="1"
:inactive-value="0" :inactive-value="0"
@change="courseSwitch($event,scope.row)"> @change="formSwitch($event,scope.row)">
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
</el-card> </el-card>
<!-- 数据平台权限 -->
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
<div> <div>
<div class="flex-between mgb20 user_header"> <div class="flex-between mgb20 user_header">
@ -169,34 +171,34 @@
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>数据平台权限</span> <span>数据平台权限</span>
</div> </div>
<el-button type="primary" size="small" round class="mag" @click="getConfig()">添加</el-button> <el-button type="primary" size="small" round class="mag" @click="addDataJurisdiction()">添加</el-button>
</div> </div>
<el-table :data="dataPlatform" class="orderTable" stripe header-align="center" show-summary :summary-method="getSummaries"> <el-table :data="dataPlatform" class="orderTable" stripe header-align="center" show-summary :summary-method="getSummaries">
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="name" label="产品名称" align="center"> <el-table-column prop="productName" label="产品名称" align="center">
</el-table-column> </el-table-column>
<el-table-column label="使用期限" align="center" width="200"> <el-table-column label="使用期限" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="course-input"> <div class="course-input">
<el-input maxlength="10" oninput="value=value.replace(/[^0-9.]/g,'')" v-model="scope.row.date" placeholder="输入时间"></el-input> <el-input maxlength="4" @change="deadLine($event,scope.row)" oninput="value=value.replace(/[^0-9.]/g,'')" v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input>
<span></span> <span></span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="起止日期" align="center" width="200"> <el-table-column label="起止日期" align="center" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<p v-if="!scope.row.startDate">请输入使用期限且确认状态</p> <p v-if="!scope.row.startTime">请输入使用期限</p>
<div v-else style="display:flex;justify-content:center;"> <div v-else style="display:flex;justify-content:center;">
<p>{{scope.row.startDate}}</p><span>&nbsp;&nbsp;-&nbsp;&nbsp;</span><p>{{scope.row.endDate}}</p> <p>{{scope.row.startTime}}</p><span>&nbsp;&nbsp;-&nbsp;&nbsp;</span><p>{{scope.row.endTime}}</p>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="剩余期限" align="center"> <el-table-column label="剩余期限" align="center" width="160px">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
<el-input v-model="scope.row.transactionPrice" placeholder="请输入"type="text"></el-input> <el-input disabled v-model="scope.row.remainingPeriod" placeholder="请输入"type="text"></el-input>
<span></span> <span></span>
</div> </div>
</template> </template>
@ -204,7 +206,7 @@
<el-table-column label="市场价" align="center" width="165"> <el-table-column label="市场价" align="center" width="165">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
<el-input disabled v-model="scope.row.transactionPrice" placeholder="请输入"type="text"></el-input> <el-input disabled v-model="scope.row.marketValue" placeholder="请输入"type="text"></el-input>
<span>&nbsp;/&nbsp;</span> <span>&nbsp;/&nbsp;</span>
</div> </div>
</template> </template>
@ -212,7 +214,7 @@
<el-table-column label="成交价" align="center" width="165"> <el-table-column label="成交价" align="center" width="165">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
<el-input @change="dealComputers($event,scope.row)" v-model="scope.row.bargain" placeholder="请输入"type="text"></el-input> <el-input oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" @change="[dealComputers($event,scope.row),discount($event,scope.row)]" v-model="scope.row.finalPrice" placeholder="请输入"type="text"></el-input>
<span>&nbsp;/&nbsp; </span> <span>&nbsp;/&nbsp; </span>
</div> </div>
</template> </template>
@ -220,14 +222,14 @@
<el-table-column label="折扣率" align="center"> <el-table-column label="折扣率" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
<el-input disabled v-model="scope.row.transactionPrice" placeholder="请输入"type="text"></el-input> <el-input disabled v-model="scope.row.discountRate" placeholder="请输入"type="text"></el-input>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="账号数" align="center"> <el-table-column label="账号数" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
<el-input @change="dealComputers($event,scope.row)" v-model="scope.row.account" placeholder="请输入"type="text"></el-input> <el-input @change="dealComputers($event,scope.row)" v-model="scope.row.accountNum" placeholder="请输入"type="text"></el-input>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -235,7 +237,7 @@
<el-table-column label="总金额(万)" align="center"> <el-table-column label="总金额(万)" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
<el-input oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" v-model="scope.row.gross" placeholder="请输入"type="text"></el-input> <el-input @change="[allAmount($event,scope.row),allAmountChange($event,scope.row)]" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" v-model="scope.row.totalAmount" placeholder="请输入"type="text"></el-input>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -248,10 +250,11 @@
<el-table-column label="状态" align="center"> <el-table-column label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
v-model="scope.row.platformState" :disabled="scope.row.ship"
:active-value="1" v-model="scope.row.ship"
:inactive-value="0" :active-value="true"
@change="platformSwitch($event,scope.row)"> :inactive-value="false"
@change="formSwitch($event,scope.row)">
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
@ -259,7 +262,7 @@
</el-table> </el-table>
</div> </div>
</el-card> </el-card>
<!-- 合同 -->
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
<div> <div>
<div class="flex-center mgb20 user_header"> <div class="flex-center mgb20 user_header">
@ -268,14 +271,14 @@
</div> </div>
<div> <div>
<el-form ref="contractInformation" :model="contractInformation" :rules="rules" label-width="80px" > <el-form ref="contract" :model="contract" :rules="rules" label-width="80px" >
<el-col :span="8" :offset="4"> <el-col :span="8" :offset="4">
<el-form-item label="合同名称"> <el-form-item label="合同名称">
<el-input v-model="contractInformation.contractInformationName" placeholder="请输入合同名称"></el-input> <el-input v-model="contract.contractName" placeholder="请输入合同名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="合同金额" prop="contractInformationSum"> <el-form-item label="合同金额" prop="contractInformationSum">
<el-input v-model="contractInformation.contractInformationSum" <el-input v-model="contract.contractMoney"
placeholder="请输入合同金额"></el-input> placeholder="请输入合同金额"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -283,15 +286,25 @@
<el-col :span="8" :offset="2"> <el-col :span="8" :offset="2">
<el-form-item label="合同编号"> <el-form-item label="合同编号">
<el-input v-model="contractInformation.contractInformationNumber" placeholder="请输入合同编号"></el-input> <el-input v-model="contract.contractNumber" placeholder="请输入合同编号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="合同编号"> <el-form-item label="合同期限">
<el-input v-model="contractInformation.contractInformationNumber" placeholder="请输入合同编号"></el-input> <div class="contractDate">
<el-date-picker
v-model="contractTime"
style="wifth:100%"
type="daterange"
value-format="yyyy-MM-dd"
@change="contractTimeChange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4" :offset="4" class="flex-start"> <el-col :span="24" :offset="4" class="flex-start">
<el-form-item label="上传合同"> <el-form-item label="上传合同">
<el-upload <el-upload
class="contract" class="contract"
@ -302,15 +315,15 @@
:before-remove="beforeRemove" :before-remove="beforeRemove"
:limit="1" :limit="1"
:on-exceed="handleExceed" :on-exceed="handleExceed"
:action="api.uploadFiles" :action="api.upload"
:file-list="uploadList" :file-list="uploadList"
> >
<el-button size="medium" type="plain" class="uploadTitle">上传</el-button> <el-button size="medium" type="plain" class="uploadTitle">上传</el-button>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item> <!-- <el-form-item>
<el-button size="medium" type="plain" style="height:40px" @click="downLoad()">重新上传</el-button> <el-button size="medium" type="plain" style="height:40px">重新上传</el-button>
</el-form-item> </el-form-item> -->
</el-col> </el-col>
</el-form> </el-form>
</div> </div>
@ -364,27 +377,26 @@
<span>数据产品列表</span> <span>数据产品列表</span>
</div> </div>
<div> <div>
<el-input placeholder="请输入课程名称" prefix-icon="el-icon-search" v-model="configSearch" @keyup.enter.native="onSearch" clearable></el-input> <el-input placeholder="请输入产品名称" prefix-icon="el-icon-search" v-model="productName" @keyup.enter.native="addDataJurisdiction('search')" clearable></el-input>
</div> </div>
</div> </div>
<el-table :data="permissionData" stripe header-align="center" @selection-change="handleSelectionChange" :row-key="getRowKeys"> <el-table :data="boxDataPlatform" stripe header-align="center" @selection-change="boxDataPlatformSelection" :row-key="getRowKeys">
<el-table-column type="selection" width="55" align="center"></el-table-column> <el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
</el-table-column> <el-table-column prop="productName" label="产品名称" align="center"></el-table-column>
<el-table-column prop="courseName" label="课程名称" align="center"> <el-table-column prop="tableNum" label="数据量(表)" align="center"></el-table-column>
</el-table-column> <el-table-column prop="userName" label="创建人" align="center"></el-table-column>
<el-table-column prop="courseType" label="课程类型" align="center"> <el-table-column prop="orderNum" label="订单数量" align="center"></el-table-column>
</el-table-column> <el-table-column prop="market" label="市场价" align="center"></el-table-column>
<el-table-column label="配置的实训应用" align="center"> <el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<!-- <el-table-column prop="orderNature" label="状态" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="ellipsis">{{scope.row.systemName}}</span> <p>{{scope.row.status ? '上架' : '下架'}}</p>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column prop="courseHours" label="预计课时" align="center">
</el-table-column>
</el-table> </el-table>
<div class="pagination"> <div class="pagination">
<el-pagination background layout="total, prev, pager, next" :total="totals" @current-change="handleCurrentChange" :current-page="pageNo"> <el-pagination background layout="total, prev, pager, next" :total="platfromTotals" @current-change="platfromCurrentChange" :current-page="pageNo">
</el-pagination> </el-pagination>
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -445,7 +457,7 @@
</el-dialog> </el-dialog>
</div> </div>
<!-- 选择客户 --> <!-- 选择客户 -->
<select-client @back="backToOrder" v-show="showSelectClient"></select-client> <select-client @back="backToOrder" v-show="showSelectClient" :refresh="showSelectClient"></select-client>
</div> </div>
</template> </template>
@ -457,31 +469,38 @@ export default {
}, },
data() { data() {
return { return {
loading:false,//
showSelectClient:false,// showSelectClient:false,//
token: this.$store.state.loginToken,
form: {// form: {//
orderNumber: '', // orderNumber: '',//
orderDate: '', provinceId: '',// id
provinceId: '', orderContact: '',//
orderContact: '',
email: '', email: '',
customerId: '', customerId: '',// id
orderType: '', orderType: '',
cityId: '', cityId: '',
phone: '', phone: '',
orderAmount: '', orderAmount: 0,
orderId: this.$store.state.orderId, // orderId: this.$store.state.orderId,
customerName:'' customerName:'',//
}, },
contractInformation: {// jurisdictionData: [],//
contractInformationName: '', dataPlatform:[],// data
contractInformationNumber: '',
contractInformationSum: '', contract:{ //
contractInformationLink: '', contractName:'', //
contractInformationId: '', contractFile: '', //
orderId: '' contractMoney: '', //
contractNumber: '',//
startTime: '', // -
endTime: '', // -
// orderId: '', // id
}, },
contractTime:[],//
token:'',
orderOther:{// orderOther:{//
}, },
@ -491,28 +510,37 @@ export default {
{ required: true, message: '请输入订单编号', trigger: 'blur' } { required: true, message: '请输入订单编号', trigger: 'blur' }
], ],
customerName: [ customerName: [
{ required: true, message: '请选择订单客户', trigger: 'blur' } { required: true, message: '请选择订单客户', trigger: 'change' }
], ],
orderContact: [ orderContact: [
{ required: true, message: '请输入联系人姓名', trigger: 'blur' } { required: true, message: '请输入联系人姓名', trigger: 'blur' }
], ],
createTime: [
{ required: true, message: '请选择订单时间', trigger: 'change' }
],
orderType: [ orderType: [
{ required: true, message: '请选择订单类型', trigger: 'change' } { required: true, message: '请选择订单类型', trigger: 'change' }
], ],
phone: [ phone: [
{ required: true, message: '请选择客户获取手机号', trigger: 'blur' }, { required: true, message: '请输入手机号', trigger: 'blur' },
{ {
pattern: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/, pattern: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/,
message: '请输入正确的手机号', message: '请输入正确的手机号',
trigger: 'blur' trigger: 'blur'
} }
], ],
email: [
{ required: true, message: '请输入邮箱地址', trigger: 'blur' },
{
pattern: /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
message: '请输入正确的邮箱',
trigger: 'blur'
}
],
orderAmount: [ orderAmount: [
// { pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/, message: ',' } // { pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/, message: ',' }
{ pattern: /(?:^[1-9]([0-9]+)?(?:\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\.[0-9](?:[0-9])?$)/, message: '请输入正确金额格式,可保留两位小数' } { required: true, message: '请输入订单金额', trigger: 'blur' },
// { pattern: /(?:^[1-9]([0-9]+)?(?:\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\.[0-9](?:[0-9])?$)/, message: ',', trigger: 'blur'}
], ],
}, },
orderTypeList: [{ orderTypeList: [{
@ -526,29 +554,7 @@ export default {
provinceList: this.$store.state.provinceList, provinceList: this.$store.state.provinceList,
cityList: [], cityList: [],
schoolList: [], schoolList: [],
jurisdictionData: [
{ name:'1',
date:'',
startDate:'',
endDate:'',
consignment:false,
}
],//
dataPlatform:[
{
name:'1',
date:'',
startDate:'',
endDate:'',
platformState:'',
bargain:'',
account:'',
gross:''
}
],// data
permissionData: [], permissionData: [],
classVisible: false, classVisible: false,
configSearch: '', configSearch: '',
@ -600,11 +606,21 @@ export default {
extranet: '' extranet: ''
}], }],
curArr: '', curArr: '',
test: [] test: [],
//
showPlatform:false,//
platfromTotals:0,//
platfromPage:1,//
boxDataPlatform:[],//
platformSelect:[],//
productName:'',//
}; };
}, },
created(){ created(){
console.log(this.$route.query.watch,'route'); this.token = sessionStorage.getItem('token')
this.getCityData() this.getCityData()
if(this.$route.query.watch){ if(this.$route.query.watch){
this.getDetail(this.$route.query.watch) this.getDetail(this.$route.query.watch)
@ -613,7 +629,7 @@ export default {
this.getDetail(this.$route.query.edit) this.getDetail(this.$route.query.edit)
} }
}, },
mounted() { // mounted() {
// if(this.form.orderId){ // if(this.form.orderId){
// let data = { // let data = {
// orderId: this.form.orderId // orderId: this.form.orderId
@ -641,7 +657,7 @@ export default {
// iconImg.push({'name':'','url': res.message[0].contractInformations[0].contractInformationLink}); // iconImg.push({'name':'','url': res.message[0].contractInformations[0].contractInformationLink});
// this.uploadList = iconImg // this.uploadList = iconImg
// } // }
// this.contractInformation = { // this.contract = {
// contractInformationName: res.message[0].contractInformations[0].contractInformationName, // contractInformationName: res.message[0].contractInformations[0].contractInformationName,
// contractInformationNumber: res.message[0].contractInformations[0].contractInformationNumber, // contractInformationNumber: res.message[0].contractInformations[0].contractInformationNumber,
// contractInformationSum: res.message[0].contractInformations[0].contractInformationSum, // contractInformationSum: res.message[0].contractInformations[0].contractInformationSum,
@ -654,7 +670,7 @@ export default {
// }).catch((res) => { // }).catch((res) => {
// }) // })
// } // }
}, // },
methods: { methods: {
// //
async getDetail(id){ async getDetail(id){
@ -680,10 +696,10 @@ export default {
}) })
}, },
// //
gotoClient(){ gotoClient(){
//
this.showSelectClient = !this.showSelectClient this.showSelectClient = !this.showSelectClient
}, },
// //
backToOrder(val){ backToOrder(val){
@ -702,25 +718,187 @@ export default {
// //
addOrder(){ addOrder(){
let param = { let param = {
contractInformation:{},// contractInformation:this.contract,//
order:{},// order:this.form,//
orderOther:{}// orderOther:[...this.jurisdictionData,...this.dataPlatform.map(e=>e.authority=0)]//
} }
console.log(this.$refs,'refs');
this.$refs['form'].validate((valid) => {
if (valid) {
this.loading = true
this.$post(this.api.orderAdd,param).then(res=>{ this.$post(this.api.orderAdd,param).then(res=>{
console.log(res,'新增订单'); console.log(res,'新增订单');
this.$router.push('/order')
this.loading = false
this.$message.success('添加订单成功!')
}).catch(err=>{
this.loading = false
}) })
} else {
this.$message('请填上必填项!');
return false;
}
})
}, },
// //
addClassJurisdiction(){ addClassJurisdiction(){
this.classVisible = !this.classVisible this.classVisible = !this.classVisible
}, },
// //
addDataJurisdiction(){ addDataJurisdiction(val){
if(val!=='search'){
this.showPlatform = !this.showPlatform
}
let param = {
pageSize:10,
pageNum:this.platfromPage,
status:1,
productName:this.productName
}
this.$post(this.api.listByEntity,param).then(res=>{
console.log(res,'请求成功');
this.boxDataPlatform = res.pageList.records
this.platfromTotals = res.pageList.total
}).catch(err=>{
console.log(err,'请求错误');
})
}, },
// --
boxDataPlatformSelection(val){
this.platformSelect = val
console.log(val,'数据选中',this.platformSelect);
},
// --
addPlatform(){
console.log(this.platformSelect,'this.platformSelect');
if(this.platformSelect.length>0){
let that = this
let fn = function(e){
let obj = {
productName:e.productName,//
periodOfUse:'',// 使
dataOrCourseId:e.id,// id
accountNum:'',//
startTime:'',//
endTime:'', //
remainingPeriod:'',//
marketValue:e.market,//
finalPrice:'',//
discountRate:'',//
totalAmount:'',//
ship:false,//
authority:0,//
}
that.dataPlatform.push(obj)
}
this.platformSelect.map(e=>{//
if(this.dataPlatform.length>0){
// idpush
let find = this.dataPlatform.some(i=>e.id === i.dataOrCourseId)// id
if(!find){
fn(e)
}
}else{
fn(e)
}
})
this.showPlatform = !this.showPlatform
this.platformSelect = []
}else{
return this.$message('请选中数据后再确定!')
}
},
// --
platfromCurrentChange(val) {
this.platfromPage = val;
this.addDataJurisdiction();
},
//
discount(val,row){
if(val){
row.discountRate = Math.floor(val/row.marketValue*100).toFixed(3)+'%'
}
},
//
contractTimeChange(val){
if(val.length>0){
this.contract.startTime = val[0]
this.contract.endTime = val[1]
console.log(this.contract.startTime,this.contract.endTime,'s-e');
}
},
//
allAmount($event,row){
//
let arr = []
this.dataPlatform.map(e=>{
arr.push(+e.totalAmount)
})
this.form.orderAmount = arr.reduce((a,b)=>a+b)
},
// --
allAmountChange(val,row){
if(val){
let all = val*10000
if(row.accountNum){//
row.marketValue = all/row.accountNum
}
if(row.marketValue){
}
}
},
// switch--
formSwitch (e,row) {
this.deadLine(row.periodOfUse,row)
},
// 使
deadLine(e,row){
console.log(row.ship,e,'row.consignment');
if(e==='') {
console.log('進入return');
row.startTime = ''
row.endTime = ''
return
}
function completeDate(value) {
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();
//0
let nowYear = year + char + completeDate(month) + char +completeDate(day);
//
console.log(parseInt(e%12),'取余');
let endYear = +year + parseInt(e/12) + 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));
console.log(Date.parse(endYear),nowYear,date1,date2,days,'剩余期限');
row.remainingPeriod = days
},
//
dealComputers(e,row){
if(row.finalPrice&&row.accountNum){
row.totalAmount = row.finalPrice*row.accountNum/10000;
}
this.allAmount()
},
// //
clearprovince(){ clearprovince(){
@ -781,43 +959,6 @@ export default {
this.form.email = res.message[0].email this.form.email = res.message[0].email
}).catch(res => {}); }).catch(res => {});
}, },
async saveOrder() {
// try {
// await Promise.all([
// this.$refs.form.validate(),
// this.$refs.contractInformation.validate()
// ]);
// if(this.jurisdictionData.length == 0){
// this.$message.error('');
// }else{
// function findCherries(fruit) {
// return fruit.transactionPrice === '';
// }
// if(this.jurisdictionData.find(findCherries)){
// this.$message.error('');
// }else{
// let data = {
// order: this.form,
// coursePermissionss: this.jurisdictionData,
// contractInformation: this.contractInformation
// }
// if(this.form.orderId){
// this.$post(this.api.updateOrder,data).then((res) => {
// this.$message.success('');
// this.goback()
// }).catch((res) => {})
// } else {
// this.$post(this.api.addOrder,data).then((res) => {
// this.$message.success('');
// this.goback()
// }).catch((res) => {})
// }
// }
// }
// } catch (error) {
// return;
// }
},
// // // //
// getConfig(rows){ // getConfig(rows){
@ -866,6 +1007,7 @@ export default {
this.pageNo = val; this.pageNo = val;
this.getConfig(); this.getConfig();
}, },
// //
getPermissions(val){ getPermissions(val){
this.$get(this.api.queryCoursePermissions,val).then(res => { this.$get(this.api.queryCoursePermissions,val).then(res => {
@ -899,15 +1041,15 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
discountChange(row){ // discountChange(row){
let reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/ // let reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/
if(!(reg.test(row.transactionPrice))){ // if(!(reg.test(row.transactionPrice))){
this.$message.error('请输入正确金额格式,可保留两位小数!'); // this.$message.error(',');
row.transactionPrice = '' // row.transactionPrice = ''
}else{ // }else{
row.discount = this.Percentage(row.transactionPrice,row.marketPrice) // row.discount = this.Percentage(row.transactionPrice,row.marketPrice)
} // }
}, // },
getSummaries(param) { getSummaries(param) {
const { columns, data } = param; const { columns, data } = param;
var sums = 0; var sums = 0;
@ -918,16 +1060,18 @@ export default {
return sums; return sums;
}, },
// //
handleExceed(files, fileList) { handleExceed(files, fileList) {
this.$message.warning( this.$message.warning(
`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!` `当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`
); );
}, },
//
uploadSuccess(response, file, fileList) { uploadSuccess(response, file, fileList) {
this.uploadList.push({ name: file.name, url: response.message.fileUrl }); this.contract.contractFile = response.filesResult.fileUrl
this.contractInformation.contractInformationLink = response.message.fileUrl console.log(this.contract,response,'this.contract');
}, },
//
uploadError(err, file, fileList) { uploadError(err, file, fileList) {
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
@ -935,16 +1079,15 @@ export default {
center: true center: true
}); });
}, },
//
beforeRemove(file, fileList) { beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
//
handleRemove(file, fileList) { handleRemove(file, fileList) {
this.contractInformation.contractInformationLink = '' this.contract.contractFile = ''
},
downLoad(){
let downFile = this.contractInformation.contractInformationLink.replace("http://liuwanr.oss-cn-shenzhen.aliyuncs.com/","")
window.open(`${this.api.downloadFiles}?objectName=${downFile}`)
}, },
configure(){ configure(){
this.ipVisible = true this.ipVisible = true
}, },
@ -955,50 +1098,6 @@ export default {
this.$router.go(-1) this.$router.go(-1)
}, },
// switch
courseSwitch(e,row){
this.deadLine(row.date,row)
},
// switch
platformSwitch (e,row) {
this.deadLine(row.date,row)
},
// 使
deadLine(e,row){
console.log(row.consignment,e,'row.consignment');
if(e===''||!row.consignment) {
console.log('進入return');
row.startDate = ''
row.endDate = ''
return
}
function completeDate(value) {
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();
//0
let nowYear = year + char + completeDate(month) + char +completeDate(day);
//
let endYear = +year+parseInt(e/12) + char + completeDate(month+e%12) + char +completeDate(day);
//
row.startDate = nowYear
row.endDate = endYear
this.$forceUpdate();
console.log(endYear,nowYear);
},
//
dealComputers(e,row){
if(row.bargain&&row.account){
row.gross = row.bargain*row.account;
this.$forceUpdate();
console.log(row.gross,'row.gross');
}
},
} }
}; };
</script> </script>
@ -1010,6 +1109,9 @@ export default {
/deep/ .small .el-input__inner{ /deep/ .small .el-input__inner{
width: 70px; width: 70px;
} }
/deep/ .contractDate .el-date-editor--daterange.el-input__inner{
width: 100%;
}
.mag{ .mag{
margin-right: 20px; margin-right: 20px;
} }

@ -83,7 +83,7 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="handle('edit',scope.row)">编辑</el-button> <el-button type="text" @click="handle('edit',scope.row)">修改</el-button>
<el-button type="text" @click="handle('watch',scope.row)">查看</el-button> <el-button type="text" @click="handle('watch',scope.row)">查看</el-button>
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button type="text" @click="handleDelete(scope.row)">删除</el-button>
<!-- <el-button type="text" @click="handleRenew(scope.row)">续费</el-button> --> <!-- <el-button type="text" @click="handleRenew(scope.row)">续费</el-button> -->

@ -108,7 +108,10 @@
<script> <script>
export default { export default {
props:{ props:{
refresh:{
type:Boolean,
default:false
}
}, },
data(){ data(){
return{ return{
@ -136,6 +139,15 @@ export default {
this.getData() this.getData()
this.getProvince() this.getProvince()
}, },
watch:{
refresh:function(val,val2){
if(val){
this.getData()
this.getProvince()
}
}
},
methods:{ methods:{
// //
getData(){ getData(){
@ -183,13 +195,16 @@ export default {
this.cityList = res.list this.cityList = res.list
}).catch(res => {}) }).catch(res => {})
}, },
goback(val){ async goback(val){
if(val){ if(val){
this.$emit('back',{show:true}) this.$emit('back',{show:true})
}else{ }else{
if(!this.checkedName){ if(!this.checkedName){
return this.$message('请选择客户后再确定!') return this.$message('请选择客户后再确定!')
} }
await this.$get(this.api.queryCustomerDetails,{customerId:this.checkedID}).then(res=>{
console.log(res,'当前的res');
})
this.$emit('back',{show:true,id:this.checkedID,name:this.checkedName}) this.$emit('back',{show:true,id:this.checkedID,name:this.checkedName})
} }
}, },

Loading…
Cancel
Save