index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <basicLayout
  3. ref="basicLayout"
  4. :oldFormPath="{
  5. add: 'optionSystem/executeManage/modules',
  6. }"
  7. tableName="executeTable"
  8. idName="itemid"
  9. ownertable="plm_item"
  10. :apiId="{ query: 2024060514063602, del: 2024060514040602 }"
  11. :detailPath="{
  12. path: '/executeDetail',
  13. }"
  14. :isExport="false"
  15. >
  16. <template #titleRight>
  17. <ImportFile
  18. :templateParam="{ id: 20240618111502, content: {} }"
  19. title="执行器"
  20. @onSuccess="bindImport"
  21. :errorUrl="errorUrl"
  22. @clearUrl="errorUrl = null"
  23. v-if="tool.checkAuth($route.name,'importFile')"
  24. ></ImportFile>
  25. </template>
  26. <template #custom>
  27. <div class="mt-10">
  28. <label class="search__label">创建时间:</label>
  29. <el-date-picker
  30. style="margin-right: 24px !important"
  31. size="small"
  32. @change="selectTimeChange"
  33. value-format="yyyy-MM-dd"
  34. v-model="dateSelect"
  35. type="daterange"
  36. range-separator="至"
  37. start-placeholder="开始日期"
  38. end-placeholder="结束日期"
  39. clearable
  40. >
  41. </el-date-picker>
  42. </div>
  43. <div class="mt-10">
  44. <label class="search__label">状态:</label>
  45. <el-select
  46. class="inline-24"
  47. v-model="selectParam.status"
  48. placeholder="请选择状态"
  49. @change="selectStatusChange"
  50. size="small"
  51. clearable
  52. >
  53. <el-option label="新建" value="新建"></el-option>
  54. <el-option label="审核" value="审核"></el-option>
  55. </el-select>
  56. </div>
  57. </template>
  58. <template v-slot:tbList="scope">
  59. <div
  60. :style="
  61. scope.data.column.data.status === '审核'
  62. ? 'color:#52C41A'
  63. : 'color:000000'
  64. "
  65. v-if="scope.data.column.columnname === 'status'"
  66. >
  67. {{ scope.data.column.data.status }}
  68. </div>
  69. <div v-else-if="scope.data.column.columnname === 'flh'">
  70. {{ scope.data.column.data.flh.join(',') }}
  71. </div>
  72. <div v-else-if="scope.data.column.columnname === 'marketprice'">
  73. {{ tool.formatAmount(scope.data.column.data.marketprice, 2) }}
  74. </div>
  75. <div v-else>{{ scope.data.column.data[[scope.data.column.columnname]] }}</div>
  76. </template>
  77. <!-- <template v-slot:tbOpreation="scope">
  78. <editTemp :data="scope.data.data"></editTemp>
  79. </template> -->
  80. </basicLayout>
  81. </template>
  82. <script>
  83. import ImportFile from "../modules/importFile.vue";
  84. export default {
  85. components: { ImportFile },
  86. data() {
  87. return {
  88. selectParam: {
  89. status: "",
  90. },
  91. dateSelect: "",
  92. bodystructure: [],
  93. actuatordrivetype:[],
  94. actuatortype:[],
  95. func: [],
  96. errorUrl: null,
  97. };
  98. },
  99. provide() {
  100. return {
  101. bodystructure: () => {
  102. return this.bodystructure;
  103. },
  104. actuatordrivetype: () => {
  105. return this.actuatordrivetype;
  106. },
  107. actuatortype: () => {
  108. return this.actuatortype;
  109. },
  110. func: () => {
  111. return this.func;
  112. },
  113. };
  114. },
  115. methods: {
  116. async bindImport(id) {
  117. const res = await this.$api.requested({
  118. id: 20240618133002,
  119. content: {
  120. attachmentid: id[0],
  121. },
  122. });
  123. if (res.data !== "成功") {
  124. this.errorUrl = res.data;
  125. } else {
  126. this.tool.showMessage(res, () => {
  127. this.$refs.basicLayout.listData();
  128. });
  129. }
  130. },
  131. selectStatusChange() {
  132. this.$refs["basicLayout"].param.content.where = this.selectParam;
  133. this.$refs["basicLayout"].param.content.pageNumber = 1;
  134. this.$refs["basicLayout"].listData();
  135. },
  136. selectTimeChange() {
  137. if (this.dateSelect !== "" && this.dateSelect !== null) {
  138. this.selectParam.begindate = this.dateSelect[0];
  139. this.selectParam.enddate = this.dateSelect[1];
  140. } else {
  141. this.selectParam.begindate = "";
  142. this.selectParam.enddate = "";
  143. }
  144. this.$refs.basicLayout.param.content.pageNumber = 1;
  145. this.$refs.basicLayout.param.content.where = this.selectParam;
  146. this.$refs.basicLayout.listData();
  147. },
  148. optionList() {
  149. this.$store.dispatch("optiontypeselect", "bodystructure").then((res) => {
  150. this.bodystructure = res.data;
  151. console.log(this.bodystructure, "结构");
  152. });
  153. this.$store.dispatch("optiontypeselect", "func").then((res) => {
  154. this.func = res.data;
  155. console.log(this.func, "功能");
  156. });
  157. this.$store.dispatch("optiontypeselect", "lectotypetype").then((res) => {
  158. this.actuatortype = res.data;
  159. console.log(this.actuatortype, "执行器类型");
  160. });
  161. this.$store.dispatch("optiontypeselect", "actuatordrivetype").then((res) => {
  162. this.actuatordrivetype = res.data;
  163. console.log(this.actuatordrivetype, "执行器驱动类型");
  164. });
  165. },
  166. },
  167. created() {
  168. this.optionList();
  169. },
  170. };
  171. </script>
  172. <style scoped>
  173. </style>