CCL_QMS检验
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.

1332 lines
42 KiB

​
​
​
5 months ago
​
5 months ago
​
5 months ago
2 months ago
​
​
5 months ago
​
​
​
​
1 month ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
5 months ago
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
5 months ago
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
5 months ago
​
5 months ago
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
5 months ago
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
​
​
5 months ago
​
5 months ago
​
5 months ago
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
5 months ago
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
5 months ago
​
5 months ago
​
5 months ago
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
5 months ago
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
​
1 month ago
​
​
​
​
​
1 month ago
​
​
1 month ago
​
​
​
​
​
​
​
​
​
5 months ago
​
5 months ago
​
5 months ago
​
5 months ago
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
5 months ago
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
5 months ago
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 month ago
​
​
​
​
4 weeks ago
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
5 months ago
​
​
​
​
​
​
​
​
1 month ago
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 month ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 weeks ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
1 month ago
1 month ago
​
​
​
1 month ago
​
1 month ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 month ago
​
​
​
1 month ago
​
1 month ago
1 month ago
1 month ago
​
1 month ago
1 month ago
​
1 month ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <template>
  2. <div class="mod-user">
  3. <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
  4. <el-form-item>
  5. <el-input v-model="dataForm.userName" :placeholder="$t('sys.user.userAccount')" clearable></el-input>
  6. </el-form-item>
  7. <el-form-item>
  8. <el-input v-model="dataForm.userNo" :placeholder="$t('sys.user.userNo')" clearable></el-input>
  9. </el-form-item>
  10. <el-form-item>
  11. <el-input v-model="dataForm.userDisplay" :placeholder="$t('sys.user.userName')" clearable></el-input>
  12. </el-form-item>
  13. <el-form-item>
  14. <el-input v-model="dataForm.domainControlAccount" :placeholder="$t('sys.user.domainControlAccount')" clearable></el-input>
  15. </el-form-item>
  16. <el-form-item>
  17. <el-button @click="getDataList()" type="primary">{{ buttons.search || $t('sys.common.search') }}</el-button>
  18. <el-button v-if="isAuth('sys:user:save')" type="primary" @click="addOrUpdateHandle()">{{ buttons.add || $t('sys.common.add') }}</el-button>
  19. <el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="siteAuthorize()"> {{ buttons.factoryAuthorization || $t('sys.user.factoryAuthorization') }}</el-button>
  20. <el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="buAuthorize()">{{ buttons.buAuthorization || $t('sys.user.buAuthorization') }}</el-button>
  21. <el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="deptAuthorize()">{{ buttons.deptAuthorization || $t('sys.user.deptAuthorization') }}</el-button>
  22. <el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="roleAuthorize()">{{ buttons.roleAuthorization || '岗位授权' }}</el-button>
  23. <!-- <el-button v-if="isAuth('sys:user:save')" :disabled="this.showButton" type="primary" @click="machineResourceAuthorize()">{{ buttons.machineResourceAuthorization || $t('sys.user.machineResourceAuthorization') }}</el-button> -->
  24. </el-form-item>
  25. </el-form>
  26. <el-table
  27. :data="dataList"
  28. border
  29. :height="height"
  30. v-loading="dataListLoading"
  31. @selection-change="selectionChangeHandle"
  32. highlight-current-row
  33. @current-change="handleCurrentChange"
  34. style="width: 100%;">
  35. <el-table-column
  36. prop="username"
  37. header-align="center"
  38. align="center"
  39. :label="buttons.username||$t('sys.user.userAccount')">
  40. </el-table-column>
  41. <el-table-column
  42. prop="userNo"
  43. header-align="center"
  44. align="center"
  45. :label="buttons.userNo||$t('sys.user.userNo')">
  46. </el-table-column>
  47. <el-table-column
  48. prop="userDisplay"
  49. header-align="center"
  50. align="center"
  51. :label="buttons.userDisplay||$t('sys.user.userName')">
  52. </el-table-column>
  53. <el-table-column
  54. prop="domainControlAccount"
  55. header-align="center"
  56. align="center"
  57. :label="$t('sys.user.domainControlAccount')">
  58. </el-table-column>
  59. <el-table-column
  60. prop="isDomainControl"
  61. header-align="center"
  62. align="center"
  63. width="110"
  64. :label="$t('sys.user.isDomainControl')">
  65. <template slot-scope="scope">
  66. <span>{{ scope.row.isDomainControl === 1 ? $t('sys.common.yes') : $t('sys.common.no') }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column
  70. prop="ifsUsername"
  71. header-align="center"
  72. align="center"
  73. :label="$t('sys.user.ifsUsername')">
  74. </el-table-column>
  75. <el-table-column
  76. prop="email"
  77. header-align="center"
  78. align="center"
  79. :label="buttons.email||$t('sys.user.email')">
  80. </el-table-column>
  81. <el-table-column
  82. prop="mobile"
  83. header-align="center"
  84. align="center"
  85. :label="buttons.mobile||$t('sys.user.mobile')">
  86. </el-table-column>
  87. <el-table-column
  88. prop="languageDefault"
  89. header-align="center"
  90. align="center"
  91. width="100"
  92. :label="$t('sys.user.defaultLanguage')">
  93. <template slot-scope="scope">
  94. {{ formatLanguageDefault(scope.row.languageDefault) }}
  95. </template>
  96. </el-table-column>
  97. <el-table-column
  98. prop="status"
  99. header-align="center"
  100. align="center"
  101. :label="buttons.status||$t('sys.user.status')">
  102. <template slot-scope="scope">
  103. <el-link v-if="scope.row.status === 0" type="success">{{ buttons.disable || $t('sys.user.disabled') }}</el-link>
  104. <el-link v-else type="danger">{{ buttons.normal || $t('sys.user.normal') }}</el-link>
  105. </template>
  106. </el-table-column>
  107. <el-table-column
  108. prop="createTime"
  109. header-align="center"
  110. align="center"
  111. width="180"
  112. :label="buttons.createTime||$t('sys.common.createTime')">
  113. </el-table-column>
  114. <el-table-column
  115. fixed="right"
  116. header-align="center"
  117. align="center"
  118. width="110"
  119. :label="buttons.cz||$t('sys.common.operation')">
  120. <template slot-scope="scope">
  121. <a v-if="isAuth('sys:user:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.userId)">{{ buttons.edit || $t('sys.common.edit') }}</a>
  122. <a v-if="isAuth('sys:user:delete')" type="text" size="small" @click="deleteHandle(scope.row.userId)">{{ buttons.delete || $t('sys.common.delete') }}</a>
  123. </template>
  124. </el-table-column>
  125. </el-table>
  126. <el-pagination
  127. style="margin-top: 0px"
  128. @size-change="sizeChangeHandle"
  129. @current-change="currentChangeHandle"
  130. :current-page="pageIndex"
  131. :page-sizes="[20, 50, 100, 200,500]"
  132. :page-size="pageSize"
  133. :total="totalPage"
  134. layout="total, sizes, prev, pager, next, jumper">
  135. </el-pagination>
  136. <!-- 弹窗, 新增 / 修改 -->
  137. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" @close="closeDialog"></add-or-update>
  138. <!-- 新增用户site -->
  139. <el-dialog :title="$t('sys.user.factory')" :close-on-click-modal="false" v-drag :visible.sync="siteAddModal" width="900px">
  140. <div style="font-size: 12px">
  141. <el-form :inline="true" label-position="top" :model="siteData">
  142. <el-form-item :label="$t('sys.user.factoryCode')">
  143. <el-input v-model="siteData.siteid" clearable style="width: 120px"></el-input>
  144. </el-form-item>
  145. <el-form-item :label="$t('sys.user.factoryName')">
  146. <el-input v-model="siteData.sitename" clearable style="width: 200px"></el-input>
  147. </el-form-item>
  148. <el-form-item :label="' '">
  149. <el-button type="primary" @click="getSite()">{{ $t('sys.common.search') }}</el-button>
  150. </el-form-item>
  151. </el-form>
  152. </div>
  153. <el-container style="margin-top: 0px;">
  154. <el-main style="width: 400px; padding: 1px">
  155. <span style="font-size: 12px" >{{ $t('sys.user.availableFactory') }}</span>
  156. <el-table
  157. height="400px"
  158. :data="siteList1"
  159. border
  160. ref="siteTable1"
  161. @row-click="siteClickRow1"
  162. @selection-change="selectionSite1"
  163. highlight-current-row
  164. style="width: 100%">
  165. <el-table-column
  166. type="selection"
  167. header-align="center"
  168. align="center"
  169. width="50">
  170. </el-table-column>
  171. <el-table-column
  172. prop="siteid"
  173. header-align="center"
  174. align="center"
  175. min-width="80"
  176. :label="$t('sys.user.factoryCode')">
  177. </el-table-column>
  178. <el-table-column
  179. prop="sitename"
  180. header-align="center"
  181. align="center"
  182. min-width="120"
  183. :label="$t('sys.user.factoryName')">
  184. </el-table-column>
  185. </el-table>
  186. </el-main>
  187. <el-main style="width: 111px;padding: 1px">
  188. <div style="margin-top: 182px;margin-left: 18px">
  189. <el-button type="primary" @click="addSite()">{{ $t('sys.user.addToRight') }}</el-button>
  190. </div>
  191. <div style="margin-top: 15px;margin-left: 18px">
  192. <el-button type="primary" @click="deleteSite()">{{ $t('sys.user.removeToLeft') }}</el-button>
  193. </div>
  194. </el-main>
  195. <el-main style="width: 400px;padding: 1px">
  196. <span style="font-size: 12px" >{{ $t('sys.user.existingFactory') }}</span>
  197. <el-table
  198. height="400px"
  199. :data="siteList2"
  200. border
  201. ref="siteTable2"
  202. @row-click="siteClickRow2"
  203. @selection-change="selectionSite2"
  204. highlight-current-row
  205. style="width: 100%">
  206. <el-table-column
  207. type="selection"
  208. header-align="center"
  209. align="center"
  210. width="50">
  211. </el-table-column>
  212. <el-table-column
  213. prop="siteid"
  214. header-align="center"
  215. align="center"
  216. min-width="80"
  217. :label="$t('sys.user.factoryCode')">
  218. </el-table-column>
  219. <el-table-column
  220. prop="sitename"
  221. header-align="center"
  222. align="center"
  223. min-width="120"
  224. :label="$t('sys.user.factoryName')">
  225. </el-table-column>
  226. </el-table>
  227. </el-main>
  228. </el-container>
  229. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  230. <el-button type="primary" @click="siteAddModal = false">{{ $t('sys.common.close') }}</el-button>
  231. </el-footer>
  232. </el-dialog>
  233. <!-- 新增用户bu -->
  234. <el-dialog title="BU" :close-on-click-modal="false" v-drag :visible.sync="buAddModal" width="900px">
  235. <div style="font-size: 12px">
  236. <el-form :inline="true" label-position="top" :model="buData">
  237. <el-form-item :label="$t('sys.user.factoryCode')">
  238. <el-input v-model="buData.site" clearable style="width: 120px"></el-input>
  239. </el-form-item>
  240. <el-form-item :label="$t('sys.user.buCode')">
  241. <el-input v-model="buData.buNo" clearable style="width: 120px"></el-input>
  242. </el-form-item>
  243. <el-form-item :label="$t('sys.user.buName')">
  244. <el-input v-model="buData.buDesc" clearable style="width: 200px"></el-input>
  245. </el-form-item>
  246. <el-form-item :label="' '">
  247. <el-button type="primary" @click="getBu()">{{ $t('sys.common.search') }}</el-button>
  248. </el-form-item>
  249. </el-form>
  250. </div>
  251. <el-container style="margin-top: 0px;">
  252. <el-main style="width: 400px; padding: 1px">
  253. <span style="font-size: 12px" >{{ $t('sys.user.availableBu') }}</span>
  254. <el-table
  255. height="400px"
  256. :data="buList1"
  257. border
  258. ref="buTable1"
  259. @row-click="buClickRow1"
  260. @selection-change="selectionBu1"
  261. highlight-current-row
  262. style="width: 100%">
  263. <el-table-column
  264. type="selection"
  265. header-align="center"
  266. align="center"
  267. width="50">
  268. </el-table-column>
  269. <el-table-column
  270. prop="site"
  271. header-align="center"
  272. align="center"
  273. min-width="80"
  274. :label="$t('sys.user.factoryCode')">
  275. </el-table-column>
  276. <el-table-column
  277. prop="buNo"
  278. header-align="center"
  279. align="center"
  280. min-width="80"
  281. :label="$t('sys.user.buCode')">
  282. </el-table-column>
  283. <el-table-column
  284. prop="buDesc"
  285. header-align="center"
  286. align="center"
  287. min-width="120"
  288. :label="$t('sys.user.buName')">
  289. </el-table-column>
  290. </el-table>
  291. </el-main>
  292. <el-main style="width: 111px;padding: 1px">
  293. <div style="margin-top: 182px;margin-left: 18px">
  294. <el-button type="primary" @click="addBu()">{{ $t('sys.user.addToRight') }}</el-button>
  295. </div>
  296. <div style="margin-top: 15px;margin-left: 18px">
  297. <el-button type="primary" @click="deleteBu()">{{ $t('sys.user.removeToLeft') }}</el-button>
  298. </div>
  299. </el-main>
  300. <el-main style="width: 400px;padding: 1px">
  301. <span style="font-size: 12px" >{{ $t('sys.user.existingBu') }}</span>
  302. <el-table
  303. height="400px"
  304. :data="buList2"
  305. border
  306. ref="buTable2"
  307. @row-click="buClickRow2"
  308. @selection-change="selectionBu2"
  309. highlight-current-row
  310. style="width: 100%">
  311. <el-table-column
  312. type="selection"
  313. header-align="center"
  314. align="center"
  315. width="50">
  316. </el-table-column>
  317. <el-table-column
  318. prop="site"
  319. header-align="center"
  320. align="center"
  321. min-width="80"
  322. :label="$t('sys.user.factoryCode')">
  323. </el-table-column>
  324. <el-table-column
  325. prop="buNo"
  326. header-align="center"
  327. align="center"
  328. min-width="80"
  329. :label="$t('sys.user.buCode')">
  330. </el-table-column>
  331. <el-table-column
  332. prop="buDesc"
  333. header-align="center"
  334. align="center"
  335. min-width="120"
  336. :label="$t('sys.user.buName')">
  337. </el-table-column>
  338. </el-table>
  339. </el-main>
  340. </el-container>
  341. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  342. <el-button type="primary" @click="buAddModal = false">{{ $t('sys.common.close') }}</el-button>
  343. </el-footer>
  344. </el-dialog>
  345. <!-- 新增用户部门 -->
  346. <el-dialog :title="$t('sys.user.dept')" :close-on-click-modal="false" v-drag :visible.sync="deptAddModal" width="900px">
  347. <div style="font-size: 12px">
  348. <el-form :inline="true" label-position="top" :model="deptData">
  349. <el-form-item :label="$t('sys.user.deptCode')">
  350. <el-input v-model="deptData.departmentId" clearable style="width: 120px"></el-input>
  351. </el-form-item>
  352. <el-form-item :label="$t('sys.user.deptName')">
  353. <el-input v-model="deptData.departmentName" clearable style="width: 200px"></el-input>
  354. </el-form-item>
  355. <el-form-item :label="' '">
  356. <el-button type="primary" @click="getDept()">{{ $t('sys.common.search') }}</el-button>
  357. </el-form-item>
  358. </el-form>
  359. </div>
  360. <el-container style="margin-top: 0px;">
  361. <el-main style="width: 400px; padding: 1px">
  362. <span style="font-size: 12px" >{{ $t('sys.user.availableDept') }}</span>
  363. <el-table
  364. height="400px"
  365. :data="deptList1"
  366. border
  367. ref="deptTable1"
  368. @row-click="deptClickRow1"
  369. @selection-change="selectionDept1"
  370. highlight-current-row
  371. style="width: 100%">
  372. <el-table-column
  373. type="selection"
  374. header-align="center"
  375. align="center"
  376. width="50">
  377. </el-table-column>
  378. <el-table-column
  379. prop="buDesc"
  380. header-align="center"
  381. align="center"
  382. min-width="80"
  383. label="BU">
  384. </el-table-column>
  385. <el-table-column
  386. prop="departmentId"
  387. header-align="center"
  388. align="center"
  389. min-width="80"
  390. :label="$t('sys.user.deptCode')">
  391. </el-table-column>
  392. <el-table-column
  393. prop="departmentName"
  394. header-align="center"
  395. align="center"
  396. min-width="120"
  397. :label="$t('sys.user.deptName')">
  398. </el-table-column>
  399. </el-table>
  400. </el-main>
  401. <el-main style="width: 111px;padding: 1px">
  402. <div style="margin-top: 182px;margin-left: 18px">
  403. <el-button type="primary" @click="addDept()">{{ $t('sys.user.addToRight') }}</el-button>
  404. </div>
  405. <div style="margin-top: 15px;margin-left: 18px">
  406. <el-button type="primary" @click="deleteDept()">{{ $t('sys.user.removeToLeft') }}</el-button>
  407. </div>
  408. </el-main>
  409. <el-main style="width: 400px;padding: 1px">
  410. <span style="font-size: 12px" >{{ $t('sys.user.existingDept') }}</span>
  411. <el-table
  412. height="400px"
  413. :data="deptList2"
  414. border
  415. ref="deptTable2"
  416. @row-click="deptClickRow2"
  417. @selection-change="selectionDept2"
  418. highlight-current-row
  419. style="width: 100%">
  420. <el-table-column
  421. type="selection"
  422. header-align="center"
  423. align="center"
  424. width="50">
  425. </el-table-column>
  426. <el-table-column
  427. prop="buDesc"
  428. header-align="center"
  429. align="center"
  430. min-width="80"
  431. label="BU">
  432. </el-table-column>
  433. <el-table-column
  434. prop="departmentId"
  435. header-align="center"
  436. align="center"
  437. min-width="80"
  438. :label="$t('sys.user.deptCode')">
  439. </el-table-column>
  440. <el-table-column
  441. prop="departmentName"
  442. header-align="center"
  443. align="center"
  444. min-width="120"
  445. :label="$t('sys.user.deptName')">
  446. </el-table-column>
  447. </el-table>
  448. </el-main>
  449. </el-container>
  450. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  451. <el-button type="primary" @click="deptAddModal = false">{{ $t('sys.common.close') }}</el-button>
  452. </el-footer>
  453. </el-dialog>
  454. <!-- 岗位授权 -->
  455. <el-dialog
  456. style="font-size: 12px"
  457. v-drag
  458. :title="'岗位授权'"
  459. :visible.sync="roleVisible"
  460. width="680px"
  461. :append-to-body="true">
  462. <el-transfer class="rq" filterable v-model="selectRoleList" :props="{
  463. key: 'roleKey',
  464. label: 'roleLabel'
  465. }" :data="roleList" :titles="['未授权岗位', '已授权岗位']"></el-transfer>
  466. <span slot="footer" class="dialog-footer">
  467. <div style="margin-top: 5px">
  468. <el-button type="primary" @click="saveRoleAssessSite()">确定</el-button>
  469. <el-button @click="roleVisible = false" type="primary">取消</el-button>
  470. </div>
  471. </span>
  472. </el-dialog>
  473. <!-- 机台授权弹窗 -->
  474. <el-dialog :title="$t('sys.user.machineResourceAuthorization')" :close-on-click-modal="false" v-drag :visible.sync="machineResourceAddModal" width="900px">
  475. <div style="font-size: 12px">
  476. <el-form :inline="true" label-position="top" :model="machineResourceData">
  477. <el-form-item :label="$t('sys.user.factoryCode')">
  478. <el-input v-model="machineResourceData.site" clearable style="width: 120px"></el-input>
  479. </el-form-item>
  480. <el-form-item :label="$t('sys.user.machineCode')">
  481. <el-input v-model="machineResourceData.resourceID" clearable style="width: 120px"></el-input>
  482. </el-form-item>
  483. <el-form-item :label="$t('sys.user.machineDesc')">
  484. <el-input v-model="machineResourceData.resourceDesc" clearable style="width: 200px"></el-input>
  485. </el-form-item>
  486. <el-form-item :label="' '">
  487. <el-button type="primary" @click="getMachineResource()">{{ $t('sys.common.search') }}</el-button>
  488. </el-form-item>
  489. </el-form>
  490. </div>
  491. <el-container style="margin-top: 0px;">
  492. <el-main style="width: 400px; padding: 1px">
  493. <span style="font-size: 12px" >{{ $t('sys.user.availableMachine') }}</span>
  494. <el-table
  495. height="400px"
  496. :data="machineResourceList1"
  497. border
  498. ref="machineResourceTable1"
  499. @row-click="machineResourceClickRow1"
  500. @selection-change="selectionMachineResource1"
  501. highlight-current-row
  502. style="width: 100%">
  503. <el-table-column
  504. type="selection"
  505. header-align="center"
  506. align="center"
  507. width="50">
  508. </el-table-column>
  509. <el-table-column
  510. prop="resourceID"
  511. header-align="center"
  512. align="center"
  513. min-width="80"
  514. :label="$t('sys.user.machineCode')">
  515. </el-table-column>
  516. <el-table-column
  517. prop="resourceDesc"
  518. header-align="center"
  519. align="center"
  520. min-width="120"
  521. :label="$t('sys.user.machineDesc')">
  522. </el-table-column>
  523. </el-table>
  524. </el-main>
  525. <el-main style="width: 111px;padding: 1px">
  526. <div style="margin-top: 182px;margin-left: 18px">
  527. <el-button type="primary" @click="addMachineResource()">{{ $t('sys.user.addToRight') }}</el-button>
  528. </div>
  529. <div style="margin-top: 15px;margin-left: 18px">
  530. <el-button type="primary" @click="deleteMachineResource()">{{ $t('sys.user.removeToLeft') }}</el-button>
  531. </div>
  532. </el-main>
  533. <el-main style="width: 400px;padding: 1px">
  534. <span style="font-size: 12px" >{{ $t('sys.user.existingMachine') }}</span>
  535. <el-table
  536. height="400px"
  537. :data="machineResourceList2"
  538. border
  539. ref="machineResourceTable2"
  540. @row-click="machineResourceClickRow2"
  541. @selection-change="selectionMachineResource2"
  542. highlight-current-row
  543. style="width: 100%">
  544. <el-table-column
  545. type="selection"
  546. header-align="center"
  547. align="center"
  548. width="50">
  549. </el-table-column>
  550. <el-table-column
  551. prop="resourceID"
  552. header-align="center"
  553. align="center"
  554. min-width="80"
  555. :label="$t('sys.user.machineCode')">
  556. </el-table-column>
  557. <el-table-column
  558. prop="resourceDesc"
  559. header-align="center"
  560. align="center"
  561. min-width="120"
  562. :label="$t('sys.user.machineDesc')">
  563. </el-table-column>
  564. </el-table>
  565. </el-main>
  566. </el-container>
  567. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  568. <el-button type="primary" @click="machineResourceAddModal = false">{{ $t('sys.common.close') }}</el-button>
  569. </el-footer>
  570. </el-dialog>
  571. </div>
  572. </template>
  573. <script>
  574. import {
  575. getSiteList,
  576. addUserSite,
  577. delUserSite,
  578. getSite,
  579. getBuList,
  580. addUserBu,
  581. delUserBu,
  582. getBu,
  583. getDeptList,
  584. addUserDept,
  585. delUserDept,
  586. getDept,
  587. getMachineResourceList,
  588. addUserMachineResource,
  589. delUserMachineResource,
  590. } from '@/api/factory/site.js'
  591. import {searchAccessRoleList, saveAccessRole} from '@/api/base/site.js'
  592. import AddOrUpdate from './user-add-or-update'
  593. import {throttle} from "../../../utils/common";
  594. import {
  595. searchFunctionButtonList,
  596. } from "@/api/sysLanguage.js"
  597. import { normalizeLocale } from '@/i18n/i18n'
  598. export default {
  599. data() {
  600. return {
  601. showButton: true,
  602. height: 200,
  603. currentData: {},
  604. userId: this.$store.state.user.name,
  605. dataForm: {
  606. userName: '',
  607. userNo: '',
  608. userDisplay: '',
  609. domainControlAccount: ''
  610. },
  611. buttons: {
  612. cz: this.$t('sys.common.operation'),
  613. search: this.$t('sys.common.search'),
  614. add: this.$t('sys.common.add'),
  615. edit: this.$t('sys.common.edit'),
  616. delete: this.$t('sys.common.delete'),
  617. specialCompetencies: this.$t('sys.role.authorize'),
  618. factoryAuthorization: this.$t('sys.user.factoryAuthorization'),
  619. buAuthorization: this.$t('sys.user.buAuthorization'),
  620. deptAuthorization: this.$t('sys.user.deptAuthorization'),
  621. roleAuthorization: '岗位授权',
  622. machineResourceAuthorization: this.$t('sys.user.machineResourceAuthorization'),
  623. createTime: this.$t('sys.common.createTime'),
  624. username: this.$t('sys.user.userAccount'),
  625. userNo: this.$t('sys.user.userNo'),
  626. userDisplay: this.$t('sys.user.userName'),
  627. email: this.$t('sys.user.email'),
  628. mobile: this.$t('sys.user.mobile'),
  629. status: this.$t('sys.user.status'),
  630. disable: this.$t('sys.user.disabled'),
  631. normal: this.$t('sys.user.normal'),
  632. auth: this.$t('sys.role.authorize'),
  633. allAuth: this.$t('sys.role.authorize'),
  634. currentAuth: this.$t('sys.role.authorize')
  635. },
  636. dataList: [],
  637. selectUser: {},
  638. pageIndex: 1,
  639. pageSize: 50,
  640. totalPage: 0,
  641. dataListLoading: false,
  642. dataListSelections: [],
  643. addOrUpdateVisible: false,
  644. siteData: {
  645. username: '',
  646. siteid: '',
  647. sitename: '',
  648. active: ''
  649. },
  650. buData: {
  651. site: '',
  652. buNo: '',
  653. buDesc: '',
  654. active: '',
  655. username: ''
  656. },
  657. deptData: {
  658. site: '',
  659. buNo: '',
  660. departmentId: '',
  661. departmentName: '',
  662. active: '',
  663. username: ''
  664. },
  665. machineResourceData: {
  666. site: '',
  667. buNo: '',
  668. resourceID: '',
  669. resourceDesc: '',
  670. username: ''
  671. },
  672. roleVisible: false,
  673. selectRoleList: [],
  674. roleList: [],
  675. siteList1:[],
  676. siteList2:[],
  677. buList1:[],
  678. buList2:[],
  679. deptList1:[],
  680. deptList2:[],
  681. machineResourceList1:[],
  682. machineResourceList2:[],
  683. siteSelections1: [],
  684. siteSelections2: [],
  685. buSelections1: [],
  686. buSelections2: [],
  687. deptSelections1: [],
  688. deptSelections2: [],
  689. machineResourceSelections1: [],
  690. machineResourceSelections2: [],
  691. siteAddModal: false,
  692. buAddModal: false,
  693. deptAddModal: false,
  694. machineResourceAddModal: false,
  695. }
  696. },
  697. components: {
  698. AddOrUpdate
  699. },
  700. activated() {
  701. this.getDataList()
  702. },
  703. mounted() {
  704. this.$nextTick(() => {
  705. this.height = window.innerHeight - 155;
  706. })
  707. },
  708. methods: {
  709. formatLanguageDefault (languageDefault) {
  710. const lang = normalizeLocale(languageDefault || 'cn')
  711. return this.$t(`main.languageName.${lang}`)
  712. },
  713. // 获取button的词典
  714. getFunctionButtonList() {
  715. let queryButton = {
  716. functionId: this.$route.meta.menuId,
  717. tableId: '*',
  718. languageCode: this.$i18n.locale,
  719. objectType: 'button'
  720. }
  721. searchFunctionButtonList(queryButton).then(({data}) => {
  722. if (data.code == 0 && data.data) {
  723. this.buttons = data.data
  724. }
  725. })
  726. },
  727. // 选中行
  728. handleCurrentChange (val) {
  729. this.selectUser = val
  730. this.showButton = false
  731. },
  732. // 获取数据列表
  733. getDataList: throttle(function () {
  734. this.dataListLoading = true
  735. this.$http({
  736. url: this.$http.adornUrl('/sys/user/list'),
  737. method: 'get',
  738. params: this.$http.adornParams({
  739. 'page': this.pageIndex,
  740. 'limit': this.pageSize,
  741. 'username': this.dataForm.userName,
  742. 'userNo': this.dataForm.userNo,
  743. 'userDisplay': this.dataForm.userDisplay,
  744. 'domainControlAccount': this.dataForm.domainControlAccount
  745. })
  746. }).then(({data}) => {
  747. if (data && data.code === 0) {
  748. this.dataList = data.page.list
  749. this.totalPage = data.page.totalCount
  750. } else {
  751. this.dataList = []
  752. this.totalPage = 0
  753. }
  754. this.dataListLoading = false
  755. })
  756. }, 1000),
  757. // 每页数
  758. sizeChangeHandle(val) {
  759. this.pageSize = val
  760. this.pageIndex = 1
  761. this.getDataList()
  762. },
  763. // 当前页
  764. currentChangeHandle(val) {
  765. this.pageIndex = val
  766. this.getDataList()
  767. },
  768. // 多选
  769. selectionChangeHandle(val) {
  770. this.dataListSelections = val
  771. },
  772. // 新增 / 修改
  773. addOrUpdateHandle(id) {
  774. this.addOrUpdateVisible = true
  775. this.$nextTick(() => {
  776. this.$refs.addOrUpdate.init(id)
  777. })
  778. },
  779. // 删除
  780. deleteHandle (id) {
  781. let userIds = id ? [id] : this.dataListSelections.map(item => {
  782. return item.userId
  783. })
  784. this.$confirm(this.$t('sys.user.confirmDelete', { ids: userIds.join(','), action: id ? this.$t('sys.common.delete') : this.$t('sys.user.batchDelete') }), this.$t('sys.common.tip'), {
  785. confirmButtonText: this.$t('sys.common.confirm'),
  786. cancelButtonText: this.$t('sys.common.cancel'),
  787. type: 'warning'
  788. }).then(() => {
  789. this.$http({
  790. url: this.$http.adornUrl('/sys/user/delete'),
  791. method: 'post',
  792. data: this.$http.adornData(userIds, false)
  793. }).then(({data}) => {
  794. if (data && data.code === 0) {
  795. this.$message.success(this.$t('sys.common.operationSuccess'))
  796. this.getDataList()
  797. } else {
  798. this.$message.error(data.msg)
  799. }
  800. })
  801. })
  802. },
  803. closeDialog() {
  804. this.$refs.addOrUpdate.closeDialog()
  805. },
  806. // ========================== 授权工厂 ==========================
  807. // 授权工厂
  808. siteAuthorize () {
  809. this.siteData = {
  810. siteid: '',
  811. sitename: '',
  812. active: ''
  813. }
  814. this.siteSelections1 = null
  815. this.siteSelections2 = null
  816. getSiteList(this.selectUser).then(({data}) => {
  817. this.siteList1 = data.row1
  818. this.siteList2 = data.row2
  819. })
  820. this.siteAddModal = true
  821. },
  822. // 查询可用site
  823. getSite () {
  824. this.siteData.username = this.selectUser.username
  825. getSite(this.siteData).then(({data}) => {
  826. if (data.code === 0) {
  827. this.siteList1 = data.rows
  828. }
  829. })
  830. },
  831. // 可选site
  832. siteClickRow1 (row) {
  833. this.$refs.siteTable1.toggleRowSelection(row)
  834. },
  835. // 已有site
  836. siteClickRow2 (row) {
  837. this.$refs.siteTable2.toggleRowSelection(row)
  838. },
  839. selectionSite1 (val) {
  840. this.siteSelections1 = val
  841. },
  842. selectionSite2 (val) {
  843. this.siteSelections2 = val
  844. },
  845. // 添加site
  846. addSite () {
  847. if(this.siteSelections1 == null || this.siteSelections1.length === 0){
  848. this.$message.warning(this.$t('sys.user.selectAvailableFactory'))
  849. return
  850. }
  851. let inData = {
  852. username: this.selectUser.username,
  853. siteList: this.siteSelections1
  854. }
  855. addUserSite(inData).then(({data}) => {
  856. if (data && data.code === 0) {
  857. getSiteList(this.selectUser).then(({data}) => {
  858. this.siteList1 = data.row1
  859. this.siteList2 = data.row2
  860. })
  861. this.siteSelections1 = []
  862. } else {
  863. this.$alert(data.msg, this.$t('sys.user.error'), {
  864. confirmButtonText: this.$t('sys.common.confirm')
  865. })
  866. }
  867. })
  868. },
  869. // 删除site
  870. deleteSite () {
  871. if(this.siteSelections2 == null || this.siteSelections2.length === 0){
  872. this.$message.warning(this.$t('sys.user.selectExistingFactory'))
  873. return
  874. }
  875. let inData = {
  876. username: this.selectUser.username,
  877. siteList: this.siteSelections2
  878. }
  879. delUserSite(inData).then(({data}) => {
  880. if (data && data.code === 0) {
  881. getSiteList(this.selectUser).then(({data}) => {
  882. this.siteList1 = data.row1
  883. this.siteList2 = data.row2
  884. })
  885. this.siteSelections2 = []
  886. } else {
  887. this.$alert(data.msg, this.$t('sys.user.error'), {
  888. confirmButtonText: this.$t('sys.common.confirm')
  889. })
  890. }
  891. })
  892. },
  893. // ========================== 授权BU ==========================
  894. // 授权BU
  895. buAuthorize () {
  896. this.buData = {
  897. site: '',
  898. buNo: '',
  899. buDesc: '',
  900. active: '',
  901. username: ''
  902. }
  903. this.buSelections1 = null
  904. this.buSelections2 = null
  905. getBuList(this.selectUser).then(({data}) => {
  906. this.buList1 = data.row1
  907. this.buList2 = data.row2
  908. })
  909. this.buAddModal = true
  910. },
  911. // 查询可用bu
  912. getBu () {
  913. this.buData.username = this.selectUser.username
  914. getBu(this.buData).then(({data}) => {
  915. if (data.code === 0) {
  916. this.buList1 = data.rows
  917. }
  918. })
  919. },
  920. // 可选bu
  921. buClickRow1 (row) {
  922. this.$refs.buTable1.toggleRowSelection(row)
  923. },
  924. // 已有bu
  925. buClickRow2 (row) {
  926. this.$refs.buTable2.toggleRowSelection(row)
  927. },
  928. selectionBu1 (val) {
  929. this.buSelections1 = val
  930. },
  931. selectionBu2 (val) {
  932. this.buSelections2 = val
  933. },
  934. // 添加bu
  935. addBu () {
  936. if (this.buSelections1 == null || this.buSelections1.length === 0) {
  937. this.$message.warning(this.$t('sys.user.selectAvailableBu'))
  938. return
  939. }
  940. let inData = {
  941. username: this.selectUser.username,
  942. buList: this.buSelections1
  943. }
  944. addUserBu(inData).then(({data}) => {
  945. if (data && data.code === 0) {
  946. getBuList(this.selectUser).then(({data}) => {
  947. this.buList1 = data.row1
  948. this.buList2 = data.row2
  949. })
  950. this.buSelections1 = []
  951. } else {
  952. this.$alert(data.msg, this.$t('sys.user.error'), {
  953. confirmButtonText: this.$t('sys.common.confirm')
  954. })
  955. }
  956. })
  957. },
  958. // 删除bu
  959. deleteBu () {
  960. if (this.buSelections2 == null || this.buSelections2.length === 0) {
  961. this.$message.warning(this.$t('sys.user.selectExistingBu'))
  962. return
  963. }
  964. let inData = {
  965. username: this.selectUser.username,
  966. buList: this.buSelections2
  967. }
  968. delUserBu(inData).then(({data}) => {
  969. if (data && data.code === 0) {
  970. getBuList(this.selectUser).then(({data}) => {
  971. this.buList1 = data.row1
  972. this.buList2 = data.row2
  973. })
  974. this.buSelections2 = []
  975. } else {
  976. this.$alert(data.msg, this.$t('sys.user.error'), {
  977. confirmButtonText: this.$t('sys.common.confirm')
  978. })
  979. }
  980. })
  981. },
  982. // ========================== 授权部门 ==========================
  983. // 授权部门
  984. deptAuthorize () {
  985. this.deptData = {
  986. site: '',
  987. buNo: '',
  988. departmentId: '',
  989. departmentName: '',
  990. active: '',
  991. username: ''
  992. }
  993. this.deptSelections1 = null
  994. this.deptSelections2 = null
  995. getDeptList(this.selectUser).then(({data}) => {
  996. this.deptList1 = data.row1
  997. this.deptList2 = data.row2
  998. })
  999. this.deptAddModal = true
  1000. },
  1001. // 查询可用部门
  1002. getDept () {
  1003. this.deptData.username = this.selectUser.username
  1004. getDept(this.deptData).then(({data}) => {
  1005. if (data.code === 0) {
  1006. this.deptList1 = data.rows
  1007. }
  1008. })
  1009. },
  1010. // 可选部门
  1011. deptClickRow1 (row) {
  1012. this.$refs.deptTable1.toggleRowSelection(row)
  1013. },
  1014. // 已有部门
  1015. deptClickRow2 (row) {
  1016. this.$refs.deptTable2.toggleRowSelection(row)
  1017. },
  1018. selectionDept1 (val) {
  1019. this.deptSelections1 = val
  1020. },
  1021. selectionDept2 (val) {
  1022. this.deptSelections2 = val
  1023. },
  1024. // 添加部门
  1025. addDept () {
  1026. if (this.deptSelections1 == null || this.deptSelections1.length === 0) {
  1027. this.$message.warning(this.$t('sys.user.selectAvailableDept'))
  1028. return
  1029. }
  1030. let inData = {
  1031. username: this.selectUser.username,
  1032. deptList: this.deptSelections1
  1033. }
  1034. addUserDept(inData).then(({data}) => {
  1035. if (data && data.code === 0) {
  1036. getDeptList(this.selectUser).then(({data}) => {
  1037. this.deptList1 = data.row1
  1038. this.deptList2 = data.row2
  1039. })
  1040. this.deptSelections1 = []
  1041. } else {
  1042. this.$alert(data.msg, this.$t('sys.user.error'), {
  1043. confirmButtonText: this.$t('sys.common.confirm')
  1044. })
  1045. }
  1046. })
  1047. },
  1048. // 删除部门
  1049. deleteDept () {
  1050. if (this.deptSelections2 == null || this.deptSelections2.length === 0) {
  1051. this.$message.warning(this.$t('sys.user.selectExistingDept'))
  1052. return
  1053. }
  1054. let inData = {
  1055. username: this.selectUser.username,
  1056. deptList: this.deptSelections2
  1057. }
  1058. delUserDept(inData).then(({data}) => {
  1059. if (data && data.code === 0) {
  1060. getDeptList(this.selectUser).then(({data}) => {
  1061. this.deptList1 = data.row1
  1062. this.deptList2 = data.row2
  1063. })
  1064. this.deptSelections2 = []
  1065. } else {
  1066. this.$alert(data.msg, this.$t('sys.user.error'), {
  1067. confirmButtonText: this.$t('sys.common.confirm')
  1068. })
  1069. }
  1070. })
  1071. },
  1072. // ========================== 岗位授权 ==========================
  1073. roleAuthorize () {
  1074. this.roleVisible = true
  1075. this.searchRoleList()
  1076. },
  1077. searchRoleList () {
  1078. searchAccessRoleList({
  1079. username: this.selectUser.username,
  1080. active: 'Y'
  1081. }).then(({data}) => {
  1082. this.selectRoleList = data.selectRoleList || []
  1083. this.roleList = (data.roleList || []).map(item => {
  1084. const site = String((item && item.site) || '').trim()
  1085. const roleNo = String((item && item.roleNo) || '').trim()
  1086. const roleDesc = String((item && item.roleDesc) || '').trim()
  1087. return Object.assign({}, item, {
  1088. roleKey: item.roleKey || (site + '|' + roleNo),
  1089. roleLabel: item.roleLabel || (site + ' - ' + roleDesc)
  1090. })
  1091. })
  1092. })
  1093. },
  1094. parseRoleKey (roleKey) {
  1095. const rawKey = String(roleKey || '')
  1096. const splitIndex = rawKey.indexOf('|')
  1097. if (splitIndex < 0) {
  1098. return {
  1099. site: '',
  1100. roleNo: rawKey
  1101. }
  1102. }
  1103. return {
  1104. site: rawKey.substring(0, splitIndex),
  1105. roleNo: rawKey.substring(splitIndex + 1)
  1106. }
  1107. },
  1108. saveRoleAssessSite () {
  1109. if (this.selectRoleList.length === 0) {
  1110. this.$message.warning('请选择角色')
  1111. return false
  1112. }
  1113. let inList = []
  1114. for (let i = 0; i < this.selectRoleList.length; i++) {
  1115. const roleInfo = this.parseRoleKey(this.selectRoleList[i])
  1116. let inData = {
  1117. site: roleInfo.site,
  1118. username: this.selectUser.username,
  1119. roleNo: roleInfo.roleNo
  1120. }
  1121. inList.push(inData)
  1122. }
  1123. saveAccessRole(inList).then(({data}) => {
  1124. if (data && data.code === 0) {
  1125. this.$message.success('操作成功')
  1126. this.roleVisible = false
  1127. } else {
  1128. this.$message.error(data.msg)
  1129. }
  1130. })
  1131. },
  1132. // ========================== 机台授权 ==========================
  1133. // 机台授权
  1134. machineResourceAuthorize () {
  1135. this.machineResourceData = {
  1136. site: '',
  1137. buNo: '',
  1138. resourceID: '',
  1139. resourceDesc: '',
  1140. username: ''
  1141. }
  1142. this.machineResourceSelections1 = null
  1143. this.machineResourceSelections2 = null
  1144. getMachineResourceList(this.selectUser).then(({data}) => {
  1145. this.machineResourceList1 = data.row1
  1146. this.machineResourceList2 = data.row2
  1147. })
  1148. this.machineResourceAddModal = true
  1149. },
  1150. // 查询可用机台
  1151. getMachineResource () {
  1152. this.machineResourceData.username = this.selectUser.username
  1153. getMachineResourceList(this.machineResourceData).then(({data}) => {
  1154. if (data.code === 0) {
  1155. this.machineResourceList1 = data.row1
  1156. }
  1157. })
  1158. },
  1159. // 可选机台
  1160. machineResourceClickRow1 (row) {
  1161. this.$refs.machineResourceTable1.toggleRowSelection(row)
  1162. },
  1163. // 已有机台
  1164. machineResourceClickRow2 (row) {
  1165. this.$refs.machineResourceTable2.toggleRowSelection(row)
  1166. },
  1167. selectionMachineResource1 (val) {
  1168. this.machineResourceSelections1 = val
  1169. },
  1170. selectionMachineResource2 (val) {
  1171. this.machineResourceSelections2 = val
  1172. },
  1173. // 添加机台
  1174. addMachineResource () {
  1175. if (this.machineResourceSelections1 == null || this.machineResourceSelections1.length === 0) {
  1176. this.$message.warning(this.$t('sys.user.selectAvailableMachine'))
  1177. return
  1178. }
  1179. let inData = {
  1180. username: this.selectUser.username,
  1181. resourceList: this.machineResourceSelections1
  1182. }
  1183. addUserMachineResource(inData).then(({data}) => {
  1184. if (data && data.code === 0) {
  1185. getMachineResourceList(this.selectUser).then(({data}) => {
  1186. this.machineResourceList1 = data.row1
  1187. this.machineResourceList2 = data.row2
  1188. })
  1189. this.machineResourceSelections1 = []
  1190. } else {
  1191. this.$alert(data.msg, this.$t('sys.user.error'), {
  1192. confirmButtonText: this.$t('sys.common.confirm')
  1193. })
  1194. }
  1195. })
  1196. },
  1197. // 删除机台
  1198. deleteMachineResource () {
  1199. if (this.machineResourceSelections2 == null || this.machineResourceSelections2.length === 0) {
  1200. this.$message.warning(this.$t('sys.user.selectExistingMachine'))
  1201. return
  1202. }
  1203. let inData = {
  1204. username: this.selectUser.username,
  1205. resourceList: this.machineResourceSelections2
  1206. }
  1207. delUserMachineResource(inData).then(({data}) => {
  1208. if (data && data.code === 0) {
  1209. getMachineResourceList(this.selectUser).then(({data}) => {
  1210. this.machineResourceList1 = data.row1
  1211. this.machineResourceList2 = data.row2
  1212. })
  1213. this.machineResourceSelections2 = []
  1214. } else {
  1215. this.$alert(data.msg, this.$t('sys.user.error'), {
  1216. confirmButtonText: this.$t('sys.common.confirm')
  1217. })
  1218. }
  1219. })
  1220. },
  1221. },
  1222. created() {
  1223. // this.getFunctionButtonList()
  1224. }
  1225. }
  1226. </script>
  1227. <style>
  1228. .rq .el-transfer-panel {
  1229. width: 260px;
  1230. }
  1231. .el-transfer-panel {
  1232. border: 2px solid #17b3a3;
  1233. border-radius: 4px;
  1234. overflow: hidden;
  1235. background: #fff;
  1236. display: inline-block;
  1237. vertical-align: middle;
  1238. width: 200px;
  1239. max-height: 100%;
  1240. -webkit-box-sizing: border-box;
  1241. box-sizing: border-box;
  1242. position: relative;
  1243. }
  1244. .el-transfer-panel .el-transfer-panel__header {
  1245. height: 40px;
  1246. line-height: 40px;
  1247. background: #17b3a3;
  1248. margin: 0;
  1249. padding-left: 15px;
  1250. border-bottom: 1px solid #17b3a3;
  1251. -webkit-box-sizing: border-box;
  1252. box-sizing: border-box;
  1253. color: #000;
  1254. }
  1255. .el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label {
  1256. font-size: 14px;
  1257. color: #303133;
  1258. font-weight: 400;
  1259. }
  1260. .el-dialog__title {
  1261. line-height: 24px;
  1262. font-size: 16px;
  1263. color: #303133;
  1264. }
  1265. </style>