index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <basicLayout
  3. ref="basicLayout"
  4. :oldFormPath="{
  5. add: 'optionSystem/speedBoxManage/modules',
  6. }"
  7. tableName="speedBoxTable"
  8. idName="itemid"
  9. ownertable="plm_item"
  10. :apiId="{ query: 20240615136202, del: 20240615136002 }"
  11. :detailPath="{
  12. path: '/speedBoxDetail',
  13. }"
  14. :isExport="false"
  15. >
  16. <template #titleRight>
  17. <ImportFile
  18. :templateParam="{ id: 20240618135602, 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 === 'marketprice'">
  70. {{ tool.formatAmount(scope.data.column.data.marketprice, 2) }}
  71. </div>
  72. <p v-else>{{ scope.data.column.data[[scope.data.column.columnname]] }}</p>
  73. </template>
  74. <!-- <template v-slot:tbOpreation="scope">
  75. <editTemp :data="scope.data.data"></editTemp>
  76. </template> -->
  77. </basicLayout>
  78. </template>
  79. <script>
  80. import ImportFile from "../modules/importFile.vue";
  81. export default {
  82. components: { ImportFile },
  83. data() {
  84. return {
  85. selectParam: {
  86. status: "",
  87. },
  88. dateSelect: "",
  89. bodystructure: [],
  90. func: [],
  91. errorUrl: null,
  92. };
  93. },
  94. provide() {
  95. return {
  96. bodystructure: () => {
  97. return this.bodystructure;
  98. },
  99. func: () => {
  100. return this.func;
  101. },
  102. };
  103. },
  104. methods: {
  105. async bindImport(id) {
  106. const res = await this.$api.requested({
  107. id: 20240618135702,
  108. content: {
  109. attachmentid: id[0],
  110. },
  111. });
  112. if (res.data !== "成功") {
  113. this.errorUrl = res.data;
  114. } else {
  115. this.tool.showMessage(res, () => {
  116. this.$refs.basicLayout.listData();
  117. });
  118. }
  119. },
  120. selectStatusChange() {
  121. this.$refs["basicLayout"].param.content.where = this.selectParam;
  122. this.$refs["basicLayout"].param.content.pageNumber = 1;
  123. this.$refs["basicLayout"].listData();
  124. },
  125. selectTimeChange() {
  126. if (this.dateSelect !== "" && this.dateSelect !== null) {
  127. this.selectParam.begindate = this.dateSelect[0];
  128. this.selectParam.enddate = this.dateSelect[1];
  129. } else {
  130. this.selectParam.begindate = "";
  131. this.selectParam.enddate = "";
  132. }
  133. this.$refs.basicLayout.param.content.pageNumber = 1;
  134. this.$refs.basicLayout.param.content.where = this.selectParam;
  135. this.$refs.basicLayout.listData();
  136. },
  137. optionList() {
  138. this.$store.dispatch("optiontypeselect", "bodystructure").then((res) => {
  139. this.bodystructure = res.data;
  140. console.log(this.bodystructure, "结构");
  141. });
  142. this.$store.dispatch("optiontypeselect", "func").then((res) => {
  143. this.func = res.data;
  144. console.log(this.func, "功能");
  145. });
  146. },
  147. },
  148. created() {
  149. this.optionList();
  150. },
  151. };
  152. </script>
  153. <style scoped>
  154. </style>