|
@@ -111,7 +111,9 @@
|
|
|
-webkit-box-shadow: -1px 0 0 0 #409EFF;
|
|
|
box-shadow: -1px 0 0 0 #409EFF
|
|
|
}
|
|
|
-
|
|
|
+ .four {
|
|
|
+ margin-left: 16px;
|
|
|
+ }
|
|
|
|
|
|
</style>
|
|
|
<script>
|
|
@@ -262,10 +264,14 @@
|
|
|
<span>[[two.title]]</span>
|
|
|
<div class="button-box"
|
|
|
:style="one.title == '多包信息' ? 'margin-right: 193px' : ''">
|
|
|
- <button v-if="one.title == '多包信息'" class="pass a-button"
|
|
|
+ <button v-if="one.title == '多包信息' && !two.isFour" class="pass a-button"
|
|
|
@click.stop="addThreeChild(two,'2',one)"
|
|
|
style="font-size: 14px;margin: 0;width: auto;float:left;">新增子包中标信息
|
|
|
</button>
|
|
|
+ <button v-if="one.title == '多包信息' && !two.isFour" class="pass a-button"
|
|
|
+ @click.stop="addFourChild(index, one, two)"
|
|
|
+ style="font-size: 14px;margin: 0;width: auto;float:left;">新增子包标的物信息
|
|
|
+ </button>
|
|
|
<button class="pass success" @click.stop="saveDataTwo(two,'1',one)"
|
|
|
style="font-size: 14px;width: auto;float:left;">通过
|
|
|
</button>
|
|
@@ -332,7 +338,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="save-box">
|
|
|
-<!-- <button class="code" @click.stop="showPop = true" style="width:100px">源码</button> -->
|
|
|
+ <!-- <button class="code" @click.stop="showPop = true" style="width:100px">源码</button> -->
|
|
|
<!-- <button class="code" @click.stop="open(1)" style="width:100px">全部验证</button> -->
|
|
|
<button class="code" @click.stop="openHref(1)" style="width:100px">上一条</button>
|
|
|
<button class="code" @click.stop="open(2)" style="width:100px">保存</button>
|
|
@@ -595,6 +601,28 @@
|
|
|
tmp.status = winnerall[i].status
|
|
|
uInputs.push(tmp)
|
|
|
}
|
|
|
+ // 包 标的物信息
|
|
|
+ var plist = packs[k]["purchasinglist"]
|
|
|
+ let pur_content = [];
|
|
|
+ for (i in plist) {
|
|
|
+ var p_inputs = []
|
|
|
+ for (kk in plist[i]) {
|
|
|
+ var tmp = {}
|
|
|
+ tmp.title = plist[i][kk].descript
|
|
|
+ tmp.input = plist[i][kk].value
|
|
|
+ tmp.key = plist[i][kk].key
|
|
|
+ tmp.status = plist[i][kk].status
|
|
|
+ p_inputs.push(tmp)
|
|
|
+ }
|
|
|
+ pur_content.push({
|
|
|
+ title: "子包-标的物信息",
|
|
|
+ show: true,
|
|
|
+ status: '2',
|
|
|
+ uInput: p_inputs,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
var content = {};
|
|
|
content.title = "子包";
|
|
|
content.show = true;
|
|
@@ -602,8 +630,8 @@
|
|
|
content.uInput = uInputs;
|
|
|
content.isnew = pkg_new[k] || false
|
|
|
content.num = packskey[k];
|
|
|
+ content.content = pur_content
|
|
|
p_content[k] = content;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
var pclf = {{ .T.PurchasinglistField }}
|
|
@@ -697,8 +725,8 @@
|
|
|
//wstatus:"-1",
|
|
|
uInput: uInput
|
|
|
//content: c_content
|
|
|
- }]
|
|
|
- }, {
|
|
|
+ }]
|
|
|
+ }, {
|
|
|
title: '标的信息',
|
|
|
show: false,
|
|
|
showCheck: true,
|
|
@@ -707,7 +735,7 @@
|
|
|
checkAllTag: purchasing_all_tag,
|
|
|
status: purchasing_status,
|
|
|
content: pcl_content
|
|
|
- }, {
|
|
|
+ }, {
|
|
|
title: '采购意向信息',
|
|
|
show:false,
|
|
|
showCheck: true,
|
|
@@ -715,7 +743,7 @@
|
|
|
// checkType: {{.T.ck_pkgisext}},
|
|
|
status: purchasing_status,
|
|
|
content: pcl_content_1
|
|
|
- }, {
|
|
|
+ }, {
|
|
|
title: '多包信息',
|
|
|
show:true,
|
|
|
showCheck: true,
|
|
@@ -723,7 +751,7 @@
|
|
|
// checkType: {{.T.ck_pkgisext}},
|
|
|
status: package_status,
|
|
|
content: p_content
|
|
|
- }, {
|
|
|
+ }, {
|
|
|
title: '中标候选人信息',
|
|
|
show: false,
|
|
|
showCheck: true,
|
|
@@ -731,7 +759,7 @@
|
|
|
// checkType: {{.T.ck_wodrisext}},
|
|
|
status: winneroder_status,
|
|
|
content: c_content
|
|
|
- }, {
|
|
|
+ }, {
|
|
|
title: '自定义字段',
|
|
|
show:true,
|
|
|
key: 'extend',
|
|
@@ -742,727 +770,799 @@
|
|
|
delete: false,
|
|
|
//wstatus:"-1",
|
|
|
uInput: otherInput
|
|
|
- }]
|
|
|
- }].filter(group => {
|
|
|
+ }]
|
|
|
+ }].filter(group => {
|
|
|
return canShowGroupsList.includes(group.key)
|
|
|
}),
|
|
|
originData: []},
|
|
|
- watch: {
|
|
|
- //切换标签时更改正文内容
|
|
|
- 'activeLabel':
|
|
|
+ watch: {
|
|
|
+ //切换标签时更改正文内容
|
|
|
+ 'activeLabel':
|
|
|
function () {
|
|
|
this.pageHtml = this.getPageInfo.html
|
|
|
}},
|
|
|
- computed: {
|
|
|
- getPageInfo() {
|
|
|
- var tempData = {
|
|
|
- title: '',
|
|
|
- html: this.pageHtml,
|
|
|
- href: ''
|
|
|
- }
|
|
|
- //匹配原文或者原文附件
|
|
|
- var originData = pageDataMap[this.activeLabel]
|
|
|
- if (originData) {
|
|
|
- tempData.title = originData.title
|
|
|
- tempData.html = originData.html
|
|
|
- tempData.href = originData.href
|
|
|
- } else {//匹配原公告关联信息
|
|
|
- var tempS = this.activeLabel.split('-')
|
|
|
- var isFile = tempS.length === 2
|
|
|
- var otherData = this.otherInfo.filter(v => v.id == tempS[0])
|
|
|
- if (otherData.length > 0) {
|
|
|
- tempData.title = otherData[0].title
|
|
|
- tempData.html = otherData[0].detail
|
|
|
- tempData.href = otherData[0].href
|
|
|
- if (isFile) {
|
|
|
- tempData.title = '附件内容'
|
|
|
- tempData.html = otherData[0].filetext
|
|
|
- tempData.href = ''
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return tempData
|
|
|
+ computed: {
|
|
|
+ getPageInfo() {
|
|
|
+ var tempData = {
|
|
|
+ title: '',
|
|
|
+ html: this.pageHtml,
|
|
|
+ href: ''
|
|
|
}
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- // 缓存原始数据
|
|
|
- this.originData = JSON.parse(JSON.stringify([].concat(this.editData)))
|
|
|
- $('#group-switch-pwd').bootstrapSwitch({
|
|
|
- onText : "是",
|
|
|
- offText : "否",
|
|
|
- onColor : "success",
|
|
|
- offColor : "warning",
|
|
|
- }).bootstrapSwitch('size', 'small').bootstrapSwitch('state', true);
|
|
|
- $("#group-switch-pwd").bootstrapSwitch(
|
|
|
- 'onSwitchChange', function (event, state){
|
|
|
- if (state===true) {
|
|
|
- isEff = true
|
|
|
- }else {
|
|
|
- isEff = false
|
|
|
+ //匹配原文或者原文附件
|
|
|
+ var originData = pageDataMap[this.activeLabel]
|
|
|
+ if (originData) {
|
|
|
+ tempData.title = originData.title
|
|
|
+ tempData.html = originData.html
|
|
|
+ tempData.href = originData.href
|
|
|
+ } else {//匹配原公告关联信息
|
|
|
+ var tempS = this.activeLabel.split('-')
|
|
|
+ var isFile = tempS.length === 2
|
|
|
+ var otherData = this.otherInfo.filter(v => v.id == tempS[0])
|
|
|
+ if (otherData.length > 0) {
|
|
|
+ tempData.title = otherData[0].title
|
|
|
+ tempData.html = otherData[0].detail
|
|
|
+ tempData.href = otherData[0].href
|
|
|
+ if (isFile) {
|
|
|
+ tempData.title = '附件内容'
|
|
|
+ tempData.html = otherData[0].filetext
|
|
|
+ tempData.href = ''
|
|
|
}
|
|
|
}
|
|
|
- )
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // 当前输入框数据与原始数据比较
|
|
|
- focusFn(uin, oIndex, tIndex, uIndex, two, one) {
|
|
|
- if (uin.key === "bidendtime" || uin.key === "bidopentime" || uin.key === "project_startdate" || uin.key === "project_completedate" ||
|
|
|
- uin.key === "publishtime" || uin.key === "signaturedate") {
|
|
|
- var val = uin.input
|
|
|
- if (val !== null && val !== "") {
|
|
|
- var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
|
|
|
- var regExp = new RegExp(reg);
|
|
|
- if (!regExp.test(val)) {
|
|
|
- this.$message({
|
|
|
- message: uin.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
|
|
|
- type: 'warning',
|
|
|
- duration: 2000,
|
|
|
- offset: 300
|
|
|
- });
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- var newNode = this.originData[oIndex].content[tIndex]
|
|
|
- if (newNode == null) {//新增子模块处理
|
|
|
- return
|
|
|
- }
|
|
|
- var oNode = newNode.uInput[uIndex]
|
|
|
- if (oNode == null) {//新增中标人信息处理
|
|
|
- return
|
|
|
- }
|
|
|
- var changeStatus = uin.input === oNode.input//多包中新增的中标信息报错
|
|
|
- if (uin.select) {
|
|
|
- changeStatus = uin.select === oNode.select
|
|
|
- }
|
|
|
- uin.status = changeStatus ? "1" : "2"
|
|
|
- this.setStatus(uin, uin.status, two, one);
|
|
|
- },
|
|
|
- openLink(link) {
|
|
|
- window.open(link, '_blank')
|
|
|
- },
|
|
|
- // 改变基本字段属性
|
|
|
- changeBaseValue(index, input, status) {
|
|
|
- if (this.editData[0].content[0].uInput[index].input !== input) {
|
|
|
- this.editData[0].content[0].uInput[index].input = input
|
|
|
- this.editData[0].content[0].uInput[index].status = status
|
|
|
+ }
|
|
|
+ return tempData
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ // 缓存原始数据
|
|
|
+ this.originData = JSON.parse(JSON.stringify([].concat(this.editData)))
|
|
|
+ this.editData = this.tranEditData(this.editData, false)
|
|
|
+ $('#group-switch-pwd').bootstrapSwitch({
|
|
|
+ onText : "是",
|
|
|
+ offText : "否",
|
|
|
+ onColor : "success",
|
|
|
+ offColor : "warning",
|
|
|
+ }).bootstrapSwitch('size', 'small').bootstrapSwitch('state', true);
|
|
|
+ $("#group-switch-pwd").bootstrapSwitch(
|
|
|
+ 'onSwitchChange', function (event, state){
|
|
|
+ if (state===true) {
|
|
|
+ isEff = true
|
|
|
+ }else {
|
|
|
+ isEff = false
|
|
|
}
|
|
|
- },
|
|
|
- selectChange(uni, status, two, one) {
|
|
|
- //状态更新
|
|
|
- if (uni.status === '-1' || uni.status === '2') {
|
|
|
- status = "2"
|
|
|
- }
|
|
|
- this.setStatus(uni, status, two, one)
|
|
|
- },
|
|
|
- openHref (i) {
|
|
|
- if (i === 1) {
|
|
|
- if (nextid === "") {
|
|
|
- alert("当前数据是第一条数据,没有上一条数据!")
|
|
|
- } else {
|
|
|
- window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+lastid+"&s_sourceinfo="+coll
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (issave) {
|
|
|
- this.openHrefBefore()
|
|
|
- } else {
|
|
|
- this.open(2, () => {
|
|
|
- this.openHrefBefore()
|
|
|
- })
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 当前输入框数据与原始数据比较
|
|
|
+ focusFn(uin, oIndex, tIndex, uIndex, two, one) {
|
|
|
+ if (uin.key === "bidendtime" || uin.key === "bidopentime" || uin.key === "project_startdate" || uin.key === "project_completedate" ||
|
|
|
+ uin.key === "publishtime" || uin.key === "signaturedate") {
|
|
|
+ var val = uin.input
|
|
|
+ if (val !== null && val !== "") {
|
|
|
+ var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
|
|
|
+ var regExp = new RegExp(reg);
|
|
|
+ if (!regExp.test(val)) {
|
|
|
+ this.$message({
|
|
|
+ message: uin.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
|
|
|
+ type: 'warning',
|
|
|
+ duration: 2000,
|
|
|
+ offset: 300
|
|
|
+ });
|
|
|
+ return
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
- openHrefBefore () {
|
|
|
+ }
|
|
|
+ var newNode = this.originData[oIndex].content[tIndex]
|
|
|
+ if (newNode == null) {//新增子模块处理
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var oNode = newNode.uInput[uIndex]
|
|
|
+ if (oNode == null) {//新增中标人信息处理
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var changeStatus = uin.input === oNode.input//多包中新增的中标信息报错
|
|
|
+ if (uin.select) {
|
|
|
+ changeStatus = uin.select === oNode.select
|
|
|
+ }
|
|
|
+ uin.status = changeStatus ? "1" : "2"
|
|
|
+ this.setStatus(uin, uin.status, two, one);
|
|
|
+ },
|
|
|
+ openLink(link) {
|
|
|
+ window.open(link, '_blank')
|
|
|
+ },
|
|
|
+ // 改变基本字段属性
|
|
|
+ changeBaseValue(index, input, status) {
|
|
|
+ if (this.editData[0].content[0].uInput[index].input !== input) {
|
|
|
+ this.editData[0].content[0].uInput[index].input = input
|
|
|
+ this.editData[0].content[0].uInput[index].status = status
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectChange(uni, status, two, one) {
|
|
|
+ //状态更新
|
|
|
+ if (uni.status === '-1' || uni.status === '2') {
|
|
|
+ status = "2"
|
|
|
+ }
|
|
|
+ this.setStatus(uni, status, two, one)
|
|
|
+ },
|
|
|
+ openHref (i) {
|
|
|
+ if (i === 1) {
|
|
|
if (nextid === "") {
|
|
|
- alert("当前已经是最后一条数据!")
|
|
|
+ alert("当前数据是第一条数据,没有上一条数据!")
|
|
|
} else {
|
|
|
- sessionStorage.removeItem(_id + '_save')
|
|
|
- window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+nextid+"&s_sourceinfo="+coll
|
|
|
+ window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+lastid
|
|
|
}
|
|
|
- },
|
|
|
- // 检查一级是否需要改变状态
|
|
|
- checkOneStatus: function (config) {
|
|
|
- var tempObj = {
|
|
|
- obj: config.type ? config.one : config.two
|
|
|
- }
|
|
|
- if (config.type) {
|
|
|
- tempObj.list = config.one.content
|
|
|
+ } else {
|
|
|
+ if (issave) {
|
|
|
+ this.openHrefBefore()
|
|
|
} else {
|
|
|
- tempObj.list = config.two.uInput
|
|
|
+ this.open(2, () => {
|
|
|
+ this.openHrefBefore()
|
|
|
+ })
|
|
|
}
|
|
|
- var statusList = [0, 0, 0, 0, 0]
|
|
|
- for (var i in tempObj.list) {
|
|
|
+ }
|
|
|
+ },
|
|
|
+ openHrefBefore () {
|
|
|
+ if (nextid === "") {
|
|
|
+ alert("当前已经是最后一条数据!")
|
|
|
+ } else {
|
|
|
+ sessionStorage.removeItem(_id + '_save')
|
|
|
+ window.location.href = "/front/user/remark/detail/?pid="+pid+"&tid="+tid+"&did="+nextid
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 检查一级是否需要改变状态
|
|
|
+ checkOneStatus: function (config) {
|
|
|
+ var tempObj = {
|
|
|
+ obj: config.type ? config.one : config.two
|
|
|
+ }
|
|
|
+ if (config.type) {
|
|
|
+ tempObj.list = config.one.content
|
|
|
+ } else {
|
|
|
+ tempObj.list = config.two.uInput
|
|
|
+ }
|
|
|
+ var statusList = [0, 0, 0, 0, 0]
|
|
|
+ for (var i in tempObj.list) {
|
|
|
var tempList = tempObj.list[i]
|
|
|
var tempIndex = Number(tempList.status)
|
|
|
if (tempIndex === -1) {
|
|
|
tempIndex = 0
|
|
|
}
|
|
|
- statusList[tempIndex] = Number(statusList[tempIndex]) + 1
|
|
|
- }
|
|
|
- if (statusList[1] > 0) {
|
|
|
- tempObj.obj.status = "1"
|
|
|
- }
|
|
|
- if (statusList[4] > 0 || statusList[3] > 0 || statusList[2] > 0) {
|
|
|
- tempObj.obj.status = "2"
|
|
|
- }
|
|
|
- if (statusList[4] === tempObj.list.length) {
|
|
|
- tempObj.obj.status = "4"
|
|
|
+ statusList[tempIndex] = Number(statusList[tempIndex]) + 1
|
|
|
+ }
|
|
|
+ if (statusList[1] > 0) {
|
|
|
+ tempObj.obj.status = "1"
|
|
|
+ }
|
|
|
+ if (statusList[4] > 0 || statusList[3] > 0 || statusList[2] > 0) {
|
|
|
+ tempObj.obj.status = "2"
|
|
|
+ }
|
|
|
+ if (statusList[4] === tempObj.list.length) {
|
|
|
+ tempObj.obj.status = "4"
|
|
|
if (tempObj.obj.title === "标的信息" || tempObj.obj.title === "多包信息" || tempObj.obj.title === "中标候选人信息") {
|
|
|
tempObj.obj.status = "2"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (statusList[3] === tempObj.list.length) {
|
|
|
+ tempObj.obj.status = "2"
|
|
|
+ }
|
|
|
+ if (statusList[2] === tempObj.list.length) {
|
|
|
+ tempObj.obj.status = "2"
|
|
|
+ }
|
|
|
+ if (statusList[0] === tempObj.list.length) {
|
|
|
+ tempObj.obj.status = "-1"
|
|
|
+ }
|
|
|
+ if (!config.type) {
|
|
|
+ this.checkOneStatus({
|
|
|
+ one: config.one,
|
|
|
+ two: config.two,
|
|
|
+ type: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //切换状态按钮
|
|
|
+ setStatus:function (witch, s, two, one) {
|
|
|
+ var key = witch.key
|
|
|
+ //校验日期格式
|
|
|
+ if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
|
|
|
+ key === "publishtime" || key === "signaturedate") {
|
|
|
+ var val = witch.input
|
|
|
+ if (val !== null && val !== "") {
|
|
|
+ var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
|
|
|
+ var regExp = new RegExp(reg);
|
|
|
+ if (!regExp.test(val)) {
|
|
|
+ this.$message({
|
|
|
+ message: witch.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
|
|
|
+ type: 'warning',
|
|
|
+ duration: 2000,
|
|
|
+ offset: 300
|
|
|
+ });
|
|
|
+ //alert(witch.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
|
|
|
+ return
|
|
|
}
|
|
|
}
|
|
|
- if (statusList[3] === tempObj.list.length) {
|
|
|
- tempObj.obj.status = "2"
|
|
|
+ }
|
|
|
+ if (s === '2' && !one && !two && witch.content.length === 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ witch.status = s;
|
|
|
+ if (two) {
|
|
|
+ this.checkOneStatus({
|
|
|
+ one: one,
|
|
|
+ two: two,
|
|
|
+ type: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //二级删除
|
|
|
+ delNewTwo: function (one, index, two) {
|
|
|
+ //two.ck_isnew = false //目前点删除按钮页面直接不显示,但是集合索引位置不变,所以加了此代码
|
|
|
+ //two.show = false
|
|
|
+ // if (two.isnew) {
|
|
|
+ one.content.splice(index, 1)
|
|
|
+ // } else {
|
|
|
+ // two.show = false
|
|
|
+ // two.status = "4"
|
|
|
+ // this.saveDataTwo(two, "4", one)
|
|
|
+ // }
|
|
|
+ this.checkOneStatus({
|
|
|
+ one: one,
|
|
|
+ two: two,
|
|
|
+ type: true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /*add style*/
|
|
|
+ addStyle: function (data) {
|
|
|
+ return prettyPrint(data).replace(/(checkAllTag|checkType|showCheck|wstatus|status|key|title|input|content|uInput|selectArr|select|show|true)/g, "<mark>$1</mark>")
|
|
|
+ },
|
|
|
+ /*同步修改源码*/
|
|
|
+ changeText: function (boolean) {
|
|
|
+ try {
|
|
|
+ var tempText = JSON.parse(this.$refs.text.innerText.replace(/(\n|\s)/g, ''))
|
|
|
+ if (boolean) {
|
|
|
+ this.tagvalues = tempText
|
|
|
+ } else {
|
|
|
+ this.editData = tempText
|
|
|
}
|
|
|
- if (statusList[2] === tempObj.list.length) {
|
|
|
- tempObj.obj.status = "2"
|
|
|
+ } catch (err) {
|
|
|
+ alert('源码修改失败')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goText: function (value) {
|
|
|
+ /*重置Html*/
|
|
|
+ this.pageHtml = this.getPageInfo.html
|
|
|
+ if (!value) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ var rs = new RegExp('(' + value + ')', 'gi')
|
|
|
+ //选中input框值文本高亮
|
|
|
+ if (rs.test(this.pageHtml)) {
|
|
|
+ this.pageHtml = this.pageHtml.replace(rs, '<mark>$1</mark>')
|
|
|
+ /*延迟查询dom,防止dom未插入*/
|
|
|
+ var $this = this
|
|
|
+ setTimeout(function () {
|
|
|
+ $this.goMark(value)
|
|
|
+ }, 150)
|
|
|
+ } else {
|
|
|
+ /*重置Html*/
|
|
|
+ this.pageHtml = this.getPageInfo.html
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goMark: function (value) {
|
|
|
+ var mLength = document.querySelectorAll('mark').length
|
|
|
+ if (this.scrollCache.value === value) {
|
|
|
+ this.scrollCache.index = (this.scrollCache.index + 1) % mLength
|
|
|
+ } else {
|
|
|
+ this.scrollCache.index = 0
|
|
|
+ }
|
|
|
+ this.scrollCache.value = value
|
|
|
+ /*滚动到第一个mark*/
|
|
|
+ var temp = document.querySelectorAll('mark')[this.scrollCache.index]
|
|
|
+ $("mark").removeClass('focus')
|
|
|
+ $(temp).addClass('focus')
|
|
|
+ document.querySelector('.article').scrollTop = offset(temp).top - window.screen.height / 2
|
|
|
+ },
|
|
|
+ // markTag:function(n){
|
|
|
+ // $.ajax({
|
|
|
+ // url:"/markTag",
|
|
|
+ // method:"post",
|
|
|
+ // data: {tag:n,_id:_id},
|
|
|
+ // success:function(res){
|
|
|
+ // if(res){
|
|
|
+ // document.getElementById("com-alert-val").innerHtml="标记成功";
|
|
|
+ // var label1 = document.getElementById("com-alert");
|
|
|
+ // label1.style.display="block";
|
|
|
+ // setTimeout(function(){label1.style.display="none";},1000)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ addChild: function (one, oindex) {
|
|
|
+ var tempNode = {}
|
|
|
+ switch (one.title) {
|
|
|
+ case "标的信息": {
|
|
|
+ tempNode = {
|
|
|
+ //content: [],
|
|
|
+ show: true,
|
|
|
+ isnew: true,
|
|
|
+ status: "2",
|
|
|
+ title: "标的物",
|
|
|
+ uInput: JSON.parse(JSON.stringify(pclfInput))
|
|
|
+ }
|
|
|
+ break
|
|
|
}
|
|
|
- if (statusList[0] === tempObj.list.length) {
|
|
|
- tempObj.obj.status = "-1"
|
|
|
+ case "采购意向信息": {
|
|
|
+ tempNode = {
|
|
|
+ //content: [],
|
|
|
+ show: true,
|
|
|
+ isnew: true,
|
|
|
+ status: "2",
|
|
|
+ title: "标的物",
|
|
|
+ uInput: JSON.parse(JSON.stringify(pclfInput1))
|
|
|
+ }
|
|
|
+ break
|
|
|
}
|
|
|
- if (!config.type) {
|
|
|
- this.checkOneStatus({
|
|
|
- one: config.one,
|
|
|
- two: config.two,
|
|
|
- type: true
|
|
|
- })
|
|
|
+ case "多包信息": {
|
|
|
+ tempNode = {
|
|
|
+ //content: [],
|
|
|
+ show: true,
|
|
|
+ status: "2",
|
|
|
+ isnew: true,
|
|
|
+ title: "子包",
|
|
|
+ uInput: JSON.parse(JSON.stringify(pfInput))
|
|
|
+ }
|
|
|
+ break
|
|
|
}
|
|
|
- },
|
|
|
- //切换状态按钮
|
|
|
- setStatus:function (witch, s, two, one) {
|
|
|
- var key = witch.key
|
|
|
- //校验日期格式
|
|
|
+ case "中标候选人信息": {
|
|
|
+ tempNode = {
|
|
|
+ //content: [],
|
|
|
+ show: true,
|
|
|
+ status: "2",
|
|
|
+ isnew: true,
|
|
|
+ title: "候选人",
|
|
|
+ uInput: JSON.parse(JSON.stringify(wodfInput))
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 输入多个
|
|
|
+ var count = prompt('请输入需要新增的个数')
|
|
|
+ // if (one.status >= "2") {
|
|
|
+ // one.status = '2'
|
|
|
+ // }
|
|
|
+ for (let j = 0; j < count; j++) {
|
|
|
+ one.content.push(JSON.parse(JSON.stringify(tempNode)))
|
|
|
+ this.checkOneStatus({
|
|
|
+ one: one,
|
|
|
+ type: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.$nextTick(() => {
|
|
|
+ var tempN = $(".edit.one").eq(oindex).find(".edit-title")
|
|
|
+ var goTop = tempN.eq(tempN.length - 1).offset().top
|
|
|
+ setTimeout(() => {
|
|
|
+ $(".operation").scrollTop($(".operation").scrollTop() + goTop)
|
|
|
+ }, 150)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 新增子包中标信息字段
|
|
|
+ addThreeChild:function (two, n, one) {
|
|
|
+ two.uInput.push({
|
|
|
+ input: "",
|
|
|
+ key: 'winner',
|
|
|
+ status: "2",
|
|
|
+ title: '标段(包)中标单位'
|
|
|
+ })
|
|
|
+ two.uInput.push({
|
|
|
+ input: "",
|
|
|
+ key: 'bidamount',
|
|
|
+ status: "2",
|
|
|
+ title: '标段(包)中标金额'
|
|
|
+ })
|
|
|
+ two.status = "2"
|
|
|
+ this.checkOneStatus({
|
|
|
+ one: one,
|
|
|
+ two: two,
|
|
|
+ type: false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addFourChild: function (index, one, two) {
|
|
|
+ console.log(one, two)
|
|
|
+ var tempNode = {
|
|
|
+ show: true,
|
|
|
+ status: "2",
|
|
|
+ isnew: true,
|
|
|
+ isFour: true,
|
|
|
+ parentId: two.__id,
|
|
|
+ parentIndex: index,
|
|
|
+ title: "子包-标的物信息",
|
|
|
+ uInput: [
|
|
|
+ { input: "", key: "itemname", status: "2", title: "产品名称"},
|
|
|
+ { input: "", key: "brandname", status: "2", title: "品牌"},
|
|
|
+ { input: "", key: "madel", status: "2", title: "型号"},
|
|
|
+ { input: "", key: "unitname", status: "2", title: "计量单位"},
|
|
|
+ { input: "", key: "unitprice", status: "2", title: "单价"},
|
|
|
+ { input: "", key: "number", status: "2", title: "数量"},
|
|
|
+ { input: "", key: "totalprice", status: "2", title: "总价"},
|
|
|
+ { input: "", key: "departroom", status: "2", title: "科室"},
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ one.content.splice(Number(index) + 1, 0, JSON.parse(JSON.stringify(tempNode)));
|
|
|
+ this.checkOneStatus({
|
|
|
+ one: one,
|
|
|
+ type: true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ saveDataTwo:function (two, n, one) {
|
|
|
+ two.uInput.forEach(function (v) {
|
|
|
+ var key = v.key
|
|
|
if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
|
|
|
key === "publishtime" || key === "signaturedate") {
|
|
|
- var val = witch.input
|
|
|
+ var val = v.input
|
|
|
if (val !== null && val !== "") {
|
|
|
var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
|
|
|
var regExp = new RegExp(reg);
|
|
|
if (!regExp.test(val)) {
|
|
|
this.$message({
|
|
|
- message: witch.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
|
|
|
+ message: v.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
|
|
|
type: 'warning',
|
|
|
duration: 2000,
|
|
|
offset: 300
|
|
|
});
|
|
|
- //alert(witch.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
|
|
|
+ //alert(v.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (s === '2' && !one && !two && witch.content.length === 0) {
|
|
|
- return
|
|
|
- }
|
|
|
- witch.status = s;
|
|
|
- if (two) {
|
|
|
- this.checkOneStatus({
|
|
|
- one: one,
|
|
|
- two: two,
|
|
|
- type: false
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- //二级删除
|
|
|
- delNewTwo: function (one, index, two) {
|
|
|
- //two.ck_isnew = false //目前点删除按钮页面直接不显示,但是集合索引位置不变,所以加了此代码
|
|
|
- //two.show = false
|
|
|
- // if (two.isnew) {
|
|
|
- one.content.splice(index, 1)
|
|
|
- // } else {
|
|
|
- // two.show = false
|
|
|
- // two.status = "4"
|
|
|
- // this.saveDataTwo(two, "4", one)
|
|
|
- // }
|
|
|
- this.checkOneStatus({
|
|
|
- one: one,
|
|
|
- two: two,
|
|
|
- type: true
|
|
|
- })
|
|
|
- },
|
|
|
- /*add style*/
|
|
|
- addStyle: function (data) {
|
|
|
- return prettyPrint(data).replace(/(checkAllTag|checkType|showCheck|wstatus|status|key|title|input|content|uInput|selectArr|select|show|true)/g, "<mark>$1</mark>")
|
|
|
- },
|
|
|
- /*同步修改源码*/
|
|
|
- changeText: function (boolean) {
|
|
|
- try {
|
|
|
- var tempText = JSON.parse(this.$refs.text.innerText.replace(/(\n|\s)/g, ''))
|
|
|
- if (boolean) {
|
|
|
- this.tagvalues = tempText
|
|
|
- } else {
|
|
|
- this.editData = tempText
|
|
|
- }
|
|
|
- } catch (err) {
|
|
|
- alert('源码修改失败')
|
|
|
- }
|
|
|
- },
|
|
|
- goText: function (value) {
|
|
|
- /*重置Html*/
|
|
|
- this.pageHtml = this.getPageInfo.html
|
|
|
- if (!value) {
|
|
|
- return false
|
|
|
- }
|
|
|
- var rs = new RegExp('(' + value + ')', 'gi')
|
|
|
- //选中input框值文本高亮
|
|
|
- if (rs.test(this.pageHtml)) {
|
|
|
- this.pageHtml = this.pageHtml.replace(rs, '<mark>$1</mark>')
|
|
|
- /*延迟查询dom,防止dom未插入*/
|
|
|
- var $this = this
|
|
|
- setTimeout(function () {
|
|
|
- $this.goMark(value)
|
|
|
- }, 150)
|
|
|
- } else {
|
|
|
- /*重置Html*/
|
|
|
- this.pageHtml = this.getPageInfo.html
|
|
|
- }
|
|
|
- },
|
|
|
- goMark: function (value) {
|
|
|
- var mLength = document.querySelectorAll('mark').length
|
|
|
- if (this.scrollCache.value === value) {
|
|
|
- this.scrollCache.index = (this.scrollCache.index + 1) % mLength
|
|
|
- } else {
|
|
|
- this.scrollCache.index = 0
|
|
|
- }
|
|
|
- this.scrollCache.value = value
|
|
|
- /*滚动到第一个mark*/
|
|
|
- var temp = document.querySelectorAll('mark')[this.scrollCache.index]
|
|
|
- $("mark").removeClass('focus')
|
|
|
- $(temp).addClass('focus')
|
|
|
- document.querySelector('.article').scrollTop = offset(temp).top - window.screen.height / 2
|
|
|
- },
|
|
|
- // markTag:function(n){
|
|
|
- // $.ajax({
|
|
|
- // url:"/markTag",
|
|
|
- // method:"post",
|
|
|
- // data: {tag:n,_id:_id},
|
|
|
- // success:function(res){
|
|
|
- // if(res){
|
|
|
- // document.getElementById("com-alert-val").innerHtml="标记成功";
|
|
|
- // var label1 = document.getElementById("com-alert");
|
|
|
- // label1.style.display="block";
|
|
|
- // setTimeout(function(){label1.style.display="none";},1000)
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
- // },
|
|
|
- addChild: function (one, oindex) {
|
|
|
- var tempNode = {}
|
|
|
- switch (one.title) {
|
|
|
- case "标的信息": {
|
|
|
- tempNode = {
|
|
|
- //content: [],
|
|
|
- show: true,
|
|
|
- isnew: true,
|
|
|
- status: "2",
|
|
|
- title: "标的物",
|
|
|
- uInput: JSON.parse(JSON.stringify(pclfInput))
|
|
|
- }
|
|
|
- break
|
|
|
- }
|
|
|
- case "采购意向信息": {
|
|
|
- tempNode = {
|
|
|
- //content: [],
|
|
|
- show: true,
|
|
|
- isnew: true,
|
|
|
- status: "2",
|
|
|
- title: "标的物",
|
|
|
- uInput: JSON.parse(JSON.stringify(pclfInput1))
|
|
|
- }
|
|
|
- break
|
|
|
- }
|
|
|
- case "多包信息": {
|
|
|
- tempNode = {
|
|
|
- //content: [],
|
|
|
- show: true,
|
|
|
- status: "2",
|
|
|
- isnew: true,
|
|
|
- title: "子包",
|
|
|
- uInput: JSON.parse(JSON.stringify(pfInput))
|
|
|
- }
|
|
|
- break
|
|
|
- }
|
|
|
- case "中标候选人信息": {
|
|
|
- tempNode = {
|
|
|
- //content: [],
|
|
|
- show: true,
|
|
|
- status: "2",
|
|
|
- isnew: true,
|
|
|
- title: "候选人",
|
|
|
- uInput: JSON.parse(JSON.stringify(wodfInput))
|
|
|
- }
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- // 输入多个
|
|
|
- var count = prompt('请输入需要新增的个数')
|
|
|
- // if (one.status >= "2") {
|
|
|
- // one.status = '2'
|
|
|
- // }
|
|
|
- for (let j = 0; j < count; j++) {
|
|
|
- one.content.push(JSON.parse(JSON.stringify(tempNode)))
|
|
|
- this.checkOneStatus({
|
|
|
- one: one,
|
|
|
- type: true
|
|
|
- })
|
|
|
+ if (n === "1" && v.status === "-1") {
|
|
|
+ v.status = n
|
|
|
+ } else if (n === "-1") {
|
|
|
+ v.status = n
|
|
|
+ } else if (n === "2") {
|
|
|
+ v.status = n
|
|
|
+ } else if (n === "4") {
|
|
|
+ v.status = n
|
|
|
}
|
|
|
- this.$nextTick(() => {
|
|
|
- var tempN = $(".edit.one").eq(oindex).find(".edit-title")
|
|
|
- var goTop = tempN.eq(tempN.length - 1).offset().top
|
|
|
- setTimeout(() => {
|
|
|
- $(".operation").scrollTop($(".operation").scrollTop() + goTop)
|
|
|
- }, 150)
|
|
|
- })
|
|
|
- },
|
|
|
- // 新增子包中标信息字段
|
|
|
- addThreeChild:function (two, n, one) {
|
|
|
- two.uInput.push({
|
|
|
- input: "",
|
|
|
- key: 'winner',
|
|
|
- status: "2",
|
|
|
- title: '标段(包)中标单位'
|
|
|
- })
|
|
|
- two.uInput.push({
|
|
|
- input: "",
|
|
|
- key: 'bidamount',
|
|
|
- status: "2",
|
|
|
- title: '标段(包)中标金额'
|
|
|
- })
|
|
|
- two.status = "2"
|
|
|
- this.checkOneStatus({
|
|
|
- one: one,
|
|
|
- two: two,
|
|
|
- type: false
|
|
|
- })
|
|
|
- },
|
|
|
- //保存
|
|
|
- saveDataTwo:function (two, n, one) {
|
|
|
- two.uInput.forEach(function (v) {
|
|
|
- var key = v.key
|
|
|
- if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
|
|
|
- key === "publishtime" || key === "signaturedate") {
|
|
|
- var val = v.input
|
|
|
- if (val !== null && val !== "") {
|
|
|
- var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
|
|
|
- var regExp = new RegExp(reg);
|
|
|
- if (!regExp.test(val)) {
|
|
|
- this.$message({
|
|
|
- message: v.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
|
|
|
- type: 'warning',
|
|
|
- duration: 2000,
|
|
|
- offset: 300
|
|
|
- });
|
|
|
- //alert(v.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if (n === "1" && v.status === "-1") {
|
|
|
- v.status = n
|
|
|
- } else if (n === "-1") {
|
|
|
- v.status = n
|
|
|
- } else if (n === "2") {
|
|
|
- v.status = n
|
|
|
- } else if (n === "4") {
|
|
|
- v.status = n
|
|
|
- }
|
|
|
- });
|
|
|
- two.status = n
|
|
|
- this.checkOneStatus({
|
|
|
- one: one,
|
|
|
- two: two,
|
|
|
- type: false
|
|
|
- })
|
|
|
- /**
|
|
|
- two.content.forEach(function(v) {
|
|
|
+ });
|
|
|
+ two.status = n
|
|
|
+ this.checkOneStatus({
|
|
|
+ one: one,
|
|
|
+ two: two,
|
|
|
+ type: false
|
|
|
+ })
|
|
|
+ /**
|
|
|
+ two.content.forEach(function(v) {
|
|
|
v.uInput.forEach(function(value) {
|
|
|
if (value.input && value.input != '') {
|
|
|
value.status = n
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
- */
|
|
|
- },
|
|
|
- saveDataOne:function (one, n) {
|
|
|
- //保存后的样式
|
|
|
- var _this = this
|
|
|
- one.content.forEach(function (v) {
|
|
|
- v.uInput.forEach(function (value) {
|
|
|
- var key = value.key
|
|
|
- if (n === "1") {
|
|
|
- if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
|
|
|
- key === "publishtime" || key === "signaturedate") {
|
|
|
- var val = value.input
|
|
|
- if (val !== null && val !== "") {
|
|
|
- var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
|
|
|
- var regExp = new RegExp(reg);
|
|
|
- if (!regExp.test(val)) {
|
|
|
- this.$message({
|
|
|
- message: value.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
|
|
|
- type: 'warning',
|
|
|
- duration: 2000,
|
|
|
- offset: 300
|
|
|
- });
|
|
|
- //alert(value.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
|
|
|
- return
|
|
|
- }
|
|
|
+ */
|
|
|
+ },
|
|
|
+ saveDataOne:function (one, n) {
|
|
|
+ //保存后的样式
|
|
|
+ var _this = this
|
|
|
+ one.content.forEach(function (v) {
|
|
|
+ v.uInput.forEach(function (value) {
|
|
|
+ var key = value.key
|
|
|
+ if (n === "1") {
|
|
|
+ if (key === "bidendtime" || key === "bidopentime" || key === "project_startdate" || key === "project_completedate" ||
|
|
|
+ key === "publishtime" || key === "signaturedate") {
|
|
|
+ var val = value.input
|
|
|
+ if (val !== null && val !== "") {
|
|
|
+ var reg = /^[1-9]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])\s+(20|21|22|23|[0-1]\d):[0-5]\d:[0-5]\d$/;
|
|
|
+ var regExp = new RegExp(reg);
|
|
|
+ if (!regExp.test(val)) {
|
|
|
+ this.$message({
|
|
|
+ message: value.title + ",日期格式错误!正确格式:2006-01-02 15:04:05",
|
|
|
+ type: 'warning',
|
|
|
+ duration: 2000,
|
|
|
+ offset: 300
|
|
|
+ });
|
|
|
+ //alert(value.title+",日期格式错误!正确格式:2006-01-02 15:04:05")
|
|
|
+ return
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // 取消全部,通过时判断状态是否处于修改新增等
|
|
|
- if (n === "1" && value.status === "-1") {
|
|
|
- value.status = n
|
|
|
- } else if (n === "-1") {
|
|
|
- value.status = n
|
|
|
- }
|
|
|
- })
|
|
|
+ }
|
|
|
+ // 取消全部,通过时判断状态是否处于修改新增等
|
|
|
+ if (n === "1" && value.status === "-1") {
|
|
|
+ value.status = n
|
|
|
+ } else if (n === "-1") {
|
|
|
+ value.status = n
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- _this.checkOneStatus({
|
|
|
- two: v,
|
|
|
- one: one,
|
|
|
- type: false
|
|
|
- })
|
|
|
- });
|
|
|
- },
|
|
|
- //验证保存提示
|
|
|
- open:function (stype, callback) {
|
|
|
- var noTagKey = [];
|
|
|
- this.editData.filter(function (one) {
|
|
|
- if (one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") {
|
|
|
- if (one.status === "-1") {
|
|
|
- noTagKey.push(one.title);
|
|
|
+ _this.checkOneStatus({
|
|
|
+ two: v,
|
|
|
+ one: one,
|
|
|
+ type: false
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ tranEditData: function(data, type) {
|
|
|
+ var list = JSON.parse(JSON.stringify(data))
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
+ var one = list[i]
|
|
|
+ if (one.content) {
|
|
|
+ for (var j = 0; j < one.content.length; j++) {
|
|
|
+ var two = one.content[j]
|
|
|
+ var twoIndex = j
|
|
|
+ // 转回 content
|
|
|
+ if (type) {
|
|
|
+ if (two.isFour) {
|
|
|
+ // 兼容判断
|
|
|
+ const parentIndex = one.content.findIndex(v => v.__id === two.parentId)
|
|
|
+ var parentNode = one.content[parentIndex]
|
|
|
+ if (!parentNode.content) {
|
|
|
+ parentNode.content = []
|
|
|
+ }
|
|
|
+ parentNode.content.push(two)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 转回平级
|
|
|
+ if (two.content) {
|
|
|
+ two.__id = two.title + Date.now() + Math.random()
|
|
|
+ two.content = two.content.map(s => {
|
|
|
+ s.parentId = two.__id
|
|
|
+ s.isFour = true
|
|
|
+ return s
|
|
|
+ })
|
|
|
+ one.content.splice(twoIndex + 1, 0, ...two.content)
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
+ if (type) {
|
|
|
+ one.content = one.content.filter(two => two.isFour !== true)
|
|
|
} else {
|
|
|
- one.content.filter(function (v) {
|
|
|
- v.uInput.filter(function (u) {
|
|
|
- if (u.status === "-1") {
|
|
|
- noTagKey.push(u.title);
|
|
|
- }
|
|
|
- })
|
|
|
+ one.content = one.content.map(two => {
|
|
|
+ two.content = []
|
|
|
+ return two
|
|
|
})
|
|
|
}
|
|
|
- })
|
|
|
- if (noTagKey.length > 0) {
|
|
|
- var fieldText = noTagKey.join(",");
|
|
|
- fieldText = fieldText.replace(/\([^\)]*\)/g, "");
|
|
|
- this.$alert("未标注字段:" + fieldText);
|
|
|
- return
|
|
|
}
|
|
|
- var resultStatus = false
|
|
|
- if (stype === 1) {//全部字段验证
|
|
|
- var checkAllKey = this.editData.filter(function (one) {
|
|
|
- var otherOne = one.content.filter(function (v) {
|
|
|
- return v.uInput.filter(function (u) {
|
|
|
- return u.status === '-1'
|
|
|
- }).length
|
|
|
+ }
|
|
|
+ return list
|
|
|
+ },
|
|
|
+ open:function (stype, callback) {
|
|
|
+ var noTagKey = [];
|
|
|
+ this.editData.filter(function (one) {
|
|
|
+ if (one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") {
|
|
|
+ if (one.status === "-1") {
|
|
|
+ noTagKey.push(one.title);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ one.content.filter(function (v) {
|
|
|
+ v.uInput.filter(function (u) {
|
|
|
+ if (u.status === "-1") {
|
|
|
+ noTagKey.push(u.title);
|
|
|
+ }
|
|
|
})
|
|
|
- if ((one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") && (one.status === "-1")) {
|
|
|
- return true
|
|
|
- } else {
|
|
|
- return otherOne.length
|
|
|
- }
|
|
|
})
|
|
|
- resultStatus = !Boolean(checkAllKey.length)
|
|
|
- } else {//部分字段验证
|
|
|
- var otherTag = 0 //标注状态 0:没标 1:标注成功 2:标注失败
|
|
|
- var baseTag = 0
|
|
|
- this.editData.filter(function (one) {
|
|
|
- //多包信息、中标候选人信息在为标注失败的前提下检测标注状态,一个失败不能保存
|
|
|
- if (otherTag < 2) {
|
|
|
- if (one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") {
|
|
|
- if (one.status === "-1") {//没标
|
|
|
- if (otherTag !== 1) {//前一个标注成功不用记录后一个是否未标
|
|
|
- otherTag = 0
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (noTagKey.length > 0) {
|
|
|
+ var fieldText = noTagKey.join(",");
|
|
|
+ fieldText = fieldText.replace(/\([^\)]*\)/g, "");
|
|
|
+ this.$alert("未标注字段:" + fieldText);
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var resultStatus = false
|
|
|
+ if (stype === 1) {//全部字段验证
|
|
|
+ var checkAllKey = this.editData.filter(function (one) {
|
|
|
+ var otherOne = one.content.filter(function (v) {
|
|
|
+ return v.uInput.filter(function (u) {
|
|
|
+ return u.status === '-1'
|
|
|
+ }).length
|
|
|
+ })
|
|
|
+ if ((one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") && (one.status === "-1")) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return otherOne.length
|
|
|
+ }
|
|
|
+ })
|
|
|
+ resultStatus = !Boolean(checkAllKey.length)
|
|
|
+ } else {//部分字段验证
|
|
|
+ var otherTag = 0 //标注状态 0:没标 1:标注成功 2:标注失败
|
|
|
+ var baseTag = 0
|
|
|
+ this.editData.filter(function (one) {
|
|
|
+ //多包信息、中标候选人信息在为标注失败的前提下检测标注状态,一个失败不能保存
|
|
|
+ if (otherTag < 2) {
|
|
|
+ if (one.title === "标的信息" || one.title === "采购意向信息" || one.title === "多包信息" || one.title === "中标候选人信息") {
|
|
|
+ if (one.status === "-1") {//没标
|
|
|
+ if (otherTag !== 1) {//前一个标注成功不用记录后一个是否未标
|
|
|
+ otherTag = 0
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (one.content.length === 0) {//不含子包
|
|
|
+ if (one.status === '2') {
|
|
|
+ otherTag = 2 //失败
|
|
|
+ } else {
|
|
|
+ otherTag = 1 //成功
|
|
|
}
|
|
|
- } else {
|
|
|
- if (one.content.length === 0) {//不含子包
|
|
|
- if (one.status === '2') {
|
|
|
- otherTag = 2 //失败
|
|
|
- } else {
|
|
|
- otherTag = 1 //成功
|
|
|
- }
|
|
|
- } else {//含子包
|
|
|
- if (one.title === "标的信息") {
|
|
|
- var otherOne = one.content.filter(function (v) {
|
|
|
- if (v.status >= 1) {//子信息标注
|
|
|
- var twoLength = v.uInput.filter(function (u) {
|
|
|
- return u.status === '-1'
|
|
|
- })
|
|
|
- if (twoLength.length > 0) {
|
|
|
- otherTag = 2
|
|
|
- }
|
|
|
- return true //返回此条信息被标注
|
|
|
- }
|
|
|
- })
|
|
|
- if (otherTag !== 2) {
|
|
|
- if (otherOne.length > 0) {//
|
|
|
- otherTag = 1
|
|
|
- } else {
|
|
|
+ } else {//含子包
|
|
|
+ if (one.title === "标的信息") {
|
|
|
+ var otherOne = one.content.filter(function (v) {
|
|
|
+ if (v.status >= 1) {//子信息标注
|
|
|
+ var twoLength = v.uInput.filter(function (u) {
|
|
|
+ return u.status === '-1'
|
|
|
+ })
|
|
|
+ if (twoLength.length > 0) {
|
|
|
otherTag = 2
|
|
|
}
|
|
|
+ return true //返回此条信息被标注
|
|
|
}
|
|
|
- } else {
|
|
|
- var otherOne = one.content.filter(function (v) {
|
|
|
- return v.uInput.filter(function (u) {
|
|
|
- return u.status === '-1'
|
|
|
- }).length
|
|
|
- })
|
|
|
+ })
|
|
|
+ if (otherTag !== 2) {
|
|
|
if (otherOne.length > 0) {//
|
|
|
- otherTag = 2
|
|
|
- } else {
|
|
|
otherTag = 1
|
|
|
+ } else {
|
|
|
+ otherTag = 2
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ var otherOne = one.content.filter(function (v) {
|
|
|
+ return v.uInput.filter(function (u) {
|
|
|
+ return u.status === '-1'
|
|
|
+ }).length
|
|
|
+ })
|
|
|
+ if (otherOne.length > 0) {//
|
|
|
+ otherTag = 2
|
|
|
+ } else {
|
|
|
+ otherTag = 1
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- } else {
|
|
|
- var baseOne = one.content.filter(function (v) {
|
|
|
- return v.uInput.filter(function (u) {
|
|
|
- return u.status !== '-1'
|
|
|
- }).length
|
|
|
- })
|
|
|
- if (baseOne.length > 0) {//基本字段
|
|
|
- baseTag = 1
|
|
|
- }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ var baseOne = one.content.filter(function (v) {
|
|
|
+ return v.uInput.filter(function (u) {
|
|
|
+ return u.status !== '-1'
|
|
|
+ }).length
|
|
|
+ })
|
|
|
+ if (baseOne.length > 0) {//基本字段
|
|
|
+ baseTag = 1
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
- if (otherTag === 0 && baseTag === 1) {
|
|
|
- resultStatus = true
|
|
|
- } else if (otherTag === 1) {
|
|
|
- resultStatus = true
|
|
|
}
|
|
|
+ })
|
|
|
+ if (otherTag === 0 && baseTag === 1) {
|
|
|
+ resultStatus = true
|
|
|
+ } else if (otherTag === 1) {
|
|
|
+ resultStatus = true
|
|
|
}
|
|
|
- if (!resultStatus) {
|
|
|
- this.$alert("未标注完成");
|
|
|
- return
|
|
|
- }
|
|
|
- // var d = JSON.stringify(this.editData);
|
|
|
- // var _this = this
|
|
|
- // if (JSON.stringify(this.originData) === d) {
|
|
|
- // this.$alert("未做任何修改");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- this.$confirm('是否保存?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.upChange(stype, callback)
|
|
|
- }).catch(() => {
|
|
|
- });
|
|
|
- },
|
|
|
- //保存事件
|
|
|
- upChange: function (stype, callback) {
|
|
|
- var d = JSON.stringify(this.editData);
|
|
|
- var _this = this
|
|
|
- if (tid === "") {
|
|
|
- $.ajax({
|
|
|
- url: "/front/data/jyuser/mark",
|
|
|
- method: "post",
|
|
|
- data: {"data": d, "s_infoid": _id, "pid": pid, "s_sourceinfo": coll, "isEff": isEff},
|
|
|
- success: function (res) {
|
|
|
- if (res) {
|
|
|
- _this.$message({
|
|
|
- message: '保存成功',
|
|
|
- type: 'success',
|
|
|
- duration: 1000,
|
|
|
- offset: 300
|
|
|
- });
|
|
|
- issave = true//保存成功
|
|
|
- sessionStorage.setItem(_id + '_save', issave)
|
|
|
- if (callback) {
|
|
|
- return callback()
|
|
|
- }
|
|
|
- location.reload()
|
|
|
+ }
|
|
|
+ if (!resultStatus) {
|
|
|
+ this.$alert("未标注完成");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // var d = JSON.stringify(this.editData);
|
|
|
+ // var _this = this
|
|
|
+ // if (JSON.stringify(this.originData) === d) {
|
|
|
+ // this.$alert("未做任何修改");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ this.$confirm('是否保存?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.upChange(stype, callback)
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //保存事件
|
|
|
+ upChange: function (stype, callback) {
|
|
|
+ console.log(tid)
|
|
|
+ console.log(this.editData)
|
|
|
+ var d = JSON.stringify(this.tranEditData(this.editData, true));
|
|
|
+ var _this = this
|
|
|
+ console.log(d)
|
|
|
+ if (tid === "") {
|
|
|
+ $.ajax({
|
|
|
+ url: "/front/data/jyuser/mark",
|
|
|
+ method: "post",
|
|
|
+ data: {"data": d, "s_infoid": _id, "pid": pid, "isEff": isEff},
|
|
|
+ success: function (res) {
|
|
|
+ if (res) {
|
|
|
+ _this.$message({
|
|
|
+ message: '保存成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1000,
|
|
|
+ offset: 300
|
|
|
+ });
|
|
|
+ issave = true//保存成功
|
|
|
+ sessionStorage.setItem(_id + '_save', issave)
|
|
|
+ if (callback) {
|
|
|
+ return callback()
|
|
|
}
|
|
|
- },
|
|
|
- error: function (err) {
|
|
|
- alert(err);
|
|
|
+ location.reload()
|
|
|
}
|
|
|
- });
|
|
|
- }else {
|
|
|
- console.log(d)
|
|
|
- $.ajax({
|
|
|
- url: "/front/data/user/mark",
|
|
|
- method: "post",
|
|
|
- data: {"data": d, "s_infoid": _id, "s_usertaskid": tid, "isEff": isEff},
|
|
|
- success: function (res) {
|
|
|
- if (res) {
|
|
|
- _this.$message({
|
|
|
- message: '保存成功',
|
|
|
- type: 'success',
|
|
|
- duration: 1000,
|
|
|
- offset: 300
|
|
|
- });
|
|
|
- issave = true//保存成功
|
|
|
- sessionStorage.setItem(_id + '_save', issave)
|
|
|
- if (callback) {
|
|
|
- return callback()
|
|
|
- }
|
|
|
- location.reload()
|
|
|
+ },
|
|
|
+ error: function (err) {
|
|
|
+ alert(err);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else {
|
|
|
+ $.ajax({
|
|
|
+ url: "/front/data/user/mark",
|
|
|
+ method: "post",
|
|
|
+ data: {"data": d, "s_infoid": _id, "s_usertaskid": tid, "isEff": isEff},
|
|
|
+ success: function (res) {
|
|
|
+ if (res) {
|
|
|
+ _this.$message({
|
|
|
+ message: '保存成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 1000,
|
|
|
+ offset: 300
|
|
|
+ });
|
|
|
+ issave = true//保存成功
|
|
|
+ sessionStorage.setItem(_id + '_save', issave)
|
|
|
+ if (callback) {
|
|
|
+ return callback()
|
|
|
}
|
|
|
- },
|
|
|
- error: function (err) {
|
|
|
- alert(err);
|
|
|
+ location.reload()
|
|
|
}
|
|
|
- });
|
|
|
- }
|
|
|
+ },
|
|
|
+ error: function (err) {
|
|
|
+ alert(err);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
- //保存提示
|
|
|
- // open:function(one, type) {
|
|
|
- // this.$confirm('是否保存?', '提示', {
|
|
|
- // confirmButtonText: '确定',
|
|
|
- // cancelButtonText: '取消',
|
|
|
- // type: 'warning'
|
|
|
- // }).then(() => {
|
|
|
- // if (type) {
|
|
|
- // this.saveOneData(one)
|
|
|
- // } else {
|
|
|
- // this.upChange()
|
|
|
- // }
|
|
|
- // }).catch(() => {
|
|
|
- // });
|
|
|
- // },
|
|
|
- //一级保存
|
|
|
- // saveOneData: function (one) {
|
|
|
- // if (one.title==="标的信息"||one.title==="多包信息"||one.title==="中标候选人信息"){
|
|
|
- // if(one.status === "-1"){
|
|
|
- // this.$alert(one.title+" 未标注完成")
|
|
|
- // return
|
|
|
- // }else if (one.status !=="-1"){
|
|
|
- // var isAlert = one.content.filter(function(v) {
|
|
|
- // return v.uInput.filter(function (u) {
|
|
|
- // return u.status === '-1'
|
|
|
- // }).length
|
|
|
- // })
|
|
|
- // if (isAlert.length) {
|
|
|
- // this.$alert(one.title+" 未标注完成")
|
|
|
- // return
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // onetext = "["+ JSON.stringify(one) +"]";
|
|
|
- // $.ajax({
|
|
|
- // url:"/center/biaozhu",
|
|
|
- // method:"post",
|
|
|
- // data: {key:onetext,_id:_id},
|
|
|
- // success:function(res){
|
|
|
- // if(res){
|
|
|
- // document.getElementById("com-alert-val").innerHtml="保存成功";
|
|
|
- // var label1 = document.getElementById("com-alert");
|
|
|
- // label1.style.display="block";
|
|
|
- // setTimeout(function(){
|
|
|
- // label1.style.display="none";
|
|
|
- // },
|
|
|
- // 1000)
|
|
|
- // }
|
|
|
- // },
|
|
|
- // error:function(err){
|
|
|
- // alert(err);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // },
|
|
|
- }
|
|
|
+ }
|
|
|
+ //保存提示
|
|
|
+ // open:function(one, type) {
|
|
|
+ // this.$confirm('是否保存?', '提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // type: 'warning'
|
|
|
+ // }).then(() => {
|
|
|
+ // if (type) {
|
|
|
+ // this.saveOneData(one)
|
|
|
+ // } else {
|
|
|
+ // this.upChange()
|
|
|
+ // }
|
|
|
+ // }).catch(() => {
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ //一级保存
|
|
|
+ // saveOneData: function (one) {
|
|
|
+ // if (one.title==="标的信息"||one.title==="多包信息"||one.title==="中标候选人信息"){
|
|
|
+ // if(one.status === "-1"){
|
|
|
+ // this.$alert(one.title+" 未标注完成")
|
|
|
+ // return
|
|
|
+ // }else if (one.status !=="-1"){
|
|
|
+ // var isAlert = one.content.filter(function(v) {
|
|
|
+ // return v.uInput.filter(function (u) {
|
|
|
+ // return u.status === '-1'
|
|
|
+ // }).length
|
|
|
+ // })
|
|
|
+ // if (isAlert.length) {
|
|
|
+ // this.$alert(one.title+" 未标注完成")
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // onetext = "["+ JSON.stringify(one) +"]";
|
|
|
+ // $.ajax({
|
|
|
+ // url:"/center/biaozhu",
|
|
|
+ // method:"post",
|
|
|
+ // data: {key:onetext,_id:_id},
|
|
|
+ // success:function(res){
|
|
|
+ // if(res){
|
|
|
+ // document.getElementById("com-alert-val").innerHtml="保存成功";
|
|
|
+ // var label1 = document.getElementById("com-alert");
|
|
|
+ // label1.style.display="block";
|
|
|
+ // setTimeout(function(){
|
|
|
+ // label1.style.display="none";
|
|
|
+ // },
|
|
|
+ // 1000)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // error:function(err){
|
|
|
+ // alert(err);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
function offset(elem) {
|