You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1900 lines
65 KiB

4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
4 years ago
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
4 years ago
​
4 years ago
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
4 years ago
​
4 years ago
4 years ago
​
4 years ago
4 years ago
4 years ago
4 years ago
​
4 years ago
​
4 years ago
​
4 years ago
​
4 years ago
​
4 years ago
4 years ago
4 years ago
​
4 years ago
​
​
​
​
​
4 years ago
4 years ago
4 years ago
​
4 years ago
​
2 years ago
​
4 years ago
​
​
​
​
4 years ago
2 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
4 years ago
​
​
​
​
​
4 years ago
4 years ago
​
4 years ago
​
​
​
​
​
4 years ago
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
4 years ago
4 years ago
​
​
​
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
4 years ago
​
​
​
4 years ago
4 years ago
​
​
​
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
​
4 years ago
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
4 years ago
4 years ago
​
​
​
​
​
2 years ago
​
4 years ago
4 years ago
​
4 years ago
4 years ago
​
4 years ago
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
4 years ago
4 years ago
​
4 years ago
​
​
4 years ago
​
​
​
4 years ago
4 years ago
​
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
4 years ago
4 years ago
4 years ago
​
4 years ago
​
4 years ago
​
​
4 years ago
​
4 years ago
​
​
​
​
4 years ago
​
​
4 years ago
​
4 years ago
4 years ago
4 years ago
​
4 years ago
​
4 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
4 years ago
​
4 years ago
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
4 years ago
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
4 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
4 years ago
​
​
4 years ago
4 years ago
​
4 years ago
4 years ago
​
4 years ago
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
4 years ago
​
4 years ago
4 years ago
4 years ago
​
4 years ago
​
​
​
​
4 years ago
​
4 years ago
​
​
4 years ago
​
​
​
​
4 years ago
​
4 years ago
4 years ago
​
​
4 years ago
​
​
4 years ago
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
4 years ago
​
4 years ago
4 years ago
​
2 years ago
​
​
​
​
​
​
4 years ago
​
4 years ago
4 years ago
​
​
4 years ago
​
​
4 years ago
​
4 years ago
​
​
4 years ago
​
4 years ago
4 years ago
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
4 years ago
​
4 years ago
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
4 years ago
4 years ago
4 years ago
​
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
4 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
4 years ago
​
4 years ago
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
  1. <template>
  2. <div class="mod-config">
  3. <!-- 条件查询 -->
  4. <el-form :inline="true" label-position="top" :model="searchData">
  5. <el-form-item :label="'BU'">
  6. <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px">
  7. <el-option
  8. v-for = "i in userBuList"
  9. :key = "i.buNo"
  10. :label = "i.buDesc"
  11. :value = "i.buDesc">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item :label="'模板编码'">
  16. <el-input v-model="searchData.templateId" clearable style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'模板名称'">
  19. <el-input v-model="searchData.templateName" clearable style="width: 200px"></el-input>
  20. </el-form-item>
  21. <el-form-item label="检验类型">
  22. <el-select v-model="searchData.inspectionTypeNo" :disabled="lineInspectionRoleFlag" placeholder="请选择" style="width: 100px">
  23. <el-option v-if="!lineInspectionRoleFlag" label="全部" value=""></el-option>
  24. <el-option
  25. v-for = "i in options"
  26. :key = "i.inspectionTypeNo"
  27. :label = "i.inspectionTypeName"
  28. :value = "i.inspectionTypeNo">
  29. </el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item :label="' '">
  33. <!-- <el-button @click="doEmpty()">清空</el-button>-->
  34. <el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
  35. <el-button v-if="!authSave" type="primary" @click="addModal()">新增</el-button>
  36. </el-form-item>
  37. <el-form-item :label="' '">
  38. <el-button type="primary" icon="el-icon-upload" @click="qcUpload()">导入</el-button>
  39. <download-excel
  40. :fields="fields()"
  41. :data="exportData"
  42. type="xls"
  43. :name="exportName"
  44. :header="exportHeader"
  45. :footer="exportFooter"
  46. :fetch="createExportData"
  47. :before-generate="startDownload"
  48. :before-finish="finishDownload"
  49. worksheet="导出信息"
  50. class="el-button el-button--primary el-button--medium">
  51. {{ "导出" }}
  52. </download-excel>
  53. </el-form-item>
  54. </el-form>
  55. <!-- 展示列表 -->
  56. <el-table
  57. :height="height"
  58. :data="dataList"
  59. border
  60. style="width: 100%;">
  61. <el-table-column
  62. v-for="(item,index) in columnList" :key="index"
  63. :sortable="item.columnSortable"
  64. :prop="item.columnProp"
  65. :header-align="item.headerAlign"
  66. :show-overflow-tooltip="item.showOverflowTooltip"
  67. :align="item.align"
  68. :fixed="item.fixed===''?false:item.fixed"
  69. :min-width="item.columnWidth"
  70. :label="item.columnLabel">
  71. <template slot-scope="scope">
  72. <span v-if="!item.columnHidden">
  73. <span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span>
  74. <span v-else>
  75. {{ scope.row[item.columnProp] }}
  76. </span>
  77. </span>
  78. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column
  82. fixed="right"
  83. header-align="center"
  84. align="center"
  85. width="160"
  86. label="操作">
  87. <template slot-scope="scope">
  88. <a v-if="!authUpdate" type="text" size="small" @click="updateModal(scope.row)">编辑</a>
  89. <a v-if="!authDetail" type="text" size="small" @click="detailModal(scope.row)">检验项目</a>
  90. <a v-if="!authDelete" type="text" size="small" @click="deleteModel(scope.row)">删除</a>
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. <!-- 分页栏 -->
  95. <el-pagination
  96. @size-change="sizeChangeHandle"
  97. @current-change="currentChangeHandle"
  98. :current-page="pageIndex"
  99. :page-sizes="[20, 50, 100, 200, 500]"
  100. :page-size="pageSize"
  101. :total="totalPage"
  102. layout="total, sizes, prev, pager, next, jumper">
  103. </el-pagination>
  104. <!-- 检验模板新增/修改 -->
  105. <el-dialog title="检验模板" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="500px">
  106. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  107. <el-form-item label="BU" prop="bu" :rules="rules.bu">
  108. <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 456px">
  109. <el-option
  110. v-for = "i in userBuList"
  111. :key = "i.buNo"
  112. :label = "i.sitename"
  113. :value = "i.buNo">
  114. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  115. <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  116. {{ i.buDesc }}
  117. </span>
  118. </el-option>
  119. </el-select>
  120. </el-form-item>
  121. </el-form>
  122. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  123. <el-form-item label="检验模板名称" prop="templateName" :rules="rules.templateNameType">
  124. <el-input v-model="modalData.templateName" style="width: 221px"></el-input>
  125. </el-form-item>
  126. <el-form-item label="检验类型" prop="inspectionTypeNo" :rules="rules.inspectionTypeNoType">
  127. <el-select v-model="modalData.inspectionTypeNo" :disabled="lineInspectionRoleFlag" placeholder="请选择" style="width: 221px">
  128. <el-option
  129. v-for = "i in options"
  130. :key = "i.inspectionTypeNo"
  131. :label = "i.inspectionTypeName"
  132. :value = "i.inspectionTypeNo">
  133. </el-option>
  134. </el-select>
  135. </el-form-item>
  136. </el-form>
  137. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  138. <el-form-item>
  139. <span slot="label" @click="getBaseList(207)"><a herf="#">抽样方案编码</a></span>
  140. <el-input v-model="modalData.samplingProgrammeNo" style="width: 221px"></el-input>
  141. </el-form-item>
  142. <el-form-item label="抽样方案名称">
  143. <el-input v-model="modalData.samplingProgrammeDesc" disabled style="width: 221px"></el-input>
  144. </el-form-item>
  145. </el-form>
  146. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  147. <el-form-item>
  148. <span slot="label" style="" @click="getBaseList(208)"><a herf="#">检验水平编码</a></span>
  149. <el-input v-model="modalData.samplingLevelNo" style="width: 221px"></el-input>
  150. </el-form-item>
  151. <el-form-item label="检验水平名称">
  152. <el-input v-model="modalData.samplingLevelDesc" disabled style="width: 221px"></el-input>
  153. </el-form-item>
  154. </el-form>
  155. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  156. <el-form-item label="检验周期(h)">
  157. <el-input v-model="modalData.inspectionCycle" type="number" style="width: 143px"></el-input>
  158. </el-form-item>
  159. <el-form-item label="默认抽样数量">
  160. <el-input v-model="modalData.defaultSamplingQuantity" type="number" style="width: 143px"></el-input>
  161. </el-form-item>
  162. <el-form-item label="默认抽样比例">
  163. <el-input v-model="modalData.defaultSamplingProportion" type="number" style="width: 143px"></el-input>
  164. </el-form-item>
  165. </el-form>
  166. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  167. <el-form-item label="AQL:">
  168. <el-input v-model="modalData.aql" type="number" style="width: 143px"></el-input>
  169. </el-form-item>
  170. <el-form-item label="AC:">
  171. <el-input v-model="modalData.ac" type="number" style="width: 143px"></el-input>
  172. </el-form-item>
  173. <el-form-item label="RE:">
  174. <el-input v-model="modalData.re" type="number" style="width: 143px"></el-input>
  175. </el-form-item>
  176. </el-form>
  177. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  178. <el-form-item label="版本号">
  179. <el-input v-model="modalData.templateVersion" :disabled="modalDisableFlag" style="width: 221px"></el-input>
  180. </el-form-item>
  181. <el-form-item label="检验模板备注">
  182. <el-input v-model="modalData.templateRemark" style="width: 221px"></el-input>
  183. </el-form-item>
  184. </el-form>
  185. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  186. <el-button type="primary" @click="saveData()">保存</el-button>
  187. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  188. </el-footer>
  189. </el-dialog>
  190. <!-- 检验项目 -->
  191. <el-dialog title="检验项目清单" @close="closeDialog" :close-on-click-modal="false" v-drag :visible.sync="detailModelFlag" width="940px">
  192. <el-form :inline="true" label-position="top" @keyup.enter.native="getDataList()">
  193. <el-form-item :label="'检验模板编码'">
  194. <el-input v-model="detailData.templateId" readonly style="width: 120px"></el-input>
  195. </el-form-item>
  196. <el-form-item :label="'检验模板名称'">
  197. <el-input v-model="detailData.templateName" readonly style="width: 240px"></el-input>
  198. </el-form-item>
  199. <el-form-item :label="' '">
  200. <el-button type="primary" @click="addFastModal()">新增</el-button>
  201. <el-button type="primary" @click="goUp()">上移</el-button>
  202. <el-button type="primary" @click="goDown()">下移</el-button>
  203. </el-form-item>
  204. </el-form>
  205. <!-- 检验项目展示列表 -->
  206. <div class="rq ">
  207. <el-table
  208. :height="400"
  209. :data="detailList"
  210. @row-click="itemClickRow"
  211. ref="detailTable"
  212. highlight-current-row
  213. border
  214. style="width: 100%;">
  215. <el-table-column
  216. v-for="(item,index) in columnDetailList" :key="index"
  217. :sortable="item.columnSortable"
  218. :prop="item.columnProp"
  219. :header-align="item.headerAlign"
  220. :show-overflow-tooltip="item.showOverflowTooltip"
  221. :align="item.align"
  222. :fixed="item.fixed===''?false:item.fixed"
  223. :min-width="item.columnWidth"
  224. :label="item.columnLabel">
  225. <template slot-scope="scope">
  226. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  227. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  228. </template>
  229. </el-table-column>
  230. <el-table-column
  231. prop=""
  232. header-align="center"
  233. align="right"
  234. min-width="60"
  235. label="标准值">
  236. <template slot-scope="scope">
  237. <el-input v-model="scope.row.defaultValue" style="height: 11px;width:98%"></el-input>
  238. </template>
  239. </el-table-column>
  240. <el-table-column
  241. prop=""
  242. header-align="center"
  243. align="right"
  244. min-width="60"
  245. label="最大值">
  246. <template slot-scope="scope">
  247. <el-input v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.maxValue" disabled style="height: 11px;width:98%"></el-input>
  248. <el-input v-else v-model="scope.row.maxValue" style="height: 11px;width:98%"></el-input>
  249. </template>
  250. </el-table-column>
  251. <el-table-column
  252. prop=""
  253. header-align="center"
  254. align="right"
  255. min-width="60"
  256. label="最小值">
  257. <template slot-scope="scope">
  258. <el-input v-if="scope.row.valueTypeDb === 'T'" v-model="scope.row.minValue" disabled style="height: 11px;width:98%"></el-input>
  259. <el-input v-else v-model="scope.row.minValue" style="height: 11px;width:98%"></el-input>
  260. </template>
  261. </el-table-column>
  262. <!-- <el-table-column-->
  263. <!-- prop=""-->
  264. <!-- header-align="center"-->
  265. <!-- align="right"-->
  266. <!-- width="220"-->
  267. <!-- label="检验设备">-->
  268. <!-- <template slot-scope="scope">-->
  269. <!-- <el-autocomplete-->
  270. <!-- clearable-->
  271. <!-- class="inline-input"-->
  272. <!-- popper-class="el-autocomplete-suggestion"-->
  273. <!-- v-model="scope.row.objectID"-->
  274. <!-- value-key="idAndDesc"-->
  275. <!-- :fetch-suggestions="FilterEntityName"-->
  276. <!-- :trigger-on-focus="true"-->
  277. <!-- placeholder="请选择设备"-->
  278. <!-- @clear="blurForBug()"-->
  279. <!-- @select="handleSelect"-->
  280. <!-- :popper-append-to-body="false"-->
  281. <!-- style="width: 210px">-->
  282. <!-- </el-autocomplete>-->
  283. <!-- </template>-->
  284. <!-- </el-table-column>-->
  285. <el-table-column
  286. fixed="right"
  287. header-align="center"
  288. align="center"
  289. width="130"
  290. label="操作">
  291. <template slot-scope="scope">
  292. <a v-if="scope.row.valueTypeDb === 'N'" type="text" size="small" @click="inspectionStandardModal(scope.row)">判定标准</a>
  293. <a type="text" size="small" @click="delItemDetails(scope.row)">删除项目</a>
  294. </template>
  295. </el-table-column>
  296. </el-table>
  297. </div>
  298. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  299. <el-button type="primary" @click="saveDetail()">保存</el-button>
  300. <el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
  301. </el-footer>
  302. </el-dialog>
  303. <!-- 检验标准配置 -->
  304. <el-dialog title="检验标准" :close-on-click-modal="false" v-drag :visible.sync="inspectionStandardModalFlag" width="811px">
  305. <el-button type="success" icon="el-icon-plus" size="mini" @click="handleAddBtn">添加</el-button>
  306. <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBtn">删除</el-button>
  307. <div class="rq ">
  308. <el-table
  309. :height="300"
  310. :data="tableData"
  311. border
  312. :row-class-name="rowClassName"
  313. @selection-change="handleDetailSelectionChange"
  314. style="width: 100%;">
  315. <el-table-column type="selection" align="center" width="50"></el-table-column>
  316. <el-table-column label="序号" align="center" prop="seqNo" width="50"></el-table-column>
  317. <el-table-column prop="collectionSource" header-align="center" align="center" :required="true" label="采集数据来源" width="150">
  318. <template slot-scope="{row}">
  319. <el-select v-model="tableData[row.xh-1].collectionSource" clearable style="width: 140px">
  320. <el-option label="采集数据01" value="value0"></el-option>
  321. <el-option label="采集数据02" value="value1"></el-option>
  322. <el-option label="采集数据03" value="value2"></el-option>
  323. <el-option label="采集数据04" value="value3"></el-option>
  324. <el-option label="采集数据05" value="value4"></el-option>
  325. <el-option label="采集数据06" value="value5"></el-option>
  326. <el-option label="采集数据07" value="value6"></el-option>
  327. <el-option label="采集数据08" value="value7"></el-option>
  328. <el-option label="采集数据09" value="value8"></el-option>
  329. <el-option label="采集数据10" value="value9"></el-option>
  330. </el-select>
  331. </template>
  332. </el-table-column>
  333. <el-table-column prop="defaultValue" header-align="center" align="center" :required="true" label="标准值" width="150">
  334. <template slot-scope="{row}">
  335. <el-input :ref="`${row.xh-1}` + `a`" v-model="tableData[row.xh-1].defaultValue" @keyup.enter.native="nextFocus1(row.xh-1)" placeholder="请输入默认值"></el-input>
  336. </template>
  337. </el-table-column>
  338. <el-table-column prop="maxValue" header-align="center" align="center" :required="true" label="最大值" width="150">
  339. <template slot-scope="{row}">
  340. <el-input :ref="`${row.xh-1}` + `b`" v-model="tableData[row.xh-1].maxValue" @keyup.enter.native="nextFocus2(row.xh-1)" placeholder="请输入最大值"></el-input>
  341. </template>
  342. </el-table-column>
  343. <el-table-column prop="minValue" header-align="center" align="center" :required="true" label="最小值" width="150">
  344. <template slot-scope="{row}">
  345. <el-input :ref="`${row.xh-1}` + `c`" v-model="tableData[row.xh-1].minValue" @keyup.enter.native="nextFocus3(row.xh-1)" placeholder="请输入最小值"></el-input>
  346. </template>
  347. </el-table-column>
  348. <el-table-column prop="condition" header-align="center" align="center" :required="true" label="判断条件" width="90">
  349. <template slot-scope="{row}">
  350. <el-select v-model="tableData[row.xh-1].condition" clearable style="width: 80px">
  351. <el-option label="并且" value="&&"></el-option>
  352. <el-option label="或者" value="||"></el-option>
  353. </el-select>
  354. </template>
  355. </el-table-column>
  356. </el-table>
  357. </div>
  358. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  359. <el-button type="primary" @click="saveInspectionStandard">保存</el-button>
  360. <el-button type="primary" @click="inspectionStandardModalFlag = false">关闭</el-button>
  361. </el-footer>
  362. </el-dialog>
  363. <!-- 检验项目->快速新增 -->
  364. <el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="fastAddFlag" width="1100px">
  365. <div style="font-size: 12px">
  366. <el-form :inline="true" label-position="top" :model="detailData">
  367. <el-form-item :label="'项目编码'">
  368. <el-input v-model="detailData.itemNo" clearable style="width: 120px"></el-input>
  369. </el-form-item>
  370. <el-form-item :label="'项目名称'">
  371. <el-input v-model="detailData.itemDesc" clearable style="width: 200px"></el-input>
  372. </el-form-item>
  373. <!-- <el-form-item label="检验类型">-->
  374. <!-- <el-select v-model="detailData.inspectionTypeNo" clearable placeholder="请选择" style="width: 120px">-->
  375. <!-- <el-option-->
  376. <!-- v-for = "i in options"-->
  377. <!-- :key = "i.inspectionTypeNo"-->
  378. <!-- :label = "i.inspectionTypeName"-->
  379. <!-- :value = "i.inspectionTypeNo">-->
  380. <!-- </el-option>-->
  381. <!-- </el-select>-->
  382. <!-- </el-form-item>-->
  383. <el-form-item :label="' '">
  384. <el-button type="primary" @click="getItem()">查询</el-button>
  385. </el-form-item>
  386. </el-form>
  387. </div>
  388. <el-container style="margin-top: 0px;">
  389. <el-main style="width: 720px; padding: 1px">
  390. <span style="font-size: 12px" >可选项目:</span>
  391. <el-table
  392. height="400px"
  393. :data="itemList1"
  394. border
  395. ref="itemTable1"
  396. @row-click="itemClickRow1"
  397. @selection-change="selectionItem1"
  398. highlight-current-row
  399. style="width: 100%">
  400. <el-table-column
  401. type="selection"
  402. header-align="center"
  403. align="center"
  404. :selectable="selectFlag"
  405. width="50">
  406. </el-table-column>
  407. <el-table-column
  408. prop="itemNo"
  409. header-align="center"
  410. align="center"
  411. min-width="80"
  412. label="项目编码">
  413. </el-table-column>
  414. <el-table-column
  415. prop="itemDesc"
  416. header-align="center"
  417. align="center"
  418. min-width="120"
  419. label="项目名称">
  420. </el-table-column>
  421. <el-table-column
  422. prop="defaultValue"
  423. header-align="center"
  424. align="center"
  425. min-width="100"
  426. label="标准值">
  427. </el-table-column>
  428. <el-table-column
  429. prop="maxValue"
  430. header-align="center"
  431. align="center"
  432. min-width="60"
  433. label="最大值">
  434. </el-table-column>
  435. <el-table-column
  436. prop="minValue"
  437. header-align="center"
  438. align="center"
  439. min-width="60"
  440. label="最小值">
  441. </el-table-column>
  442. </el-table>
  443. </el-main>
  444. <el-main style="width: 111px;padding: 1px">
  445. <div style="margin-top: 182px;margin-left: 18px">
  446. <el-button type="primary" @click="addItem()">添加>></el-button>
  447. </div>
  448. <div style="margin-top: 15px;margin-left: 18px">
  449. <el-button type="primary" @click="deleteItem()">删除<<</el-button>
  450. </div>
  451. </el-main>
  452. <el-main style="width: 400px;padding: 1px">
  453. <span style="font-size: 12px" >已有项目:</span>
  454. <el-table
  455. height="400px"
  456. :data="itemList2"
  457. border
  458. ref="itemTable2"
  459. @row-click="itemClickRow2"
  460. @selection-change="selectionItem2"
  461. highlight-current-row
  462. style="width: 100%">
  463. <el-table-column
  464. type="selection"
  465. header-align="center"
  466. align="center"
  467. :selectable="selectFlag"
  468. width="50">
  469. </el-table-column>
  470. <el-table-column
  471. prop="itemNo"
  472. header-align="center"
  473. align="center"
  474. min-width="80"
  475. label="项目编码">
  476. </el-table-column>
  477. <el-table-column
  478. prop="itemDesc"
  479. header-align="center"
  480. align="center"
  481. min-width="200"
  482. label="项目名称">
  483. </el-table-column>
  484. </el-table>
  485. </el-main>
  486. </el-container>
  487. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  488. <el-button type="primary" @click="fastAddFlag = false">关闭</el-button>
  489. </el-footer>
  490. </el-dialog>
  491. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  492. <!-- 导入 -->
  493. <qcUpload ref="qcUpload" @refreshPageTables="getDataList()" v-drag></qcUpload>
  494. </div>
  495. </template>
  496. <script>
  497. import {
  498. templateSearch, // 查询模板
  499. templateSave, // 新增模板
  500. templateUpdate, // 修改模板
  501. templateDelete, // 删除模板
  502. inspectionTypeSearch, // 搜索所有检验类型
  503. objectSearch, // 搜索所有设备
  504. templateDetailsSearch, // 查询明细列表
  505. addItemDetails, // 新增项目的检验明细
  506. getItemList, // 获取明细列表
  507. delItemDetails, // 删除项目的检验明细
  508. saveItemDetailed, // 新增项目明细的最大最小值
  509. getItem, // 查询检验项目
  510. getSiteAndBuByUserName,
  511. getInspectionStandards, // 获取检验标准
  512. saveInspectionStandard, // 新增检验标准
  513. goUpItemQC, // 上移项目位置
  514. goDownItemQC,// 下移项目位置
  515. } from "@/api/qc/qc.js"
  516. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  517. import Chooselist from '@/views/modules/common/Chooselist_eam'
  518. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  519. import qcUpload from "./qc_upload";
  520. export default {
  521. components: {
  522. Chooselist,
  523. qcUpload
  524. },
  525. data () {
  526. return {
  527. columnsProp:['createBy', 'updateBy'],
  528. // 是否收藏
  529. favorite: false,
  530. // 导出 start
  531. exportData: [],
  532. exportName: "根据物料设置检验模板" + this.dayjs().format('YYYYMMDDHHmmss'),
  533. exportHeader: ["根据物料设置检验模板"],
  534. exportFooter: [],
  535. exportList: [],
  536. // 导出 end
  537. tagNo: '',
  538. searchData: {
  539. site: '',
  540. userName: this.$store.state.user.name,
  541. templateId: '',
  542. templateName: '',
  543. inspectionTypeNo: '',
  544. buDesc: '',
  545. page: 1,
  546. limit: 10,
  547. },
  548. options: [],
  549. objects: [],
  550. height: 200,
  551. pageIndex: 1,
  552. pageSize: 20,
  553. totalPage: 0,
  554. modalFlag: false,
  555. modalDisableFlag: false,
  556. modalData: {
  557. flag: '',
  558. site: '',
  559. bu: '',
  560. templateId: '',
  561. templateName: '',
  562. templateRemark: '',
  563. templateType: '',
  564. templateVersion: '',
  565. samplingProgrammeNo: '',
  566. samplingProgrammeDesc: '',
  567. inspectionTypeNo: '',
  568. inspectionCycle: '',
  569. createTime: '',
  570. createBy: this.$store.state.user.name,
  571. updateBy: this.$store.state.user.name,
  572. samplingLevelNo: '',
  573. samplingLevelDesc: '',
  574. aql: '',
  575. ac: '',
  576. re: '',
  577. defaultSamplingQuantity: '',
  578. defaultSamplingProportion: '',
  579. },
  580. detailData: {
  581. site: '',
  582. buNo: '',
  583. templateId: '',
  584. templateName: '',
  585. templateRemark: '',
  586. templateType: '',
  587. templateVersion: '',
  588. samplingProgrammeNo: '',
  589. samplingProgrammeDesc: '',
  590. inspectionTypeNo: '',
  591. inspectionCycle: '',
  592. inspectionTypeName: '',
  593. createTime: '',
  594. createBy: this.$store.state.user.name,
  595. samplingLevelNo: '',
  596. samplingLevelDesc: '',
  597. aql: '',
  598. ac: '',
  599. re: '',
  600. itemNo: '',
  601. itemDesc: '',
  602. itemType: 'D',
  603. },
  604. columnList: [
  605. {
  606. userId: this.$store.state.user.name,
  607. functionId: 301008,
  608. serialNumber: '301008TableBuDesc',
  609. tableId: "301008Table",
  610. tableName: "检验模板维护表",
  611. columnProp: 'buDesc',
  612. headerAlign: "center",
  613. align: "center",
  614. columnLabel: 'BU',
  615. columnHidden: false,
  616. columnImage: false,
  617. columnSortable: false,
  618. sortLv: 0,
  619. status: true,
  620. fixed: '',
  621. columnWidth: 100,
  622. },
  623. {
  624. userId: this.$store.state.user.name,
  625. functionId: 301008,
  626. serialNumber: '301008TableItemNo',
  627. tableId: "301008Table",
  628. tableName: "检验模板维护表",
  629. columnProp: 'templateId',
  630. headerAlign: "center",
  631. align: "center",
  632. columnLabel: '检验模板编码',
  633. columnHidden: false,
  634. columnImage: false,
  635. columnSortable: false,
  636. sortLv: 0,
  637. status: true,
  638. fixed: '',
  639. columnWidth: 120,
  640. },
  641. {
  642. userId: this.$store.state.user.name,
  643. functionId: 301008,
  644. serialNumber: '301008TableItemNo',
  645. tableId: "301008Table",
  646. tableName: "检验模板维护表",
  647. columnProp: 'templateName',
  648. headerAlign: "center",
  649. align: "left",
  650. columnLabel: '检验模板名称',
  651. columnHidden: false,
  652. columnImage: false,
  653. columnSortable: false,
  654. sortLv: 0,
  655. status: true,
  656. fixed: '',
  657. columnWidth: 200,
  658. },
  659. {
  660. userId: this.$store.state.user.name,
  661. functionId: 301008,
  662. serialNumber: '301008TableItemNo',
  663. tableId: "301008Table",
  664. tableName: "检验模板维护表",
  665. columnProp: 'samplingProgrammeDesc',
  666. headerAlign: "center",
  667. align: "left",
  668. columnLabel: '抽样方案',
  669. columnHidden: false,
  670. columnImage: false,
  671. columnSortable: false,
  672. sortLv: 0,
  673. status: true,
  674. fixed: '',
  675. columnWidth: 120,
  676. },
  677. {
  678. userId: this.$store.state.user.name,
  679. functionId: 301008,
  680. serialNumber: '301008TableItemNo',
  681. tableId: "301008Table",
  682. tableName: "检验模板维护表",
  683. columnProp: 'samplingLevelDesc',
  684. headerAlign: "center",
  685. align: "left",
  686. columnLabel: '检验水平',
  687. columnHidden: false,
  688. columnImage: false,
  689. columnSortable: false,
  690. sortLv: 0,
  691. status: true,
  692. fixed: '',
  693. columnWidth: 120,
  694. },
  695. {
  696. userId: this.$store.state.user.name,
  697. functionId: 301008,
  698. serialNumber: '301008TableItemNo',
  699. tableId: "301008Table",
  700. tableName: "检验模板维护表",
  701. columnProp: 'inspectionCycle',
  702. headerAlign: "center",
  703. align: "right",
  704. columnLabel: '检验周期(h)',
  705. columnHidden: false,
  706. columnImage: false,
  707. columnSortable: false,
  708. sortLv: 0,
  709. status: true,
  710. fixed: '',
  711. columnWidth: 100,
  712. },
  713. {
  714. userId: this.$store.state.user.name,
  715. functionId: 301008,
  716. serialNumber: '301008TableItemNo',
  717. tableId: "301008Table",
  718. tableName: "检验模板维护表",
  719. columnProp: 'defaultSamplingQuantity',
  720. headerAlign: "center",
  721. align: "right",
  722. columnLabel: '默认抽样数量',
  723. columnHidden: false,
  724. columnImage: false,
  725. columnSortable: false,
  726. sortLv: 0,
  727. status: true,
  728. fixed: '',
  729. columnWidth: 100,
  730. },
  731. {
  732. userId: this.$store.state.user.name,
  733. functionId: 301008,
  734. serialNumber: '301008TableItemNo',
  735. tableId: "301008Table",
  736. tableName: "检验模板维护表",
  737. columnProp: 'defaultSamplingProportion',
  738. headerAlign: "center",
  739. align: "right",
  740. columnLabel: '默认抽样比例',
  741. columnHidden: false,
  742. columnImage: false,
  743. columnSortable: false,
  744. sortLv: 0,
  745. status: true,
  746. fixed: '',
  747. columnWidth: 100,
  748. },
  749. {
  750. userId: this.$store.state.user.name,
  751. functionId: 301008,
  752. serialNumber: '301008TableItemNo',
  753. tableId: "301008Table",
  754. tableName: "检验模板维护表",
  755. columnProp: 'aql',
  756. headerAlign: "center",
  757. align: "right",
  758. columnLabel: 'AQL',
  759. columnHidden: false,
  760. columnImage: false,
  761. columnSortable: false,
  762. sortLv: 0,
  763. status: true,
  764. fixed: '',
  765. columnWidth: 100,
  766. },
  767. {
  768. userId: this.$store.state.user.name,
  769. functionId: 301008,
  770. serialNumber: '301008TableItemNo',
  771. tableId: "301008Table",
  772. tableName: "检验模板维护表",
  773. columnProp: 'ac',
  774. headerAlign: "center",
  775. align: "right",
  776. columnLabel: 'AC',
  777. columnHidden: false,
  778. columnImage: false,
  779. columnSortable: false,
  780. sortLv: 0,
  781. status: true,
  782. fixed: '',
  783. columnWidth: 100,
  784. },
  785. {
  786. userId: this.$store.state.user.name,
  787. functionId: 301008,
  788. serialNumber: '301008TableItemNo',
  789. tableId: "301008Table",
  790. tableName: "检验模板维护表",
  791. columnProp: 're',
  792. headerAlign: "center",
  793. align: "right",
  794. columnLabel: 'RE',
  795. columnHidden: false,
  796. columnImage: false,
  797. columnSortable: false,
  798. sortLv: 0,
  799. status: true,
  800. fixed: '',
  801. columnWidth: 100,
  802. },
  803. {
  804. userId: this.$store.state.user.name,
  805. functionId: 301008,
  806. serialNumber: '301008TableItemNo',
  807. tableId: "301008Table",
  808. tableName: "检验模板维护表",
  809. columnProp: 'inspectionTypeName',
  810. headerAlign: "center",
  811. align: "center",
  812. columnLabel: '检验类型',
  813. columnHidden: false,
  814. columnImage: false,
  815. columnSortable: false,
  816. sortLv: 0,
  817. status: true,
  818. fixed: '',
  819. columnWidth: 100,
  820. },
  821. {
  822. userId: this.$store.state.user.name,
  823. functionId: 301008,
  824. serialNumber: '301008TableItemNo',
  825. tableId: "301008Table",
  826. tableName: "检验模板维护表",
  827. columnProp: 'templateRemark',
  828. headerAlign: "center",
  829. align: "left",
  830. columnLabel: '检验模板备注',
  831. columnHidden: false,
  832. columnImage: false,
  833. columnSortable: false,
  834. sortLv: 0,
  835. status: true,
  836. fixed: '',
  837. columnWidth: 200,
  838. },
  839. {
  840. userId: this.$store.state.user.name,
  841. functionId: 301008,
  842. serialNumber: '301008TableItemNo',
  843. tableId: "301008Table",
  844. tableName: "检验模板维护表",
  845. columnProp: 'templateVersion',
  846. headerAlign: "center",
  847. align: "center",
  848. columnLabel: '版本号',
  849. columnHidden: false,
  850. columnImage: false,
  851. columnSortable: false,
  852. sortLv: 0,
  853. status: true,
  854. fixed: '',
  855. columnWidth: 100,
  856. },
  857. {
  858. userId: this.$store.state.user.name,
  859. functionId: 301008,
  860. serialNumber: '301008TableItemNo',
  861. tableId: "301008Table",
  862. tableName: "检验模板维护表",
  863. columnProp: 'createTime',
  864. headerAlign: "center",
  865. align: "center",
  866. columnLabel: '创建时间',
  867. columnHidden: false,
  868. columnImage: false,
  869. columnSortable: false,
  870. sortLv: 0,
  871. status: true,
  872. fixed: '',
  873. columnWidth: 170,
  874. },
  875. {
  876. userId: this.$store.state.user.name,
  877. functionId: 301008,
  878. serialNumber: '301008TableItemNo',
  879. tableId: "301008Table",
  880. tableName: "检验模板维护表",
  881. columnProp: 'createBy',
  882. headerAlign: "center",
  883. align: "center",
  884. columnLabel: '创建人',
  885. columnHidden: false,
  886. columnImage: false,
  887. columnSortable: false,
  888. sortLv: 0,
  889. status: true,
  890. fixed: '',
  891. columnWidth: 100,
  892. },
  893. {
  894. userId: this.$store.state.user.name,
  895. functionId: 301008,
  896. serialNumber: '301008TableItemNo',
  897. tableId: "301008Table",
  898. tableName: "检验模板维护表",
  899. columnProp: 'updateDate',
  900. headerAlign: 'center',
  901. align: 'center',
  902. columnLabel: '更新时间',
  903. columnHidden: false,
  904. columnImage: false,
  905. columnSortable: false,
  906. sortLv: 0,
  907. status: true,
  908. fixed: '',
  909. columnWidth: 170,
  910. },
  911. {
  912. userId: this.$store.state.user.name,
  913. functionId: 301008,
  914. serialNumber: '301008TableItemNo',
  915. tableId: "301008Table",
  916. tableName: "检验模板维护表",
  917. columnProp: 'updateBy',
  918. headerAlign: 'center',
  919. align: 'center',
  920. columnLabel: '更新人',
  921. columnHidden: false,
  922. columnImage: false,
  923. columnSortable: false,
  924. sortLv: 0,
  925. status: true,
  926. fixed: '',
  927. columnWidth: 100,
  928. },
  929. ],
  930. detailModelFlag: false,
  931. detailList: [],
  932. dataList: [],
  933. // 展示列集
  934. columnDetailList: [
  935. {
  936. columnProp: 'itemNo',
  937. headerAlign: "center",
  938. align: "center",
  939. columnLabel: '检验项目编码',
  940. columnHidden: false,
  941. columnImage: false,
  942. columnSortable: false,
  943. sortLv: 0,
  944. status: true,
  945. fixed: '',
  946. columnWidth: 60
  947. },
  948. {
  949. columnProp: 'itemDesc',
  950. headerAlign: "center",
  951. align: "left",
  952. columnLabel: '检验项目名称',
  953. columnHidden: false,
  954. columnImage: false,
  955. columnSortable: false,
  956. sortLv: 0,
  957. status: true,
  958. fixed: '',
  959. columnWidth: 250
  960. },
  961. {
  962. columnProp: 'valueType',
  963. headerAlign: "center",
  964. align: "center",
  965. columnLabel: '检测值类型',
  966. columnHidden: false,
  967. columnImage: false,
  968. columnSortable: false,
  969. sortLv: 0,
  970. status: true,
  971. fixed: '',
  972. columnWidth: 60
  973. },
  974. ],
  975. // 快速添加
  976. fastAddFlag: false,
  977. itemList1: [],
  978. itemList2: [],
  979. itemListRow1: {},
  980. itemListRow2: {},
  981. itemSelections1: [],
  982. itemSelections2: [],
  983. searchForm: {
  984. objectID: '',
  985. objectDesc: ''
  986. },
  987. currentRow:{
  988. },
  989. rules: {
  990. templateNameType: [
  991. {
  992. required: true,
  993. message: ' ',
  994. trigger: ['blur','change']
  995. }
  996. ],
  997. inspectionTypeNoType: [
  998. {
  999. required: true,
  1000. message: ' ',
  1001. trigger: ['blur','change']
  1002. }
  1003. ],
  1004. bu: [
  1005. {
  1006. required: true,
  1007. message: ' ',
  1008. trigger: ['blur','change']
  1009. }
  1010. ]
  1011. },
  1012. userBuList: [],
  1013. authSearch: false,
  1014. authSave: false,
  1015. authUpdate: false,
  1016. authDelete: false,
  1017. authDetail: false,
  1018. lineInspectionRoleFlag: false,
  1019. pqcInspectionTypeNo: '108',
  1020. menuId: this.$route.meta.menuId,
  1021. inspectionStandardModalFlag: false,
  1022. standardData: {
  1023. site: '',
  1024. buNo: '',
  1025. templateId: '',
  1026. itemNo: '',
  1027. standardList: []
  1028. },
  1029. tableData: [],
  1030. checkedDetail: [],
  1031. }
  1032. },
  1033. mounted () {
  1034. this.$nextTick(() => {
  1035. this.height = window.innerHeight - 180
  1036. })
  1037. },
  1038. created () {
  1039. // 按钮控制
  1040. this.getButtonAuthData()
  1041. // 当前用户是否包含换线点检角色
  1042. this.lineInspectionRoleFlag = this.resolveLineInspectionRoleFlag()
  1043. // 获取用户的 site 和 bu
  1044. this.getSiteAndBuByUserName()
  1045. // 校验用户是否收藏
  1046. this.favoriteIsOk()
  1047. // 获取检验类型
  1048. this.inspectionTypeSearch()
  1049. // 动态列
  1050. this.getTableUserColumn(this.$route.meta.menuId+'table',1)
  1051. if (!this.authSearch) {
  1052. // 获取数据列表
  1053. this.getDataList()
  1054. }
  1055. },
  1056. methods: {
  1057. // 设置检验清单
  1058. inspectionStandardModal (row) {
  1059. this.standardData = {
  1060. site: row.site,
  1061. buNo: row.buNo,
  1062. templateId: row.templateId,
  1063. itemNo: row.itemNo,
  1064. standardList: []
  1065. }
  1066. getInspectionStandards(this.standardData).then(({data}) => {
  1067. if (data.code === 0) {
  1068. this.tableData = data.rows
  1069. } else {
  1070. this.tableData = []
  1071. }
  1072. })
  1073. this.inspectionStandardModalFlag = true
  1074. },
  1075. //表格的新增
  1076. rowClassName ({ row, rowIndex }) {
  1077. row.xh = rowIndex + 1
  1078. row.seqNo = rowIndex + 1
  1079. },
  1080. //单选框选中数据
  1081. handleDetailSelectionChange (selection) {
  1082. this.checkedDetail = selection
  1083. },
  1084. // 点击新增
  1085. handleAddBtn () {
  1086. let obj = {
  1087. seqNo: '',
  1088. collectionSource: '',
  1089. defaultValue: '',
  1090. minValue: '',
  1091. maxValue: '',
  1092. condition: ''
  1093. }
  1094. this.tableData.push(obj)
  1095. },
  1096. //删除
  1097. handleDeleteBtn () {
  1098. if (this.checkedDetail.length === 0) {
  1099. this.$alert("请先选择要删除的数据", "提示", {
  1100. confirmButtonText: "确定",
  1101. })
  1102. } else {
  1103. this.$confirm("请是否确认删除该检验标准?", "提示", {
  1104. confirmButtonText: "确定",
  1105. cancelButtonText: "取消",
  1106. type: "warning",
  1107. callback: (action) => {
  1108. if (action === "confirm") {
  1109. let val = this.checkedDetail
  1110. val.forEach((val, index) => {
  1111. this.tableData.forEach((v, i) => {
  1112. if (val.xh === v.xh) {
  1113. this.tableData.splice(i, 1)
  1114. }
  1115. })
  1116. })
  1117. this.$message({
  1118. message: "删除成功!",
  1119. type: "success",
  1120. })
  1121. return
  1122. } else {
  1123. this.$message({
  1124. message: "已取消删除操作",
  1125. type: "warning",
  1126. })
  1127. return
  1128. }
  1129. },
  1130. })
  1131. }
  1132. },
  1133. // 回车事件
  1134. nextFocus1 (index) {
  1135. let a1 = `${index + 1}` + `a`
  1136. this.$nextTick(() => {
  1137. this.$refs[a1].focus()
  1138. })
  1139. },
  1140. nextFocus2 (index) {
  1141. let a2 = `${index + 1}` + `b`
  1142. this.$nextTick(() => {
  1143. this.$refs[a2].focus()
  1144. })
  1145. },
  1146. nextFocus3 (index) {
  1147. let a3 = `${index + 1}` + `c`
  1148. this.$nextTick(() => {
  1149. this.$refs[a3].focus()
  1150. })
  1151. },
  1152. // 新增检验标准
  1153. saveInspectionStandard () {
  1154. this.standardData.standardList = this.tableData
  1155. saveInspectionStandard(this.standardData).then(({data}) => {
  1156. if (data && data.code === 0) {
  1157. this.inspectionStandardModalFlag = false
  1158. this.tableData = []
  1159. this.$message({
  1160. message: '操作成功',
  1161. type: 'success',
  1162. duration: 1500,
  1163. onClose: () => {}
  1164. })
  1165. } else {
  1166. this.$alert(data.msg, '错误', {
  1167. confirmButtonText: '确定'
  1168. })
  1169. }
  1170. })
  1171. },
  1172. // 获取用户的bu
  1173. getSiteAndBuByUserName () {
  1174. let tempData = {
  1175. username: this.$store.state.user.name,
  1176. }
  1177. getSiteAndBuByUserName(tempData).then(({data}) => {
  1178. if (data.code === 0) {
  1179. this.userBuList = data.rows
  1180. }
  1181. })
  1182. },
  1183. // 是否包含换线点检角色
  1184. resolveLineInspectionRoleFlag () {
  1185. return this.$store.state.user.lineInspectionRoleFlag === true || localStorage.getItem('lineInspectionRoleFlag') === 'Y'
  1186. },
  1187. // 获取PQC对应的检验类型编码
  1188. getPqcInspectionTypeNo () {
  1189. const pqcData = this.options.find(item => item.inspectionTypeName && item.inspectionTypeName==='PQC')
  1190. if (pqcData) {
  1191. this.pqcInspectionTypeNo = pqcData.inspectionTypeNo
  1192. }
  1193. return this.pqcInspectionTypeNo
  1194. },
  1195. // 换线点检角色仅允许PQC
  1196. applyPqcInspectionTypeLimit () {
  1197. if (!this.lineInspectionRoleFlag) {
  1198. return
  1199. }
  1200. const pqcInspectionTypeNo = this.getPqcInspectionTypeNo()
  1201. this.searchData.inspectionTypeNo = pqcInspectionTypeNo
  1202. this.modalData.inspectionTypeNo = pqcInspectionTypeNo
  1203. },
  1204. /**
  1205. * 查询检验项目
  1206. */
  1207. getItem () {
  1208. getItem(this.detailData).then(({data}) => {
  1209. if (data.code === 0) {
  1210. this.itemList1 = data.rows
  1211. }
  1212. })
  1213. },
  1214. // 查询检验类型
  1215. inspectionTypeSearch () {
  1216. let tempData = {
  1217. site: this.$store.state.user.site
  1218. }
  1219. inspectionTypeSearch(tempData).then(({data}) => {
  1220. if (data.code === 0) {
  1221. this.options = data.rows
  1222. if (this.lineInspectionRoleFlag) {
  1223. const pqcInspectionTypeNo = this.getPqcInspectionTypeNo()
  1224. this.options = this.options.filter(item => item.inspectionTypeNo === pqcInspectionTypeNo)
  1225. this.searchData.inspectionTypeNo = pqcInspectionTypeNo
  1226. this.modalData.inspectionTypeNo = pqcInspectionTypeNo
  1227. }
  1228. }
  1229. })
  1230. },
  1231. // 查询设备
  1232. objectSearch () {
  1233. let tempData = {
  1234. site: this.detailData.site,
  1235. buNo: this.detailData.buNo
  1236. }
  1237. objectSearch(tempData).then(({data}) => {
  1238. if (data.code === 0) {
  1239. this.objects = data.rows
  1240. }
  1241. })
  1242. },
  1243. // 客户
  1244. FilterEntityName (queryString, cb) {
  1245. let objects2 = this.objects
  1246. let results = queryString ? objects2.filter(this.createFilter(queryString)) : objects2
  1247. // 调用 callback 返回建议列表的数据
  1248. cb(results)
  1249. },
  1250. // 只要该输入内容的都匹配
  1251. createFilter (queryString) {
  1252. return (res) => {
  1253. return (res.idAndDesc.toLowerCase().indexOf(queryString.toLowerCase()) !== -1)
  1254. }
  1255. },
  1256. // 最终选择的数据
  1257. handleSelect (val) {
  1258. // this.searchForm.objectID = val.objectID
  1259. },
  1260. // 点击clearable清空小图标按钮以后,继续重新在输入框中输入数据,querySearch会触发,但是cb函数不会触发
  1261. // 这样的话就会出现发请求了,也获取数据了,但是input框的输入建议下拉框不呈现在页面上的问题,所以解决方法就是
  1262. // 只要用户点击了clearable清空按钮以后,就让当前获取焦点的输入框失去焦点,回到最初状态,一切重新开始
  1263. blurForBug () {
  1264. document.activeElement.blur()
  1265. },
  1266. // // 清空搜索栏
  1267. // doEmpty(){
  1268. // this.searchData = {
  1269. // site: this.$store.state.user.site,
  1270. // templateId: '',
  1271. // templateName: '',
  1272. // inspectionTypeNo: '',
  1273. // page: 1,
  1274. // limit: 10,
  1275. // }
  1276. // },
  1277. // 获取基础数据列表S
  1278. getBaseList (val,type) {
  1279. this.tagNo = val
  1280. this.$nextTick(() => {
  1281. let strVal = ''
  1282. let conSql = ''
  1283. if (this.modalData.bu === null || this.modalData.bu === '') {
  1284. this.$message.warning("请选择BU!")
  1285. return
  1286. } else {
  1287. conSql = " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'"
  1288. }
  1289. if (val === 207) {
  1290. strVal = this.modalData.samplingProgrammeNo
  1291. }
  1292. if (val === 208) {
  1293. strVal = this.modalData.samplingLevelNo
  1294. }
  1295. this.$refs.baseList.init(val, strVal, conSql)
  1296. })
  1297. },
  1298. // 列表方法的回调
  1299. getBaseData (val) {
  1300. if (this.tagNo === 207) {
  1301. this.modalData.samplingProgrammeNo = val.sampling_programme_no
  1302. this.modalData.samplingProgrammeDesc = val.sampling_programme_desc
  1303. }
  1304. if (this.tagNo === 208) {
  1305. this.modalData.samplingLevelNo = val.sampling_level_no
  1306. this.modalData.samplingLevelDesc = val.sampling_level_desc
  1307. }
  1308. },
  1309. // 获取数据列表
  1310. getDataList () {
  1311. this.applyPqcInspectionTypeLimit()
  1312. this.searchData.limit = this.pageSize
  1313. this.searchData.page = this.pageIndex
  1314. templateSearch(this.searchData).then(({data}) => {
  1315. if (data.code === 0) {
  1316. this.dataList = data.page.list
  1317. this.pageIndex = data.page.currPage
  1318. this.pageSize = data.page.pageSize
  1319. this.totalPage = data.page.totalCount
  1320. }
  1321. })
  1322. },
  1323. // 每页数
  1324. sizeChangeHandle (val) {
  1325. this.pageSize = val
  1326. this.pageIndex = 1
  1327. this.getDataList()
  1328. },
  1329. // 当前页
  1330. currentChangeHandle (val) {
  1331. this.pageIndex = val
  1332. this.getDataList()
  1333. },
  1334. addModal () {
  1335. this.modalData = {
  1336. flag: '1',
  1337. site: '',
  1338. bu: this.userBuList[0].buNo,
  1339. templateId: '',
  1340. templateName: '',
  1341. templateRemark: '',
  1342. templateType: '',
  1343. templateVersion: '',
  1344. samplingProgrammeNo: '',
  1345. samplingProgrammeDesc: '',
  1346. inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : '',
  1347. inspectionCycle: '',
  1348. createBy: this.$store.state.user.name,
  1349. updateBy: this.$store.state.user.name,
  1350. samplingLevelNo: '',
  1351. samplingLevelDesc: '',
  1352. aql: '',
  1353. ac: '',
  1354. re: ''
  1355. }
  1356. this.modalDisableFlag = false
  1357. this.modalFlag = true
  1358. },
  1359. updateModal (row) {
  1360. this.modalData = {
  1361. flag: '2',
  1362. bu: row.site + '_' + row.buNo,
  1363. site: row.site,
  1364. templateId: row.templateId,
  1365. templateName: row.templateName,
  1366. templateRemark: row.templateRemark,
  1367. templateType: row.templateType,
  1368. templateVersion: row.templateVersion,
  1369. samplingProgrammeNo: row.samplingProgrammeNo,
  1370. samplingProgrammeDesc: row.samplingProgrammeDesc,
  1371. inspectionTypeNo: this.lineInspectionRoleFlag ? this.getPqcInspectionTypeNo() : row.inspectionTypeNo,
  1372. createBy: this.$store.state.user.name,
  1373. updateBy: this.$store.state.user.name,
  1374. samplingLevelNo: row.samplingLevelNo,
  1375. samplingLevelDesc: row.samplingLevelDesc,
  1376. inspectionCycle: row.inspectionCycle,
  1377. aql: row.aql,
  1378. ac: row.ac,
  1379. re: row.re,
  1380. defaultSamplingQuantity: row.defaultSamplingQuantity,
  1381. defaultSamplingProportion: row.defaultSamplingProportion
  1382. }
  1383. this.modalDisableFlag = true
  1384. this.modalFlag = true
  1385. },
  1386. // 删除
  1387. deleteModel (row) {
  1388. this.$confirm(`是否删除这个检验模板?`, '提示', {
  1389. confirmButtonText: '确定',
  1390. cancelButtonText: '取消',
  1391. type: 'warning'
  1392. }).then(() => {
  1393. templateDelete(row).then(({data}) => {
  1394. if (data && data.code === 0) {
  1395. this.getDataList()
  1396. this.$message({
  1397. message: '操作成功',
  1398. type: 'success',
  1399. duration: 1500,
  1400. onClose: () => {}
  1401. })
  1402. } else {
  1403. this.$alert(data.msg, '错误', {
  1404. confirmButtonText: '确定'
  1405. })
  1406. }
  1407. })
  1408. }).catch(() => {
  1409. })
  1410. },
  1411. saveData () {
  1412. this.applyPqcInspectionTypeLimit()
  1413. if (this.modalData.bu === '' || this.modalData.bu == null) {
  1414. this.$message.warning('请选择BU!')
  1415. return
  1416. }
  1417. if (this.modalData.templateName === '' || this.modalData.templateName == null) {
  1418. this.$message.warning('请输入检验模板名称!')
  1419. return
  1420. }
  1421. if (this.modalData.inspectionTypeNo === '' || this.modalData.inspectionTypeNo == null) {
  1422. this.$message.warning('请选择检验类型!')
  1423. return
  1424. }
  1425. if ((this.modalData.samplingProgrammeNo === '' || this.modalData.samplingProgrammeNo == null) && (this.modalData.defaultSamplingQuantity === '' || this.modalData.defaultSamplingQuantity == null) && (this.modalData.defaultSamplingProportion === '' || this.modalData.defaultSamplingProportion == null)) {
  1426. this.$message.warning('抽样方案、默认抽样数量、默认抽样比例至少选择一项!')
  1427. return
  1428. }
  1429. if ((this.modalData.samplingProgrammeNo !== '' && this.modalData.samplingProgrammeNo != null) && (this.modalData.samplingLevelNo === '' || this.modalData.samplingLevelNo == null)) {
  1430. this.$message.warning('请选择检验水平!')
  1431. return
  1432. }
  1433. if (this.modalData.flag === '1') {
  1434. templateSave(this.modalData).then(({data}) => {
  1435. if (data && data.code === 0) {
  1436. this.getDataList()
  1437. this.modalFlag = false
  1438. this.$message({
  1439. message: '操作成功',
  1440. type: 'success',
  1441. duration: 1500,
  1442. onClose: () => {}
  1443. })
  1444. } else {
  1445. this.$alert(data.msg, '错误', {
  1446. confirmButtonText: '确定'
  1447. })
  1448. }
  1449. })
  1450. } else {
  1451. templateUpdate(this.modalData).then(({data}) => {
  1452. if (data && data.code === 0) {
  1453. this.getDataList()
  1454. this.modalFlag = false
  1455. this.$message({
  1456. message: '操作成功',
  1457. type: 'success',
  1458. duration: 1500,
  1459. onClose: () => {}
  1460. })
  1461. } else {
  1462. this.$alert(data.msg, '错误', {
  1463. confirmButtonText: '确定'
  1464. })
  1465. }
  1466. })
  1467. }
  1468. },
  1469. // 打开检验项目
  1470. detailModal (row) {
  1471. this.detailData.site = row.site
  1472. this.detailData.buNo = row.buNo
  1473. this.detailData.templateId = row.templateId
  1474. this.detailData.templateName = row.templateName
  1475. this.detailData.inspectionTypeName = row.inspectionTypeName
  1476. templateDetailsSearch(this.detailData).then(({data}) => {
  1477. this.detailList = data.rows
  1478. //this.objectSearch()
  1479. })
  1480. this.detailModelFlag = true
  1481. },
  1482. // 保存模板项目
  1483. saveDetail () {
  1484. // for (let i = 0; i < this.detailList.length; i++) {
  1485. // // if (this.detailList[i].objectID != null){
  1486. // // this.detailList[i].objectID = this.detailList[i].objectID.split('_')[0];
  1487. // // }
  1488. // saveItemDetailed(this.detailList[i]).then(({data}) => {
  1489. // if (data && data.code === 0) {
  1490. // this.getDataList()
  1491. // this.detailModelFlag = false
  1492. // } else {
  1493. // this.$alert(data.msg, '错误', {
  1494. // confirmButtonText: '确定'
  1495. // }).then(() => {
  1496. // return false
  1497. // })
  1498. // }
  1499. // })
  1500. // }
  1501. let tempData = {
  1502. site: this.detailData.site,
  1503. buNo: this.detailData.buNo,
  1504. templateId: this.detailData.templateId,
  1505. itemList: this.detailList
  1506. }
  1507. saveItemDetailed(tempData).then(({data}) => {
  1508. if (data && data.code === 0) {
  1509. this.getDataList()
  1510. this.detailModelFlag = false
  1511. this.$message({
  1512. message: '操作成功',
  1513. type: 'success',
  1514. duration: 1500,
  1515. onClose: () => {}
  1516. })
  1517. } else {
  1518. this.$alert(data.msg, '错误', {
  1519. confirmButtonText: '确定'
  1520. }).then(() => {
  1521. return false
  1522. })
  1523. }
  1524. })
  1525. },
  1526. // 快速新增
  1527. addFastModal () {
  1528. this.itemSelections1 = null
  1529. this.itemSelections2 = null
  1530. getItemList(this.detailData).then(({data}) => {
  1531. this.itemList1 = data.row1
  1532. this.itemList2 = data.row2
  1533. })
  1534. this.fastAddFlag = true
  1535. },
  1536. // 可选项目
  1537. itemClickRow1 (row) {
  1538. this.$refs.itemTable1.toggleRowSelection(row)
  1539. },
  1540. itemClickRow(row){
  1541. this.currentRow= JSON.parse(JSON.stringify(row))
  1542. },
  1543. // 已有项目
  1544. itemClickRow2 (row) {
  1545. this.$refs.itemTable2.toggleRowSelection(row)
  1546. },
  1547. selectFlag () {
  1548. return true
  1549. },
  1550. selectionItem1 (val) {
  1551. this.itemSelections1 = val
  1552. },
  1553. selectionItem2 (val) {
  1554. this.itemSelections2 = val
  1555. },
  1556. // 添加明细
  1557. addItem () {
  1558. if (this.itemSelections1 == null || this.itemSelections1.length === 0) {
  1559. this.$message.warning('请选择可选项目!')
  1560. return
  1561. }
  1562. let inData = {
  1563. site: this.detailData.site,
  1564. buNo: this.detailData.buNo,
  1565. templateId: this.detailData.templateId,
  1566. templateName: this.detailData.templateName,
  1567. itemList: this.itemSelections1,
  1568. itemType: this.detailData.itemType,
  1569. }
  1570. addItemDetails(inData).then(({data}) => {
  1571. if (data && data.code === 0) {
  1572. getItemList(this.detailData).then(({data}) => {
  1573. this.itemList1 = data.row1
  1574. this.itemList2 = data.row2
  1575. })
  1576. this.itemSelections1 = []
  1577. } else {
  1578. this.$alert(data.msg, '错误', {
  1579. confirmButtonText: '确定'
  1580. })
  1581. }
  1582. })
  1583. },
  1584. // 删除明细
  1585. deleteItem () {
  1586. if (this.itemSelections2 == null || this.itemSelections2.length === 0) {
  1587. this.$message.warning('请选择已有项目!')
  1588. return
  1589. }
  1590. let inData = {
  1591. site: this.detailData.site,
  1592. buNo: this.detailData.buNo,
  1593. templateId: this.detailData.templateId,
  1594. templateName: this.detailData.templateName,
  1595. itemList: this.itemSelections2,
  1596. itemType: this.detailData.itemType
  1597. }
  1598. delItemDetails(inData).then(({data}) => {
  1599. if (data && data.code === 0) {
  1600. getItemList(this.detailData).then(({data}) => {
  1601. this.itemList1 = data.row1
  1602. this.itemList2 = data.row2
  1603. })
  1604. this.itemSelections2 = []
  1605. } else {
  1606. this.$alert(data.msg, '错误', {
  1607. confirmButtonText: '确定'
  1608. })
  1609. }
  1610. })
  1611. },
  1612. // 关闭后刷新列表
  1613. refreshDetailList () {
  1614. templateDetailsSearch(this.detailData).then(({data}) => {
  1615. this.detailList = data.rows
  1616. })
  1617. },
  1618. closeDialog (){
  1619. this.detailList = []
  1620. this.itemList1 = []
  1621. this.itemList2 = []
  1622. },
  1623. // 删除项目中的明细
  1624. delItemDetails (row) {
  1625. this.$confirm(`是否删除这个检验明细?`, '提示', {
  1626. confirmButtonText: '确定',
  1627. cancelButtonText: '取消',
  1628. type: 'warning'
  1629. }).then(() => {
  1630. delItemDetails(row).then(({data}) => {
  1631. if (data && data.code === 0) {
  1632. templateDetailsSearch(this.detailData).then(({data}) => {
  1633. this.detailList = data.rows
  1634. })
  1635. this.$message({
  1636. message: '操作成功',
  1637. type: 'success',
  1638. duration: 1500,
  1639. onClose: () => {}
  1640. })
  1641. } else {
  1642. this.$alert(data.msg, '错误', {
  1643. confirmButtonText: '确定'
  1644. })
  1645. }
  1646. })
  1647. }).catch(() => {
  1648. })
  1649. },
  1650. // 校验用户是否收藏
  1651. favoriteIsOk () {
  1652. let userFavorite = {
  1653. userId: this.$store.state.user.id,
  1654. languageCode: this.$i18n.locale
  1655. }
  1656. userFavoriteList(userFavorite).then(({data}) => {
  1657. for (let i = 0; i < data.list.length; i++) {
  1658. if (this.$route.meta.menuId === data.list[i].menuId) {
  1659. this.favorite = true
  1660. }
  1661. }
  1662. })
  1663. },
  1664. // 收藏 OR 取消收藏
  1665. favoriteFunction () {
  1666. let userFavorite = {
  1667. userId: this.$store.state.user.id,
  1668. functionId: this.$route.meta.menuId,
  1669. }
  1670. if (this.favorite) {
  1671. removeUserFavorite(userFavorite).then(({data}) => {
  1672. this.$message.success(data.msg)
  1673. this.favorite = false
  1674. })
  1675. } else {
  1676. // 收藏
  1677. saveUserFavorite(userFavorite).then(({data}) => {
  1678. this.$message.success(data.msg)
  1679. this.favorite = true
  1680. })
  1681. }
  1682. },
  1683. //导出excel
  1684. async createExportData () {
  1685. this.applyPqcInspectionTypeLimit()
  1686. this.searchData.limit = -1
  1687. this.searchData.page = 1
  1688. await templateSearch(this.searchData).then(({data}) => {
  1689. this.exportList= data.page.list
  1690. })
  1691. return this.exportList
  1692. },
  1693. goUp() {
  1694. goUpItemQC(this.currentRow).then(({data}) => {
  1695. if (data && data.code === 0) {
  1696. templateDetailsSearch(this.detailData).then(({data}) => {
  1697. this.detailList = data.rows
  1698. for (let i = 0; i <this.detailList.length ; i++) {
  1699. if(this.detailList[i].itemNo===this.currentRow.itemNo){
  1700. this.$refs.detailTable.setCurrentRow(this.detailList[i]);
  1701. this.currentRow=JSON.parse(JSON.stringify(this.detailList[i]))
  1702. this.$message.success('操作成功')
  1703. }
  1704. }
  1705. //this.objectSearch()
  1706. })
  1707. }
  1708. })
  1709. },
  1710. goDown() {
  1711. goDownItemQC(this.currentRow).then(({data}) => {
  1712. if (data && data.code === 0) {
  1713. templateDetailsSearch(this.detailData).then(({data}) => {
  1714. this.detailList = data.rows
  1715. for (let i = 0; i <this.detailList.length ; i++) {
  1716. if(this.detailList[i].itemNo===this.currentRow.itemNo){
  1717. this.$refs.detailTable.setCurrentRow(this.detailList[i]);
  1718. this.currentRow=JSON.parse(JSON.stringify(this.detailList[i]))
  1719. this.$message.success('操作成功')
  1720. }
  1721. }
  1722. })
  1723. }
  1724. })
  1725. },
  1726. startDownload() {},
  1727. finishDownload() {},
  1728. fields () {
  1729. let json = "{"
  1730. this.columnList.forEach((item, index) => {
  1731. if (index == this.columnList.length - 1) {
  1732. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1733. } else {
  1734. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1735. }
  1736. })
  1737. json += "}"
  1738. let s = eval("(" + json + ")")
  1739. return s
  1740. },
  1741. // 导入
  1742. qcUpload () {
  1743. let currentData = {
  1744. flag: 'template',
  1745. createBy: this.$store.state.user.name,
  1746. site: this.$store.state.user.site,
  1747. }
  1748. //打开组件 去做新增业务
  1749. this.$nextTick(() => {
  1750. this.$refs.qcUpload.init(currentData)
  1751. })
  1752. },
  1753. // 动态列开始 获取 用户保存的 格式列
  1754. async getTableUserColumn (tableId, columnId) {
  1755. let queryTableUser = {
  1756. userId: this.$store.state.user.name,
  1757. functionId: this.$route.meta.menuId,
  1758. tableId: tableId,
  1759. status: true,
  1760. languageCode: this.$i18n.locale
  1761. }
  1762. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  1763. if (data.rows.length > 0) {
  1764. //this.columnList1 = []
  1765. switch (columnId) {
  1766. case 1:
  1767. this.columnList = data.rows
  1768. break;
  1769. // case 2:
  1770. // this.columnDetailList = data.rows
  1771. // break;
  1772. // case 3:
  1773. // this.columnList2 = data.rows
  1774. // break;
  1775. // case 4:
  1776. // this.columnList3 = data.rows
  1777. // break;
  1778. }
  1779. } else {
  1780. this.getColumnList(tableId, columnId)
  1781. }
  1782. })
  1783. },
  1784. // 获取 tableDefault 列
  1785. async getColumnList (tableId, columnId) {
  1786. let queryTable= {
  1787. functionId: this.$route.meta.menuId,
  1788. tableId: tableId,
  1789. languageCode: this.$i18n.locale
  1790. }
  1791. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1792. if (!data.rows.length == 0) {
  1793. switch (columnId) {
  1794. case 1:
  1795. this.columnList = data.rows
  1796. break;
  1797. // case 2:
  1798. // this.columnDetailList = data.rows
  1799. // break;
  1800. // case 3:
  1801. // this.columnList2 = data.rows
  1802. // break;
  1803. // case 4:
  1804. // this.columnList3 = data.rows
  1805. // break;
  1806. }
  1807. } else {
  1808. // this.showDefault = true.
  1809. }
  1810. })
  1811. },
  1812. //获取按钮的权限数据
  1813. getButtonAuthData () {
  1814. let searchFlag = this.isAuth(this.menuId+":search")
  1815. let saveFlag = this.isAuth(this.menuId+":save")
  1816. let updateFlag = this.isAuth(this.menuId+":update")
  1817. let deleteFlag = this.isAuth(this.menuId+":delete")
  1818. let detailFlag = this.isAuth(this.menuId+":detail")
  1819. //处理页面的权限数据
  1820. this.authSearch = !searchFlag
  1821. this.authSave = !saveFlag
  1822. this.authUpdate = !updateFlag
  1823. this.authDelete = !deleteFlag
  1824. this.authDetail = !detailFlag
  1825. },
  1826. }
  1827. }
  1828. </script>
  1829. <style scoped>
  1830. /deep/ .el-autocomplete-suggestion {
  1831. width: auto!important;
  1832. }
  1833. .el-table /deep/ .cell{
  1834. height: auto;
  1835. line-height: 1.5;
  1836. }
  1837. </style>