FormCollection.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <div class="formcollection-all">
  3. <el-dialog width="500px" title="表单收集详情" :visible.sync="formcollectionVisible">
  4. <div v-for="(item,index) in controlarr" :key="index" class="formcollection-info">
  5. <div class="formcollection-info-title">{{ item.fieldName }}:</div>
  6. <div v-if="item.fieldName=='出访国家(地、区)'||item.fieldName=='涉及城市'" class="formcollection-info-text">
  7. <span v-for="(items,index) in item.newValue" :key="index">{{items+','}}</span>
  8. </div>
  9. <div v-else class="formcollection-info-text">{{ item.newValue }}</div>
  10. </div>
  11. <div slot="footer" class="dialog-footer">
  12. <el-button @click="formcollectionVisible = false">取 消</el-button>
  13. <el-button type="primary" @click="formcollectionVisible = false">确 定</el-button>
  14. </div>
  15. </el-dialog>
  16. <div style="padding: 10px;">
  17. <div class="formcollection-title">表单收集列表</div>
  18. <div class="formcollection-search">
  19. <el-input style="width: 250px;" placeholder="请输入内容" v-model="input" clearable>
  20. </el-input>
  21. </div>
  22. <div class="formcollection-table">
  23. <el-table :data="tableData" border style="width: 100%">
  24. <el-table-column prop="name" label="表单名称" width="180">
  25. </el-table-column>
  26. <el-table-column prop="unitName" label="团队名称">
  27. </el-table-column>
  28. <el-table-column prop="visitDays" label="出访天数" width="180">
  29. </el-table-column>
  30. <el-table-column prop="visiPpNum" label="出访人数" width="180">
  31. </el-table-column>
  32. <el-table-column prop="visitCountrys" label="出访国家" width="180">
  33. </el-table-column>
  34. <el-table-column prop="operator" label="创建人" width="80">
  35. </el-table-column>
  36. <el-table-column prop="operationTime" label="创建时间" width="180">
  37. </el-table-column>
  38. <el-table-column label="操作" width="400">
  39. <template slot-scope="scope">
  40. <el-button v-for="(item,index) in scope.row.versionDetails"
  41. @click="GroupOrderPreInfo(scope.row.id,item.id)" :key="index" :disabled="item.isNull"
  42. size="mini" type="primary">{{item.name}}</el-button>
  43. </template>
  44. </el-table-column>
  45. </el-table>
  46. <div class="block">
  47. <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
  48. :current-page="currentPage" :page-sizes="[10,15, 20]" :page-size="pagesize"
  49. layout="total, sizes, prev, pager, next, jumper" :total="fctotal">
  50. </el-pagination>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </template>
  56. <script>
  57. export default {
  58. data () {
  59. return {
  60. input: '',
  61. tableData: [{
  62. id: 4,
  63. name: '安卓测试',
  64. unitName: '',
  65. visitDays: 0,
  66. visiPpNum: 0,
  67. operator: '舒庆',
  68. operationTime: '2025-02-21 17:34:42'
  69. }, {
  70. id: 3,
  71. name: '安卓测试',
  72. unitName: '',
  73. visitDays: 0,
  74. visiPpNum: 0,
  75. operator: '舒庆',
  76. operationTime: '2025-02-21 17:34:42'
  77. }, {
  78. id: 2,
  79. name: '安卓测试',
  80. unitName: '',
  81. visitDays: 0,
  82. visiPpNum: 0,
  83. operator: '舒庆',
  84. operationTime: '2025-02-21 17:34:42'
  85. }, {
  86. id: 1,
  87. name: '安卓测试',
  88. unitName: '',
  89. visitDays: 0,
  90. visiPpNum: 0,
  91. operator: '舒庆',
  92. operationTime: '2025-02-21 17:34:42'
  93. }],
  94. currentPage:1,
  95. pagesize:10,
  96. fctotal:0,
  97. formcollectionVisible:false,
  98. controlarr:[],
  99. }
  100. },
  101. methods:{
  102. handleSizeChange(val) {
  103. this.pagesize=val;
  104. this.GroupOrderPreInfoList()
  105. console.log(`每页 ${val} 条`);
  106. },
  107. handleCurrentChange(val) {
  108. this.currentPage=val;
  109. this.GroupOrderPreInfoList()
  110. console.log(`当前页: ${val}`);
  111. },
  112. //获取团组
  113. GroupOrderPreInfoList() {
  114. this.tableData=[];
  115. var url = "/api/Groups/GroupOrderPreInfoList"
  116. var that = this
  117. this.$axios({
  118. method: 'post',
  119. url: url,
  120. headers: {
  121. Authorization: 'Bearer '
  122. },
  123. data: {
  124. portType: 1,
  125. pageIndex: that.currentPage,
  126. pageSize: that.pagesize,
  127. search:that.input,
  128. }
  129. }).then(function (res) {
  130. if (res.data.code == 200) {
  131. that.tableData=res.data.data;
  132. that.fctotal=res.data.count;
  133. }else{
  134. that.$message.error(res.data.msg);
  135. }
  136. }).catch(function (error) {
  137. that.$message.error("获取团组失败");
  138. });
  139. },
  140. //获取表单
  141. GroupOrderPreInfo(formid,tempId) {
  142. this.formcollectionVisible=true;
  143. this.controlarr=[];
  144. var url = "/api/Groups/GroupOrderPreInfo/"+formid+"/"+tempId
  145. var that = this
  146. this.$axios({
  147. method: 'get',
  148. url: url,
  149. }).then(function (res) {
  150. if (res.data.code==200) {
  151. that.controlarr=res.data.data.items;
  152. }else{
  153. that.$message.error(res.data.msg);
  154. }
  155. })
  156. },
  157. },
  158. mounted(){
  159. this.GroupOrderPreInfoList();
  160. }
  161. }
  162. </script>
  163. <style>
  164. .formcollection-all{
  165. background-color: #fff;
  166. box-shadow: 0 0 5px #0005;
  167. border-radius: 10px;
  168. height: 100%;
  169. min-height: 830px;
  170. }
  171. .formcollection-title{
  172. font-size: 17px;
  173. font-weight: 600;
  174. }
  175. .formcollection-search{
  176. margin-top:10px ;
  177. }
  178. .formcollection-table{
  179. margin-top:10px ;
  180. }
  181. .formcollection-table .block{
  182. margin-top: 10px;
  183. text-align: center;
  184. }
  185. .formcollection-info{
  186. display: flex;
  187. justify-content: space-between;
  188. margin-top: 10px;
  189. }
  190. .formcollection-info-title{
  191. font-weight: 600;
  192. }
  193. </style>