index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <!--
  2. * @Author: your name
  3. * @Date: 2021-11-17 13:43:58
  4. * @LastEditTime: 2021-11-17 13:43:59
  5. * @LastEditors: Please set LastEditors
  6. * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  7. * @FilePath: \CABaggageData\src\views\dashboard\views\info.vue
  8. -->
  9. <template>
  10. <div class="airportInfo">
  11. <DataTable data-id="4" :rows="12" labelWidth="100px" :minHeight="84" width="800px" />
  12. <!--删除弹框-->
  13. <Dialog :flag="flag">
  14. <div class="airportInfoDialog">
  15. <div class="del-title">删除分类信息</div>
  16. <div class="content er">
  17. <div class="log"></div>
  18. 是否确认删除
  19. <p style="color: #eb2f3b; margin-top: 0px; margin-bottom: 0px">
  20. {{ rmObj.name }}
  21. </p>
  22. </div>
  23. <div class="DelFoot right t30">
  24. <el-button size="medium" @click="remove()" class="r25 buwitch" type="danger">删除</el-button>
  25. <el-button size="medium" class="r26" @click="flag = false">取消</el-button>
  26. </div>
  27. </div>
  28. </Dialog>
  29. </div>
  30. </template>
  31. <script>
  32. import Search from "@/layout/components/Search/index.vue";
  33. import Dialog from "@/layout/components/Dialog/index.vue";
  34. import { findarrays } from "@/utils/validate";
  35. import { AirlinesInquiry } from "@/api/SystemSettings";
  36. import { exceptiontype, exceptionadd, exceptiondel } from "@/api/acquisition";
  37. import { GeneralDataReception, Query } from "@/api/dataIntegration";
  38. import DataTable from "@/components/Table";
  39. export default {
  40. name: "queryTemplate",
  41. components: { Search, Dialog, DataTable },
  42. data () {
  43. return {
  44. arr: [
  45. {
  46. typeName: "名称",
  47. typeCode: "测试",
  48. },
  49. ], //内容数据
  50. flag: false, //删除弹框开关
  51. addFlag: false, //新增机场信息弹框开关
  52. EditFlag: false,
  53. ids: null,
  54. idss: null,
  55. listDate: {},
  56. rmObj: {
  57. //删除内容
  58. name: "",
  59. },
  60. ruleForm: {
  61. //新增机场信息表单
  62. name: "",
  63. fullName: "",
  64. code: "",
  65. },
  66. EditForm: {
  67. name: "",
  68. fullName: "",
  69. code: "",
  70. },
  71. rules: {
  72. //新增机场信息表单验证
  73. name: [{ required: true, message: "请输入航司简称", trigger: "blur" }],
  74. fullName: [
  75. { required: true, message: "请输入航司全称", trigger: "blur" },
  76. ],
  77. code: [
  78. { required: true, message: "请输入航司二字码", trigger: "blur" },
  79. ],
  80. },
  81. modid: "",
  82. };
  83. },
  84. created () {
  85. // this.getAirlines();
  86. // this.exceptionlist();
  87. },
  88. computed: {
  89. serachBox () {
  90. if (this.searchInfo) {
  91. return this.arr.filter((data) => {
  92. return Object.keys(data).some((key) => {
  93. return (
  94. String(data[key]).toLowerCase().indexOf(this.searchInfo) > -1
  95. );
  96. });
  97. });
  98. }
  99. return this.arr;
  100. },
  101. },
  102. methods: {
  103. //异常列表查询
  104. async exceptionlist () {
  105. let params = {
  106. id: "",
  107. };
  108. const result = await exceptiontype(params);
  109. if (result.code == 0) {
  110. this.arr = result.returnData;
  111. }
  112. },
  113. //搜索
  114. getSearchData (val) {
  115. let that = this;
  116. that.exceptionlist().then(function (data) {
  117. if (val) {
  118. that.arr = findarrays(that.arr, "typeName", val);
  119. } else {
  120. that.exceptionlist();
  121. }
  122. });
  123. //
  124. },
  125. //删除信息
  126. handleMove (item) {
  127. this.listDate = item;
  128. this.flag = true;
  129. this.rmObj = {
  130. name: item.queryTemplateName,
  131. };
  132. },
  133. airEdit (item) {
  134. // this.modid = item;
  135. // this.EditForm.name = item.typeName;
  136. // this.EditForm.fullName = item.typeCode;
  137. this.$router.push({
  138. path: "/systemSettings/queryTemplateedit",
  139. query: {
  140. queryTemplateName: item.queryTemplateName,
  141. protocolID: item.protocolID,
  142. queryTemplateDescribe: item.queryTemplateDescribe,
  143. queryTemplatetConfig: item.queryTemplatetConfig,
  144. queryTemplate: item.queryTemplate,
  145. },
  146. });
  147. // this.EditForm.code = item.code2;
  148. // this.EditFlag = true;
  149. },
  150. async EditSubmit () {
  151. let arr = 0;
  152. this.$refs["ruleFormall"].validate((valid) => {
  153. if (valid) {
  154. arr = 1;
  155. } else {
  156. arr = 0;
  157. return false;
  158. }
  159. });
  160. if (arr == 1) {
  161. let params = {
  162. id: this.modid.id,
  163. typeName: this.EditForm.name,
  164. typeCode: this.EditForm.fullName,
  165. };
  166. const result = await exceptionadd(params);
  167. if (result.code == 0) {
  168. this.$message.success("成功");
  169. this.exceptionlist();
  170. this.$refs.ruleFormall.resetFields();
  171. }
  172. this.EditFlag = false;
  173. }
  174. },
  175. closeForm () {
  176. this.$refs.ruleForm.resetFields();
  177. },
  178. //获取模板列表
  179. async getAirlines () {
  180. try {
  181. const res = await Query({
  182. id: 77,
  183. dataContent: [],
  184. });
  185. if (res.code === "0") {
  186. this.arr = res.returnData;
  187. } else {
  188. this.$message.error(res.message ?? "失败");
  189. }
  190. } catch (error) {
  191. this.$message.error("失败");
  192. }
  193. },
  194. //新增机场信息-弹框
  195. handleAdd () {
  196. this.$router.push("/systemSettings/queryTemplateadd");
  197. },
  198. //新增机场信息-弹框-取消
  199. resetForm () {
  200. this.addFlag = false;
  201. this.EditFlag = false;
  202. this.ruleForm.name = "";
  203. this.ruleForm.fullName = "";
  204. this.$refs.ruleForms.resetFields();
  205. this.$refs.ruleFormall.resetFields();
  206. },
  207. //删除
  208. async remove (data) {
  209. this.listDate.operate = "3";
  210. try {
  211. const res = await GeneralDataReception({
  212. serviceId: "20",
  213. dataContent: JSON.stringify(this.listDate),
  214. });
  215. if (res.code === "0") {
  216. this.$message.success(res.message ?? "成功");
  217. this.flag = false;
  218. this.listDate = {};
  219. this.getAirlines();
  220. } else {
  221. this.$message.error(res.message ?? "失败");
  222. }
  223. } catch (error) {
  224. this.$message.error("失败");
  225. }
  226. },
  227. },
  228. };
  229. </script>
  230. <style lang="scss" scoped>
  231. .airportInfo {
  232. padding: 0 10px;
  233. .log {
  234. width: 26px;
  235. height: 26px;
  236. background: #eb2f3b;
  237. border-radius: 50%;
  238. margin-right: 15px;
  239. background: url("../../assets/index/ic_close_hint.png") no-repeat;
  240. background-size: 100% 100%;
  241. }
  242. .er {
  243. display: flex;
  244. align-items: center;
  245. }
  246. .airportInfo-search {
  247. margin: 40px 0 30px 0;
  248. }
  249. .airportInfo-content {
  250. img {
  251. margin: 0 auto;
  252. margin-top: 10%;
  253. display: -webkit-box;
  254. -webkit-box-pack: center;
  255. -webkit-box-align: center;
  256. -webkit-box-orient: vertical;
  257. text-align: center;
  258. }
  259. .grid-content {
  260. height: 144px;
  261. padding: 24px;
  262. margin-bottom: 24px;
  263. .title {
  264. font-size: 16px;
  265. font-family: Microsoft YaHei;
  266. font-weight: bold;
  267. color: #303133;
  268. white-space: nowrap;
  269. overflow: hidden;
  270. text-overflow: ellipsis;
  271. max-width: 150px;
  272. }
  273. .edit_log {
  274. position: relative;
  275. // top: -2px;
  276. }
  277. .icon {
  278. cursor: pointer;
  279. }
  280. .desc {
  281. font-size: 14px;
  282. font-family: Microsoft YaHei;
  283. font-weight: 400;
  284. color: #101116;
  285. margin-top: 60px;
  286. }
  287. }
  288. }
  289. }
  290. </style>