修改部分样式

dev
e 3 years ago committed by yujialong
commit 7292a868a4
  1. 3
      src/utils/api.js
  2. 120
      src/views/data/Framework.vue
  3. 18
      src/views/data/Introduce.vue
  4. 136
      src/views/data/Product.vue
  5. 36
      src/views/order/AddOrder.vue

@ -1,8 +1,5 @@
let host = 'http://39.108.250.202:9000'
if(process.env.NODE_ENV === 'development'){
host = 'http://192.168.31.216:9000'
}
let host1 = 'http://192.168.31.216:9000'//榕
let host2 = 'http://192.168.31.125:9000'//林
// let host = 'http://192.168.31.137:9000'// 陈赓

@ -9,7 +9,7 @@
<span class="custom-tree-node" slot-scope="{ node, data }">
<span :title="node.label">{{ node.label }}</span>
<span class="actions">
<i v-if="!data.isThird" class="el-icon-circle-plus-outline" @click.stop="addType(node)"></i>
<i v-if="data.level != 3" class="el-icon-circle-plus-outline" @click.stop="addType(node)"></i>
<i class="el-icon-edit" @click.stop="editType(node)"></i>
<i class="el-icon-delete" @click.stop="delType(node)"></i>
</span>
@ -156,19 +156,19 @@ export default {
methods: {
getType(){
this.$post(this.api.getTableByClassification).then(res => {
res.map(n => {
n.id = String(n.id)
n.label = n.categoryName
n.children.map(n => {
// ,
function handleId(data,level = 0){
data.map(n => {
n.id = String(n.id)
n.label = n.categoryName
n.children.map(n => {
n.id = String(n.id)
n.label = n.categoryName
n.isThird = true
})
n.level = level + 1
if(n.children.length){
handleId(n.children,n.level)
}
})
})
}
handleId(res)
this.typeList = res
if(res[0].children.length){
this.categoryId = res[0].children[0].id
@ -177,6 +177,7 @@ export default {
this.categoryId = res[0].id
this.defaultActive = [res[0].id]
}
// id
this.$nextTick(() => {
this.$refs.type.setCurrentKey(res[0].children[0].id)
})
@ -267,6 +268,7 @@ export default {
let data = res.data
data.map(n => {
for(let i in n){
// +0000,,
if(typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n[i]))
}
})
@ -310,6 +312,7 @@ export default {
this.$message.error('请先选择数据')
}
},
//
getMoreTable(list,id){
list.map(n => {
if(n.id == id){
@ -319,82 +322,91 @@ export default {
}
})
},
// ,,id
renderChecked(){
let result = []
let list = this.$refs.typeTree.getCheckedNodes()
list.map((n,i) => {
if(n.tableLen && n.tableLen > n.children.length){
result = [...result,...n.children.map(n => n.id)]
}else{
result.push(n.id)
}
})
this.$refs.typeTree.setCheckedKeys(result)
},
// ,dom,
loadType(e){
clearTimeout(this.typeTimer)
let typeTree = this.$refs.typeTreeWrap
this.typeTimer = setTimeout(() => {
this.typeTreeScrollTop = typeTree.scrollTop - this.typeTreeScrollTop
// ,
if(this.typeTreeScrollTop > 0 && typeTree.clientHeight + typeTree.scrollTop == typeTree.scrollHeight){
this.getMoreTable(this.importTypeList,this.curExpand)
setTimeout(() => {
this.$nextTick(() => {
this.$refs.typeTree.setCheckedKeys(this.defaultTypeChecked)
this.renderChecked()
})
},300)
}
},50)
},
//
getTable(n,isConcat){
this.$post(`${this.api.originalListById}?categoryId=${n.realId}&pageNum=${n.typeTreePage ? n.typeTreePage : 1}&pageSize=${this.typeTreeUnit}`).then(res => {
let list = res.list.records
list.map(n => {
n.label = n.showName
n.id = String(n.id)
// ,
if(this.defaultTypeChecked.includes(n.id)){
n.disabled = true
}
})
// ,
if(isConcat){
n.children = n.children.concat(list)
}else{
n.children = list
n.tableLen = res.list.total
}
// ,+1
n.typeTreePage++
}).catch(res => {})
},
batchImport(){
this.$post(this.api.originalList).then(res => {
res.map(n => {
this.importTypeIndex++
n.realId = n.id
n.id = String(this.importTypeIndex + n.id)
n.label = n.categoryName
n.children.map(n => {
const that = this
function handleId(data){
data.map(n => {
that.importTypeIndex++
n.realId = n.id
this.importTypeIndex++
n.id = String(this.importTypeIndex + n.id)
// idid,,
n.id = String(that.importTypeIndex + n.id)
n.label = n.categoryName
n.children.map(n => {
this.importTypeIndex++
n.realId = n.id
n.id = String(this.importTypeIndex + n.id)
n.label = n.categoryName
n.isThird = true
})
if(n.children.length){
handleId(n.children)
}
})
})
}
handleId(res)
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keyword}&pageNum=1&pageSize=10000&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res1 => {
let list = res1.pageList.records
this.defaultTypeChecked = list.map(n => n.copyId)
res.map((n,i) => {
if(n.children.length){
n.children.map(n => {
if(n.children.length){
n.children.map(n => {
n.typeTreePage = 1
this.getTable(n)
})
}else{
n.typeTreePage = 1
this.getTable(n)
}
})
}else{
n.typeTreePage = 1
this.getTable(n)
}
})
const that = this
function handleId(data){
data.map(n => {
if(n.children.length){
handleId(n.children)
}else{
// 1
n.typeTreePage = 1
that.getTable(n)
}
})
}
handleId(res)
setTimeout(() => {
this.importTypeList = res
},500)
@ -407,6 +419,7 @@ export default {
this.$get(`${this.api.staticPreview}?tableName=${this.tableName}`).then(res => {
let comment = res.comment
let fieldHead = []
// id
comment.map(n => {
n.field != 'id' && n.field != 'operation_time' && fieldHead.push(n)
})
@ -415,6 +428,7 @@ export default {
let data = res.data
data.map(n => {
for(let i in n){
// +0000,,
if(typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n[i]))
}
})
@ -423,42 +437,51 @@ export default {
this.importVisible = true
},
importTypeClick(data){
// ,,
if(data.name){
this.tableName = data.name
this.curId = data.id
this.getFields()
}
},
//
importTypeExpand(obj,node,com){
this.curExpand = obj.id
this.$refs.typeTree.setCheckedKeys(this.defaultTypeChecked)
this.renderChecked()
},
closeImport(){
this.$refs.typeTree.setCheckedKeys([])
this.names = []
this.showNames = []
},
// namesshowNames,
getNames(){
//
let list = this.$refs.typeTree.getCheckedNodes()
return new Promise((resolve,reject) => {
let getLen = 0
list.map(n => {
// tableLen
if(n.tableLen && n.tableLen > n.children.length) getLen++
})
list.map((n,i) => {
if(n.tableLen && n.tableLen > n.children.length){
// pageSize10000,,
this.$post(`${this.api.originalListById}?categoryId=${n.realId}&pageNum=1&pageSize=10000`).then(res => {
let tableList = res.list.records
// 1,-1
getLen--
tableList.map(n => {
// ,
if(!this.defaultTypeChecked.includes(String(n.id))){
this.names.push(n.name)
this.showNames.push(n.showName)
}
})
// 0,resolve
if(!getLen) resolve()
}).catch(res => {})
}else if(n.name && !n.disabled && !this.names.includes(n.name)){
}else if(n.name && !n.disabled && !this.names.includes(n.name)){ // ,,,
this.names.push(n.name)
this.showNames.push(n.showName)
if(!getLen) resolve()
@ -468,6 +491,7 @@ export default {
},
confirmImport(){
if(this.submited) return false
//
if(!this.$refs.typeTree.getCheckedNodes().length) return this.$message.warning('请选择数据')
this.getNames().then(() => {
let names = Array.from(new Set(this.names))

@ -59,19 +59,19 @@ export default {
methods: {
getData(){
this.$post(this.api.getTableByClassification).then(res => {
res.map(n => {
n.id = String(n.id)
n.label = n.categoryName
n.children.map(n => {
function handleId(data){
data.map(n => {
n.id = String(n.id)
n.label = n.categoryName
n.children.map(n => {
n.id = String(n.id)
n.label = n.categoryName
})
if(n.children.length){
handleId(n.children)
}
})
})
}
handleId(res)
this.typeList = res
// id
if(res[0].children.length){
let item = res[0].children[0]
this.categoryId = item.id

@ -208,7 +208,6 @@ export default {
pageSizeConfig: 10,
totalConfig: 0,
listConfigData: [],
listConfigAll: [],
previewVisible: false,
previewHead: [],
previewData: [],
@ -267,6 +266,7 @@ export default {
n.label = n.showName
n.id = String(n.id)
})
// ,
if(isConcat){
n.children = n.children.concat(list)
}else{
@ -276,54 +276,49 @@ export default {
n.typePage++
}).catch(res => {})
},
//
getType(){
this.productVisible = true
this.$post(this.api.getTableByClassification).then(res => {
res.map(n => {
n.originId = n.id
n.id = String(++this.typeIndex)
n.label = n.categoryName
n.children.map(n => {
const that = this
function handleId(data){
data.map(n => {
n.originId = n.id
n.id = String(++this.typeIndex)
n.id = String(++that.typeIndex)
n.label = n.categoryName
n.children.map(n => {
n.originId = n.id
n.id = String(++this.typeIndex)
n.label = n.categoryName
n.isThird = true
})
if(n.children.length){
handleId(n.children)
}
})
})
res.map((n,i) => {
if(n.children.length){
n.children.map(n => {
if(n.children.length){
n.children.map(n => {
n.typePage = 1
this.getTable(n)
})
}else{
n.typePage = 1
this.getTable(n)
}
})
}else{
n.typePage = 1
this.getTable(n)
}
})
}
handleId(res)
//
function getTable(data){
data.map(n => {
if(n.children.length){
getTable(n.children)
}else{
n.typePage = 1
that.getTable(n)
}
})
}
getTable(res)
setTimeout(() => {
this.typeList = res
},500)
this.importVisible = true
}).catch(res => {})
},
//
handleType(data,typeList){
let result = data
if(typeList.length){
typeList.map(e => {
if(result.includes(e.id) && e.children.length){
// ,idid,,,
e.children.every(n => result.includes(n)) || result.splice(result.indexOf(e.id),1)
}
e.children.length && this.handleType(data,e.children)
@ -331,9 +326,11 @@ export default {
}
return result
},
//
typeExpand(obj,node,com){
this.curExpand = obj.id
},
// ,
getMoreTable(list,id){
list.map(n => {
if(n.id == id){
@ -343,33 +340,30 @@ export default {
}
})
},
// ,dom,
loadType(e){
clearTimeout(this.typeTimer)
let typeTree = this.$refs.typeWrap
this.typeTimer = setTimeout(() => {
this.typeScrollTop = typeTree.scrollTop - this.typeScrollTop
// ,
if(this.typeScrollTop > 0 && typeTree.clientHeight + typeTree.scrollTop == typeTree.scrollHeight){
let curExpand = this.curExpand
// ,,curExpand,
if(!curExpand){
let id = this.checkedIds[0]
let list = this.typeList
list.map(n => {
if(n.id == id){
curExpand = n.id
}else if(n.children && n.children.length){
n.children.map(e => {
if(e.id == id){
curExpand = n.id
}else if(e.children && e.children.length){
e.children.map(j => {
if(j.id == id){
curExpand = e.id
}
})
}
})
}
})
function handleId(data,parentId){
data.map(n => {
if(n.id == id){
curExpand = parentId ? parentId : n.id
}else if(n.children && n.children.length){
handleId(n.children,n.id)
}
})
}
handleId(list)
}
this.getMoreTable(this.typeList,curExpand)
setTimeout(() => {
@ -465,24 +459,30 @@ export default {
this.typeList = []
this.tableId = []
},
// tableId,
getIds(){
//
let list = this.$refs.type.getCheckedNodes()
return new Promise((resolve,reject) => {
let getLen = 0
list.map(n => {
// tableLen
if(n.tableLen && n.tableLen > n.children.length) getLen++
})
list.map((n,i) => {
if(n.tableLen && n.tableLen > n.children.length){
// pageSize10000,,
this.$post(`${this.api.getIdQueryTable}?categoryId=${n.originId}&showName=&pageNum=1&pageSize=10000&updateTime=`).then(res => {
let tableList = res.pageList.records
tableList.map(n => {
this.tableId.push(String(n.id))
})
// 1,-1
getLen--
// 0,resolve
if(!getLen) resolve()
}).catch(res => {})
}else if(n.name && !this.tableId.includes(n.id)){
}else if(n.name && !this.tableId.includes(n.id)){ // ,,
this.tableId.push(n.id)
if(!getLen) resolve()
}
@ -552,23 +552,22 @@ export default {
this.getConfigTable()
},
closeConfig(){
//
this.$refs.typeConfig.setCheckedNodes([])
},
//
getConfigType(){
this.$post(this.api.getTableByClassification).then(res => {
res.map(n => {
n.id = String(n.id)
n.label = n.categoryName
n.children.map(n => {
function handleId(data){
data.map(n => {
n.id = String(n.id)
n.label = n.categoryName
n.children.map(n => {
n.id = String(n.id)
n.label = n.categoryName
n.isThird = true
})
if(n.children.length){
handleId(n.children)
}
})
})
}
handleId(res)
this.typeConfigList = res
if(res[0].children.length){
this.categoryId = res[0].children[0].id
@ -578,29 +577,25 @@ export default {
this.getConfigTable()
}).catch(res => {})
},
//
getConfigTable(){
this.$post(`${this.api.getIdQueryTable}?categoryId=${this.categoryId}&showName=${this.keywordConfig}&pageNum=${this.pageConfig}&pageSize=${this.pageSizeConfig}&updateTime=${this.updateTime ? this.updateTime : ''}`).then(res => {
let list = res.pageList.records
list.map(n => {
//
n.updateTime = n.updateTime ? this.formatDate('yyyy-MM-dd hh:mm:ss',new Date(n.updateTime)) : ''
})
this.listConfigAll = list
this.totalConfig = list.length
this.handlePage()
this.listConfigData = list
this.totalConfig = res.pageList.total
}).catch(res => {})
},
handlePage(){
let list = this.listConfigAll
let result = list.slice((this.pageConfig - 1) * this.pageSize,this.pageConfig * this.pageSizeConfig)
this.listConfigData = result
},
initConfigData(){
this.pageConfig = 1
this.getConfigTable()
},
handleCurrentConfigChange(){
handleCurrentConfigChange(val){
this.pageConfig = val
this.handlePage()
this.getConfigTable()
},
previewConfig(row){
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => {
@ -621,6 +616,7 @@ export default {
this.previewVisible = true
}).catch(res => {})
},
// id
getTableId(list){
let checked = this.configChecked
list.map(n => {

@ -181,13 +181,13 @@
<el-table :data="dataPlatform" class="orderTable" stripe header-align="center" :summary-method="getSummaries">
<el-table-column type="index" width="100" label="序号" align="center">
</el-table-column>
<el-table-column prop="productName" label="产品名称" align="center">
<el-table-column prop="productName" label="产品名称" align="center" width="200">
</el-table-column>
<el-table-column label="使用期限" align="center" width="200">
<template slot-scope="scope">
<div class="course-input">
<el-input onkeyup="value=this.value.replace(/\D+/g,'')" :class="!scope.row.periodOfUse&&whetherSubmit?'red':''" :disabled="disabled||editDisabled" maxlength="4" @change="deadLine($event,scope.row),zero($event,scope.row)" oninput="value=value.replace(/[^0-9.]/g,'')" v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input>
<span></span>
<span ></span>
</div>
</template>
</el-table-column>
@ -199,38 +199,39 @@
</div>
</template>
</el-table-column>
<el-table-column label="剩余期限" align="center" width="160px">
<el-table-column label="剩余期限" align="center" width="200">
<template slot-scope="scope">
<div class="small">
<el-input disabled v-model="scope.row.remainingPeriod" placeholder="请输入"type="text"></el-input>
<span></span>
<span style="margin-left:5px"></span>
</div>
</template>
</el-table-column>
<el-table-column label="市场价" align="center" width="185">
<el-table-column label="市场价" align="center" width="200">
<template slot-scope="scope">
<div class="small">
<el-input disabled v-model="scope.row.marketValue" placeholder="请输入"type="text"></el-input>
<span>&nbsp;/&nbsp;</span>
<span style="margin-left:5px">&nbsp;/&nbsp;</span>
</div>
</template>
</el-table-column>
<el-table-column label="成交价" align="center" width="185">
<el-table-column label="成交价" align="center" width="200">
<template slot-scope="scope">
<div class="small">
<el-input :class="!scope.row.finalPrice&&whetherSubmit?'red':''" :disabled="disabled||editDisabled" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" @change="[dealComputers($event,scope.row),calculateDiscount($event,scope.row),userAmount($event,scope.row)]" v-model="scope.row.finalPrice" placeholder="请输入"type="text"></el-input>
<span>&nbsp;/&nbsp; </span>
<span style="margin-left:5px">&nbsp;/&nbsp; </span>
</div>
</template>
</el-table-column>
<el-table-column label="折扣率" align="center" width="140">
<el-table-column label="折扣率" align="center" width="200">
<template slot-scope="scope">
<div class="discountRate">
<!-- <div class="discountRate"> -->
<div class="small">
<el-input disabled v-model="scope.row.discountRate" placeholder=""type="text"></el-input>
</div>
</template>
</el-table-column>
<el-table-column label="账号数" align="center" width="150">
<el-table-column label="账号数" align="center" width="200">
<template slot-scope="scope">
<div class="small">
<el-input :class="!scope.row.accountNum&&whetherSubmit?'red':''" :disabled="disabled||editDisabled" @change="[dealComputers($event,scope.row),dealBargain($event,scope.row),calculateDiscount($event,scope.row)]" v-model="scope.row.accountNum" placeholder="请输入"type="text"></el-input>
@ -238,7 +239,7 @@
</template>
</el-table-column>
<!-- 金额自动计算计算方式账号数*成交价且可以手动修改保留两位小数 -->
<el-table-column label="总金额(元)" align="center" width="180">
<el-table-column label="总金额(元)" align="center" width="200">
<template slot-scope="scope">
<div class="small">
<el-input :class="!scope.row.totalAmount&&whetherSubmit?'red':''" :disabled="disabled||editDisabled" @blur="[allAmount($event,scope.row),allAmountChange($event,scope.row),calculateDiscount($event,scope.row)]" oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" v-model="scope.row.totalAmount" placeholder="请输入"type="text"></el-input>
@ -394,7 +395,7 @@
</el-dialog>
<!-- 添加数据平台权限弹框 -->
<el-dialog :visible.sync="showPlatform" width="50%" center>
<el-dialog :visible.sync="showPlatform" width="50%" center >
<div class="flex-between mgb20">
<div class="flex-center">
<p class="addhr_tag"></p>
@ -404,7 +405,7 @@
<el-input placeholder="请输入产品名称" prefix-icon="el-icon-search" v-model="productName" @keyup.enter.native="addDataJurisdiction('search')" clearable></el-input>
</div>
</div>
<el-table :data="boxDataPlatform" stripe header-align="center" @selection-change="boxDataPlatformSelection" :row-key="getRowKeys">
<el-table v-loading="dataLoading" :data="boxDataPlatform" stripe header-align="center" @selection-change="boxDataPlatformSelection" :row-key="getRowKeys">
<el-table-column type="selection" :selectable="selectable" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="productName" label="产品名称" align="center"></el-table-column>
@ -497,6 +498,7 @@ export default {
disabled:false,//
editDisabled:false,//
renewDisabled:false,//
dataLoading:false,//
whetherSubmit:false,/* 提交否 */
@ -515,7 +517,7 @@ export default {
customerName:'',//
},
jurisdictionData: [],//
dataPlatform:[],// data
dataPlatform:[{}],// data
contract:{ //
contractName:'', //
@ -861,10 +863,14 @@ export default {
status:1,
productName:this.productName
}
this.dataLoading = true
this.$post(this.api.listByEntity,param).then(res=>{
this.boxDataPlatform = res.pageList.records
this.platfromTotals = res.pageList.total
this.dataLoading = false
}).catch(err=>{
this.dataLoading = false
})
},

Loading…
Cancel
Save