|
@@ -4,31 +4,34 @@
|
|
<div class="sub-content">
|
|
<div class="sub-content">
|
|
<div class="item">
|
|
<div class="item">
|
|
<div class="item-label item-label-required">区域:</div>
|
|
<div class="item-label item-label-required">区域:</div>
|
|
- <div class="item-value">
|
|
|
|
- <el-input class="custom-long-input" v-model="datas.area" disabled></el-input>
|
|
|
|
|
|
+ <div class="item-value" @click="dialog.area = true">
|
|
|
|
+ <el-input class="my custom-long-input" v-model="datas.areaStr" disabled></el-input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="item">
|
|
<div class="item">
|
|
<div class="item-label item-label-required">采购单位行业:</div>
|
|
<div class="item-label item-label-required">采购单位行业:</div>
|
|
- <div class="item-value">
|
|
|
|
- <el-input class="custom-long-input" v-model="datas.industry" disabled></el-input>
|
|
|
|
|
|
+ <div class="item-value" @click="dialog.buyClass = true">
|
|
|
|
+ <el-input class="my custom-long-input" v-model="datas.buyClassStr" disabled></el-input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="item">
|
|
<div class="item">
|
|
<div class="item-label item-label-required">信息类型:</div>
|
|
<div class="item-label item-label-required">信息类型:</div>
|
|
- <div class="item-value">
|
|
|
|
- <el-input class="custom-long-input" v-model="datas.infotypes" disabled></el-input>
|
|
|
|
|
|
+ <div class="item-value" @click="dialog.infoType = true">
|
|
|
|
+ <el-input class="my custom-long-input" v-model="datas.infoTypeStr" disabled></el-input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="item-other">
|
|
<div class="item-other">
|
|
<div class="item-label">项目匹配:</div>
|
|
<div class="item-label">项目匹配:</div>
|
|
<div class="item-value item-other-value">
|
|
<div class="item-value item-other-value">
|
|
<el-switch
|
|
<el-switch
|
|
|
|
+ class="my"
|
|
:disabled="projectSwitch.disabled"
|
|
:disabled="projectSwitch.disabled"
|
|
v-loading="projectSwitch.loading"
|
|
v-loading="projectSwitch.loading"
|
|
- @change="switchProject"
|
|
|
|
|
|
+ @change="switchProjectMatch($event)"
|
|
v-model="datas.projectmatch"
|
|
v-model="datas.projectmatch"
|
|
:width="44"
|
|
:width="44"
|
|
|
|
+ :active-value="1"
|
|
|
|
+ :inactive-value="0"
|
|
active-text="关"
|
|
active-text="关"
|
|
inactive-text="开"
|
|
inactive-text="开"
|
|
active-color="#2cb7ca"
|
|
active-color="#2cb7ca"
|
|
@@ -41,11 +44,14 @@
|
|
<div class="item-label">"其他"采购单位:</div>
|
|
<div class="item-label">"其他"采购单位:</div>
|
|
<div class="item-value item-other-value">
|
|
<div class="item-value item-other-value">
|
|
<el-switch
|
|
<el-switch
|
|
|
|
+ class="my"
|
|
:disabled="unitSwitch.disabled"
|
|
:disabled="unitSwitch.disabled"
|
|
v-loading="unitSwitch.loading"
|
|
v-loading="unitSwitch.loading"
|
|
- @change="switchUnit"
|
|
|
|
|
|
+ @change="switchOtherUnit($event)"
|
|
v-model="datas.buyclassmatch"
|
|
v-model="datas.buyclassmatch"
|
|
:width="44"
|
|
:width="44"
|
|
|
|
+ :active-value="1"
|
|
|
|
+ :inactive-value="0"
|
|
active-text="关"
|
|
active-text="关"
|
|
inactive-text="开"
|
|
inactive-text="开"
|
|
active-color="#2cb7ca"
|
|
active-color="#2cb7ca"
|
|
@@ -57,32 +63,84 @@
|
|
<div class="item-other">
|
|
<div class="item-other">
|
|
<div class="item-label">关键词匹配方式:</div>
|
|
<div class="item-label">关键词匹配方式:</div>
|
|
<div class="item-value item-other-value">
|
|
<div class="item-value item-other-value">
|
|
- <el-radio-group v-model="datas.mathWay" @change="chooseMathWay">
|
|
|
|
|
|
+ <el-radio-group v-model="datas.mathway" @change="chooseMathWay($event)">
|
|
<div class="radio-item">
|
|
<div class="radio-item">
|
|
- <el-radio :label="1">按标题匹配</el-radio>
|
|
|
|
|
|
+ <el-radio class="my" name="matchway" :label="1">按标题匹配</el-radio>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
- <el-radio :label="2">按全文匹配</el-radio>
|
|
|
|
|
|
+ <el-radio class="my" name="matchway" :label="0">按全文匹配</el-radio>
|
|
</div>
|
|
</div>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
<p class="math-tips">会产生无效信息,请根据需要选择</p>
|
|
<p class="math-tips">会产生无效信息,请根据需要选择</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 区域选择dialog -->
|
|
|
|
+ <el-dialog
|
|
|
|
+ custom-class="sub-dialog"
|
|
|
|
+ :visible.sync="dialog.area"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :show-close="false"
|
|
|
|
+ center
|
|
|
|
+ width="460px"
|
|
|
|
+ >
|
|
|
|
+ <AreaSelect
|
|
|
|
+ :initCityMap="datas.areaObj"
|
|
|
|
+ @onCancel="dialog.area = false"
|
|
|
|
+ @onConfirm="saveAreaData"
|
|
|
|
+ ></AreaSelect>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <!-- 采购单位行业dialog -->
|
|
|
|
+ <el-dialog
|
|
|
|
+ custom-class="sub-dialog"
|
|
|
|
+ :visible.sync="dialog.buyClass"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :show-close="false"
|
|
|
|
+ center
|
|
|
|
+ width="460px"
|
|
|
|
+ >
|
|
|
|
+ <BuyClassSelect
|
|
|
|
+ :initCate="datas.buyClassArr"
|
|
|
|
+ @onCancel="dialog.buyClass = false"
|
|
|
|
+ @onConfirm="saveBuyClassData"
|
|
|
|
+ ></BuyClassSelect>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <!-- 信息类型dialog -->
|
|
|
|
+ <el-dialog
|
|
|
|
+ custom-class="sub-dialog"
|
|
|
|
+ :visible.sync="dialog.infoType"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :show-close="false"
|
|
|
|
+ center
|
|
|
|
+ width="460px"
|
|
|
|
+ >
|
|
|
|
+ <InfoTypeSelect
|
|
|
|
+ :initInfoType="datas.infoTypeArr"
|
|
|
|
+ @onCancel="dialog.infoType = false"
|
|
|
|
+ @onConfirm="saveInfoTypeData"
|
|
|
|
+ ></InfoTypeSelect>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-import { Switch, Input, RadioGroup, Radio, Button } from 'element-ui'
|
|
|
|
|
|
+import { Switch, Input, RadioGroup, Radio, Button, Dialog } from 'element-ui'
|
|
|
|
+import AreaSelect from '@/components/selector/AreaSelector'
|
|
|
|
+import BuyClassSelect from '@/components/selector/BuyerclassSelector'
|
|
|
|
+import InfoTypeSelect from '@/components/selector/InfoTypeSelector'
|
|
|
|
+import { updateArea, updateBuyClass, updateInfoType, updateProjectMatch, updateOtherBuyClass, updateMatchType } from '@/api/modules'
|
|
export default {
|
|
export default {
|
|
name: 'sub-config',
|
|
name: 'sub-config',
|
|
props: {
|
|
props: {
|
|
datas: {
|
|
datas: {
|
|
- area: String,
|
|
|
|
- industry: String,
|
|
|
|
- infotypes: String,
|
|
|
|
- projectmatch: Boolean,
|
|
|
|
- buyclassmatch: Boolean,
|
|
|
|
- mathway: Number
|
|
|
|
|
|
+ areaStr: String,
|
|
|
|
+ buyClassStr: String,
|
|
|
|
+ infoTypeStr: String,
|
|
|
|
+ projectmatch: Number,
|
|
|
|
+ buyclassmatch: Number,
|
|
|
|
+ mathway: Number,
|
|
|
|
+ areaObj: Object,
|
|
|
|
+ buyClassArr: Array,
|
|
|
|
+ infoTypeArr: Array
|
|
}
|
|
}
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
@@ -90,7 +148,11 @@ export default {
|
|
[Input.name]: Input,
|
|
[Input.name]: Input,
|
|
[RadioGroup.name]: RadioGroup,
|
|
[RadioGroup.name]: RadioGroup,
|
|
[Radio.name]: Radio,
|
|
[Radio.name]: Radio,
|
|
- [Button.name]: Button
|
|
|
|
|
|
+ [Button.name]: Button,
|
|
|
|
+ [Dialog.name]: Dialog,
|
|
|
|
+ AreaSelect,
|
|
|
|
+ BuyClassSelect,
|
|
|
|
+ InfoTypeSelect
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
@@ -101,44 +163,119 @@ export default {
|
|
unitSwitch: {
|
|
unitSwitch: {
|
|
loading: false,
|
|
loading: false,
|
|
disabled: false
|
|
disabled: false
|
|
|
|
+ },
|
|
|
|
+ dialog: {
|
|
|
|
+ area: false,
|
|
|
|
+ buyClass: false,
|
|
|
|
+ infoType: false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- mounted () {},
|
|
|
|
|
|
+ mounted () {
|
|
|
|
+ console.log(this.datas.areaStr, 'str')
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
- switchProject (state) {
|
|
|
|
|
|
+ // 切换项目匹配按钮
|
|
|
|
+ switchProjectMatch (event) {
|
|
|
|
+ console.log(event)
|
|
this.projectSwitch.loading = true
|
|
this.projectSwitch.loading = true
|
|
this.projectSwitch.disabled = true
|
|
this.projectSwitch.disabled = true
|
|
- setTimeout(() => {
|
|
|
|
- this.form.matchProject = state
|
|
|
|
- this.projectSwitch.loading = false
|
|
|
|
- this.projectSwitch.disabled = false
|
|
|
|
- }, 1000)
|
|
|
|
|
|
+ updateProjectMatch({
|
|
|
|
+ projectmatch: event
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if (res.data.status === 1) {
|
|
|
|
+ this.$emit('update')
|
|
|
|
+ this.projectSwitch.loading = false
|
|
|
|
+ this.projectSwitch.disabled = false
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '切换成功',
|
|
|
|
+ type: 'success'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- switchUnit (state) {
|
|
|
|
|
|
+ // 切换其他采购单位按钮
|
|
|
|
+ switchOtherUnit (state) {
|
|
this.unitSwitch.loading = true
|
|
this.unitSwitch.loading = true
|
|
this.unitSwitch.disabled = true
|
|
this.unitSwitch.disabled = true
|
|
- setTimeout(() => {
|
|
|
|
- this.form.otherUnit = state
|
|
|
|
- this.unitSwitch.loading = false
|
|
|
|
- this.unitSwitch.disabled = false
|
|
|
|
- this.$message({
|
|
|
|
- message: '切换成功',
|
|
|
|
- type: 'success'
|
|
|
|
- })
|
|
|
|
- }, 1000)
|
|
|
|
|
|
+ updateOtherBuyClass({
|
|
|
|
+ otherbuyclass: state
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if (res.data.status === 1) {
|
|
|
|
+ this.$emit('update')
|
|
|
|
+ this.unitSwitch.loading = false
|
|
|
|
+ this.unitSwitch.disabled = false
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '切换成功',
|
|
|
|
+ type: 'success'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
- chooseMathWay (name) {
|
|
|
|
- this.form.mathWay = name
|
|
|
|
|
|
+ chooseMathWay (state) {
|
|
|
|
+ console.log(state)
|
|
|
|
+ updateMatchType({
|
|
|
|
+ matchtype: state
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if (res.data.status === 1) {
|
|
|
|
+ this.$emit('update')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 添加附加词
|
|
// 添加附加词
|
|
addAttachWordsFn () {
|
|
addAttachWordsFn () {
|
|
this.attachWordsData.push('')
|
|
this.attachWordsData.push('')
|
|
|
|
+ },
|
|
|
|
+ // 保存区域修改数据
|
|
|
|
+ saveAreaData (data) {
|
|
|
|
+ updateArea(data).then((res) => {
|
|
|
|
+ if (res.data.status === 1) {
|
|
|
|
+ this.$emit('update')
|
|
|
|
+ this.dialog.area = false
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '修改失败',
|
|
|
|
+ type: 'error'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 保存采购单位行业数据
|
|
|
|
+ saveBuyClassData (data) {
|
|
|
|
+ updateBuyClass({
|
|
|
|
+ buyclass: data
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if (res.data.status === 1) {
|
|
|
|
+ this.$emit('update')
|
|
|
|
+ this.dialog.buyClass = false
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '修改失败',
|
|
|
|
+ type: 'error'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 保存采购单位行业数据
|
|
|
|
+ saveInfoTypeData (data) {
|
|
|
|
+ updateInfoType({
|
|
|
|
+ infotype: data
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ if (res.data.status === 1) {
|
|
|
|
+ this.$emit('update')
|
|
|
|
+ this.dialog.infoType = false
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '修改失败',
|
|
|
|
+ type: 'error'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
-<style lang="scss" scoped>
|
|
|
|
|
|
+<style lang="scss">
|
|
.subscribe{
|
|
.subscribe{
|
|
.sub-title{
|
|
.sub-title{
|
|
padding-bottom: 8px;
|
|
padding-bottom: 8px;
|
|
@@ -194,7 +331,7 @@ export default {
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
}
|
|
}
|
|
// element-ui样式修改
|
|
// element-ui样式修改
|
|
- ::v-deep.el-input__inner{
|
|
|
|
|
|
+ .my .el-input__inner{
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
color: #2cb7ca;
|
|
color: #2cb7ca;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
@@ -202,21 +339,21 @@ export default {
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
border-color: #ececec;
|
|
border-color: #ececec;
|
|
}
|
|
}
|
|
- .item-other-value ::v-deep.el-loading-spinner .circular{
|
|
|
|
|
|
+ .my .el-loading-spinner .circular{
|
|
width: 22px;
|
|
width: 22px;
|
|
height: 22px;
|
|
height: 22px;
|
|
}
|
|
}
|
|
- .item-other-value ::v-deep.el-loading-spinner{
|
|
|
|
|
|
+ .my .el-loading-spinner{
|
|
margin-top: -11px;
|
|
margin-top: -11px;
|
|
}
|
|
}
|
|
- ::v-deep .el-input.is-disabled .el-input__inner{
|
|
|
|
|
|
+ .my .el-input__inner{
|
|
background: #fff;
|
|
background: #fff;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
- ::v-deep .el-switch{
|
|
|
|
|
|
+ .my .el-switch{
|
|
position: relative;
|
|
position: relative;
|
|
}
|
|
}
|
|
- ::v-deep .el-switch__label--left {
|
|
|
|
|
|
+ .my .el-switch__label--left {
|
|
position: absolute;
|
|
position: absolute;
|
|
left: 6px;
|
|
left: 6px;
|
|
top: 0;
|
|
top: 0;
|
|
@@ -224,7 +361,7 @@ export default {
|
|
z-index: 9;
|
|
z-index: 9;
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
}
|
|
}
|
|
- ::v-deep .el-switch__label--right {
|
|
|
|
|
|
+ .my .el-switch__label--right {
|
|
position: absolute;
|
|
position: absolute;
|
|
right: 6px;
|
|
right: 6px;
|
|
top: 0;
|
|
top: 0;
|
|
@@ -232,29 +369,29 @@ export default {
|
|
z-index: 9;
|
|
z-index: 9;
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
}
|
|
}
|
|
- ::v-deep.el-switch__label *{
|
|
|
|
|
|
+ .my .el-switch__label *{
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
}
|
|
}
|
|
- ::v-deep.el-switch,::v-deep.el-switch__core{
|
|
|
|
|
|
+ .my .el-switch,.my .el-switch__core{
|
|
height: 22px;
|
|
height: 22px;
|
|
line-height: 22px;
|
|
line-height: 22px;
|
|
}
|
|
}
|
|
- ::v-deep.el-switch__core:after{
|
|
|
|
|
|
+ .my .el-switch__core:after{
|
|
width: 18px;
|
|
width: 18px;
|
|
height: 18px;
|
|
height: 18px;
|
|
}
|
|
}
|
|
- ::v-deep .el-switch.is-checked .el-switch__core::after{
|
|
|
|
- margin-left: -18px;
|
|
|
|
|
|
+ .el-switch.is-checked .el-switch__core::after{
|
|
|
|
+ margin-left: -18px!important;
|
|
}
|
|
}
|
|
- ::v-deep.el-radio{
|
|
|
|
|
|
+ .my .el-radio{
|
|
color: #1d1d1d;
|
|
color: #1d1d1d;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
}
|
|
}
|
|
- ::v-deep.el-radio__inner{
|
|
|
|
|
|
+ .my .el-radio__inner{
|
|
width: 20px;
|
|
width: 20px;
|
|
height: 20px;
|
|
height: 20px;
|
|
}
|
|
}
|
|
- ::v-deep .el-radio__input.is-checked .el-radio__inner{
|
|
|
|
|
|
+ .my .el-radio__input.is-checked .el-radio__inner{
|
|
border: 0;
|
|
border: 0;
|
|
background: transparent;
|
|
background: transparent;
|
|
width: 20px;
|
|
width: 20px;
|
|
@@ -262,14 +399,17 @@ export default {
|
|
background: url('~@/assets/images/icon-checked.png') no-repeat center center;
|
|
background: url('~@/assets/images/icon-checked.png') no-repeat center center;
|
|
background-size: contain;
|
|
background-size: contain;
|
|
}
|
|
}
|
|
- ::v-deep.el-radio__inner::after{
|
|
|
|
|
|
+ .my .el-radio__inner::after{
|
|
background: transparent;
|
|
background: transparent;
|
|
}
|
|
}
|
|
- ::v-deep.el-radio__input.is-checked+.el-radio__label{
|
|
|
|
|
|
+ .my .el-radio__input.is-checked+.el-radio__label{
|
|
color: #1d1d1d;
|
|
color: #1d1d1d;
|
|
}
|
|
}
|
|
- ::v-deep.el-radio__inner:hover{
|
|
|
|
|
|
+ .my .el-radio__inner:hover{
|
|
border-color: #ececec;
|
|
border-color: #ececec;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.sub-dialog .el-dialog__header,.sub-dialog .el-dialog__body{
|
|
|
|
+ padding: 0;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|