projectCheckRule.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <div>
  3. <el-button size="small" style="width:120px" type="primary" @click="querySite_Parameter">{{ $t('设 置') }}</el-button>
  4. <el-dialog :title="$t(`项目查重规则`)" append-to-body :visible.sync="dialogEditVisible" width="860px">
  5. <el-row :gutter="16">
  6. <el-col :span="24" style="margin-top: -20px">
  7. <span style="color: red">{{ $t('注意:每层的查重条件可多选字段') }}</span>
  8. </el-col>
  9. <el-col :span="24" style="margin-top: 20px">
  10. <div>
  11. <span style="margin-right: 10px">{{$t(`项目名称查重排除文字`)}}:</span>
  12. <el-tooltip placement="top" style="margin-right: 10px">
  13. <div slot="content">{{$t('项目名称查重排除文字,是项目名称查重前提条件之一,设置的文字,是项目名称查重时需排除掉的文字。')}}<br>{{$t('项目名称查重需先排除设置文字后,再将名称剩下的文字进行查重。')}}</div>
  14. <img style="vertical-align: middle" width="14px" height="14px" src="../../../../assets/icons/prompt_icon.svg" >
  15. </el-tooltip>
  16. <el-tag v-for="(item,index) in projectnameexcludefields" :key="index" style="margin-right: 10px" class="mt-10" closable @close="tagDel(item,index)">{{item}}</el-tag>
  17. <el-button type="primary" size="mini" @click="setWordVisible = true">{{$t(`添加`)}}</el-button>
  18. </div>
  19. </el-col>
  20. <el-col :span="24" style="margin-top: 20px">
  21. <span style="margin-right: 10px">{{$t(`查重字符数`)}}:</span>
  22. <el-input v-model="projectrepeatnum" style="width: 200px;margin-right: 10px" :placeholder="$t(`设置查重字符数`)" size="small"></el-input>
  23. <el-tooltip placement="top">
  24. <div slot="content">{{$t('查重字符数,是项目名称查重判断依据之一,项目名称排除设置文字后,剩下的文字进行项目名称查重,若重复的文字 ≥ 查重字符数,则判断该项目名称重复。')}}</div>
  25. <img style="vertical-align: middle" width="14px" height="14px" src="../../../../assets/icons/prompt_icon.svg" >
  26. </el-tooltip>
  27. </el-col>
  28. <el-col :span="24" style="margin-top: 20px">
  29. <div style="width: 50px" class="inline-16">
  30. {{ $t('第一层') }}:
  31. </div>
  32. <div style="width: 580px;" class="inline-16" >
  33. <el-select v-model="fields1" multiple :placeholder="$t(`请选择字段`)" style="width: 100%" size="mini">
  34. <el-option
  35. v-for="item in options"
  36. :key="item.column_name"
  37. :label="$t(item.column_name)"
  38. :value="item.column_name">
  39. <span style="float: left">{{ $t(item.column_name) }}</span>
  40. <span style="float: right; color: #8492a6; font-size: 12px">{{ item.column_comment?$t(item.column_comment):'' }}</span>
  41. </el-option>
  42. </el-select>
  43. </div>
  44. <div style="width: 100px;" class="inline-16" >
  45. <el-select v-model="factor1" :placeholder="$t('请选择')" style="width: 100%" size="mini">
  46. <el-option
  47. v-for="item in relations"
  48. :key="item.value"
  49. :label="$t(item.label)"
  50. :value="item.value">
  51. </el-option>
  52. </el-select>
  53. </div>
  54. <div style="width: 50px" class="inline-16">
  55. {{ $t('关系') }}
  56. </div>
  57. </el-col>
  58. <el-col :span="24" style="margin-top: 20px">
  59. <div style="width: 50px" class="inline-16">
  60. {{ $t('第二层') }}:
  61. </div>
  62. <div style="width: 580px;" class="inline-16" >
  63. <el-select v-model="fields2" multiple :placeholder="$t(`请选择字段`)" style="width: 100%" size="mini">
  64. <el-option
  65. v-for="item in options"
  66. :key="item.column_name"
  67. :label="$t(item.column_name)"
  68. :value="item.column_name">
  69. <span style="float: left">{{ $t(item.column_name) }}</span>
  70. <span style="float: right; color: #8492a6; font-size: 12px">{{ item.column_comment?$t(item.column_comment):'' }}</span>
  71. </el-option>
  72. </el-select>
  73. </div>
  74. <div style="width: 100px;" class="inline-16" >
  75. <el-select v-model="factor2" :placeholder="$t('请选择')" style="width: 100%" size="mini">
  76. <el-option
  77. v-for="item in relations"
  78. :key="item.value"
  79. :label="$t(item.label)"
  80. :value="item.value">
  81. </el-option>
  82. </el-select>
  83. </div>
  84. <div style="width: 50px" class="inline-16">
  85. {{ $t('关系') }}
  86. </div>
  87. </el-col>
  88. <el-col :span="24" style="margin-top: 20px">
  89. <div style="width: 50px" class="inline-16">
  90. {{ $t('第三层') }}:
  91. </div>
  92. <div style="width: 580px;" class="inline-16" >
  93. <el-select v-model="fields3" multiple :placeholder="$t(`请选择字段`)" style="width: 100%" size="mini">
  94. <el-option
  95. v-for="item in options"
  96. :key="item.column_name"
  97. :label="$t(item.column_name)"
  98. :value="item.column_name">
  99. <span style="float: left">{{ $t(item.column_name) }}</span>
  100. <span style="float: right; color: #8492a6; font-size: 12px">{{ item.column_comment?$t(item.column_comment):'' }}</span>
  101. </el-option>
  102. </el-select>
  103. </div>
  104. <div style="width: 100px;" class="inline-16" >
  105. <el-select v-model="factor3" :placeholder="$t('请选择')" style="width: 100%" size="mini">
  106. <el-option
  107. v-for="item in relations"
  108. :key="item.value"
  109. :label="$t(item.label)"
  110. :value="item.value">
  111. </el-option>
  112. </el-select>
  113. </div>
  114. <div style="width: 50px" class="inline-16">
  115. {{ $t('关系') }}
  116. </div>
  117. </el-col>
  118. <el-col :span="24" style="margin-top: 20px">
  119. <span >{{ $t('项目报备成功保护期设置') }}:</span>
  120. </el-col>
  121. <el-col :span="24" style="margin-top: 20px">
  122. <div style="width: 50px" class="inline-16">
  123. {{ $t('保护期') }}:
  124. </div>
  125. <div style="width: 580px;" class="inline-16" >
  126. <el-select v-model="projectprotectionperiod" :placeholder="$t('请选择')" style="width: 100%" size="mini">
  127. <el-option
  128. v-for="item in monthOption"
  129. :key="item.value"
  130. :label="$t(item.label)"
  131. :value="item.value">
  132. </el-option>
  133. </el-select>
  134. </div>
  135. <div style="width: 50px" class="inline-16">
  136. {{ $t('个月') }}
  137. </div>
  138. </el-col>
  139. <el-col :span="24" style="margin-top: 20px">
  140. <span style="color: red">{{$t('项目保护期设为0,则不管控保护期;为1-12,则为保护期限')}};</span>
  141. </el-col>
  142. </el-row>
  143. <div class="dialog-footer">
  144. <el-button size="small" @click="dialogEditVisible = false" class="normal-btn-width">{{$t('取 消')}}</el-button>
  145. <el-button size="small" type="warning" class="normal-btn-width btn-warning" @click="onSubmit">{{$t('确 定')}}</el-button>
  146. </div>
  147. </el-dialog>
  148. <el-dialog :title="$t(`添加文字`)" append-to-body :visible.sync="setWordVisible" width="560px" :show-close="false">
  149. <div style="margin: auto">
  150. <span>{{$t(`排除文字`)}}:</span>
  151. <el-input style="width: 450px" v-model="exclude" placeholder="请输入内容"></el-input>
  152. </div>
  153. <div class="dialog-footer">
  154. <el-button size="small" @click="setWordVisible = false;exclude = ''" class="normal-btn-width">{{$t('取 消')}}</el-button>
  155. <el-button size="small" type="primary" class="normal-btn-width" @click="onExclude">{{$t('确 定')}}</el-button>
  156. </div>
  157. </el-dialog>
  158. </div>
  159. </template>
  160. <script>
  161. export default {
  162. name: "customerCheckRule",
  163. data(){
  164. return {
  165. dialogEditVisible:false,
  166. setWordVisible:false,
  167. monthOption:[
  168. {
  169. value:'0',
  170. label: '0'
  171. },
  172. {
  173. value:'1',
  174. label: '1'
  175. },
  176. {
  177. value:'2',
  178. label: '2'
  179. },
  180. {
  181. value:'3',
  182. label: '3'
  183. },
  184. {
  185. value:'4',
  186. label: '4'
  187. },
  188. {
  189. value:'5',
  190. label: '5'
  191. },
  192. {
  193. value:'6',
  194. label: '6'
  195. },
  196. {
  197. value:'7',
  198. label: '7'
  199. },
  200. {
  201. value:'8',
  202. label: '8'
  203. },
  204. {
  205. value:'9',
  206. label: '9'
  207. },
  208. {
  209. value:'10',
  210. label: '10'
  211. },
  212. {
  213. value:'11',
  214. label: '11'
  215. },
  216. {
  217. value:'12',
  218. label: '12'
  219. }
  220. ],
  221. projectprotectionperiod:'0',
  222. options: [],
  223. fields1: [],
  224. fields2: [],
  225. fields3: [],
  226. factor1:'并且',
  227. factor2:'并且',
  228. factor3:'并且',
  229. relations: [
  230. {
  231. value:'and',
  232. label: this.$t('并且')
  233. },
  234. {
  235. value:'or',
  236. label: this.$t('或者')
  237. }
  238. ],
  239. relation:'',
  240. exclude:'',
  241. projectnameexcludefields:[],
  242. projectrepeatnum:0
  243. }
  244. },
  245. methods:{
  246. querySite_Parameter(){
  247. this.dialogEditVisible = true
  248. this.relation = this.relations[0].value
  249. this.queryTable()
  250. this.queryRule()
  251. },
  252. async queryTable(){
  253. const res = await this.$api.requested({
  254. "classname": "sysmanage.develop.optiontype.optiontype",
  255. "method": "optiontypeselect",
  256. "content": {
  257. "pageNumber": 1,
  258. "pageSize": 50,
  259. "typename": "tablecolumnselect",
  260. "parameter": {
  261. "table_name": "sa_project"
  262. }
  263. }
  264. })
  265. this.options = res.data
  266. },
  267. async onSubmit(){
  268. const res = await this.$api.requested({
  269. "id": "20230408091702",
  270. "content": {
  271. "projectcheckrule": {
  272. "fields1": this.fields1,
  273. "factor1": this.factor1,
  274. "fields2":this.fields2,
  275. "factor2": this.factor2,
  276. "fields3":this.fields3,
  277. "factor3": this.factor3
  278. },
  279. "projectprotectionperiod":this.projectprotectionperiod,
  280. "projectnameexcludefields":this.projectnameexcludefields,
  281. "projectrepeatnum":this.projectrepeatnum
  282. },
  283. })
  284. this.tool.showMessage(res,()=>{
  285. this.$emit('queryRule')
  286. this.dialogEditVisible = false
  287. this.fields1 = []
  288. this.fields2 = []
  289. this.fields3 = []
  290. this.projectprotectionperiod = 0
  291. this.projectrepeatnum = 0
  292. })
  293. },
  294. onClose(){
  295. this.dialogEditVisible = false
  296. this.fields1 = []
  297. this.fields2 = []
  298. this.fields3 = []
  299. },
  300. /*查重规则*/
  301. async queryRule(){
  302. this.projectnameexcludefields = []
  303. const res = await this.$api.requested({
  304. "id": "20230410090502",
  305. "content": {},
  306. })
  307. this.fields1 = res.data.projectcheckrule.fields1
  308. this.fields2 = res.data.projectcheckrule.fields2
  309. this.fields3 = res.data.projectcheckrule.fields3
  310. this.factor1 = res.data.projectcheckrule.factor1
  311. this.factor2 = res.data.projectcheckrule.factor2
  312. this.factor3 = res.data.projectcheckrule.factor3
  313. this.projectprotectionperiod= res.data.projectprotectionperiod
  314. this.projectrepeatnum = res.data.projectrepeatnum
  315. this.projectnameexcludefields = res.data.projectnameexcludefields?res.data.projectnameexcludefields:[]
  316. },
  317. /*设置排除文字*/
  318. onExclude(){
  319. this.projectnameexcludefields.push(this.exclude)
  320. this.setWordVisible = false
  321. this.exclude = ''
  322. },
  323. tagDel(val,index){
  324. this.projectnameexcludefields.splice(index,1)
  325. }
  326. }
  327. }
  328. </script>
  329. <style scoped>
  330. /deep/ .el-message-box--center .el-message-box__title {
  331. position: relative;
  332. display: flex;
  333. align-items: normal;
  334. justify-content: left !important;
  335. }
  336. </style>