index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913
  1. <template>
  2. <view class="page-container uni-column">
  3. <view class="logo-container uni-row">
  4. <image class="logo" src="../../static/images/logo.png" />
  5. <view style="position: absolute; right: 4px;top: 0px;"><text>版本号:{{versionName}}</text></view>
  6. </view>
  7. <view class="title"><text class="label">德迈仕数字生产线管理平台</text></view>
  8. <view class="user-info-container uni-row">
  9. <view class="icon"><text class="label">{{ userInfo.nickName.charAt(0) }}</text></view>
  10. <view class="user-info uni-column">
  11. <view class="nickname uni-row"><text class="label">用户名: {{ userInfo.userName }}</text></view>
  12. <view class="nickname uni-row"><text class="label">ID:{{ userInfo.userId }}</text></view>
  13. <!-- <view class="process uni-row"><text class="label">当前工段:</text><text class="label">{{ deptName }}</text> -->
  14. <!-- </view> -->
  15. </view>
  16. </view>
  17. <view class="user-info uni-column" style="margin: 0 20rpx 20rpx 20rpx;width: 94%;z-index: 4;">
  18. <uni-section title="当前厂别" type="square">
  19. <uni-data-select v-model="curSelectedTenantId" :localdata="tenantList" :clear="false"
  20. @change="handleTenantChange"></uni-data-select>
  21. </uni-section>
  22. <uni-section title="当前工段" type="square">
  23. <uni-data-select v-model="curSelectedDeptId" :localdata="userDeptsByTenantId" :clear="false"
  24. @change="handleDeptChange"></uni-data-select>
  25. </uni-section>
  26. </view>
  27. <!-- <view class="business-btn uni-row" v-if="showOther" @click="handleRecerptSfprod"><text class="label">半成品接收</text></view> -->
  28. <view class="business-btn uni-row" v-if="showOther" @click="handeleToReportHistory">
  29. <text class="label">我的报工</text>
  30. </view>
  31. <view v-if="showQuick && !showOutsource " class="business-btn uni-row" @click="handleFastToProductionPlan">
  32. <text class="label">快速报工</text>
  33. </view>
  34. <view class="business-btn uni-row" v-if="showTakeStock " @click="handleToTakeStock">
  35. <text class="label">盘点</text>
  36. </view>
  37. <view class="business-btn uni-row" v-if="dayworkall('showOther')" @click="handleToProductionPlan">
  38. <text class="label">报工</text>
  39. </view>
  40. <view class="business-btn uni-row" v-if="showOther && !showSizing && !showOutsource && showAssistDaywork"
  41. @click="handleToAssistDaywork">
  42. <text class="label">集中报工</text>
  43. </view>
  44. <view class="business-btn uni-row" v-if="showInnerTurnover && !showOutsource" @click="handleInnerTurnover">
  45. <text class="label">内部周转</text>
  46. </view>
  47. <view class="business-btn uni-row" v-if="dayworkall('showSizing')" @click="handleToSorting">
  48. <text class="label">分选报工</text>
  49. </view>
  50. <view class="business-btn uni-row" v-if="showOutsource && !showSortOutsource" @click="handleToNormalOutsource">
  51. <text class="label">委外报工</text>
  52. </view>
  53. <view class="business-btn uni-row" v-if="showOutsource && showSortOutsource "
  54. @click="handleToUnNormalOutsource">
  55. <text class="label">委外分选</text>
  56. </view>
  57. <view class="business-btn uni-row" v-if="showAuxiliary && !showOutsource" @click="handleToAuxiliary">
  58. <text class="label">辅助工序报工</text>
  59. </view>
  60. <view class="business-btn uni-row" @click="handleToGetLotInfo">
  61. <text class="label">扫码查询批次信息</text>
  62. </view>
  63. <!-- <view class="business-btn uni-row" v-if="showInspector" @click="handleToProcessInspection">
  64. <text class="label">序检</text>
  65. </view> -->
  66. <view class="business-btn uni-row" v-if="!showOutsource" @click="handleToInspectionReceive">
  67. <text class="label">检测领取</text>
  68. </view>
  69. <view class="business-btn uni-row" v-if="!showOutsource" @click="handleToInspectionDetails">
  70. <text class="label">检查列表</text>
  71. </view>
  72. <view class="business-btn uni-row" v-if="showOutsourcedInspector && !showOutsource"
  73. @click="handleToOutsourcedInspection">
  74. <text class="label">外协检查</text>
  75. </view>
  76. <view class="business-btn uni-row" v-if="showDeliveryInspection && !showOutsource"
  77. @click="handleToDeliveryInspection">
  78. <text class="label">交检</text>
  79. </view>
  80. <view class="business-btn uni-row" v-if="showFirstArticleInspection && !showOutsource"
  81. @click="handleToFirstInspection">
  82. <text class="label">首件检</text>
  83. </view>
  84. <view class="business-btn uni-row" v-if="showOnSiteInspector && !showOutsource"
  85. @click="handleToOnSiteInspection">
  86. <text class="label">巡检</text>
  87. </view>
  88. <view class="business-btn uni-row" v-if="showInstrumentRoomInspection && !showOutsource"
  89. @click="handleToInstrumentInspection">
  90. <text class="label">仪器室</text>
  91. </view>
  92. <view class="business-btn uni-row" v-if="!showOutsource " @click="handleToFactoryInspection">
  93. <text class="label">出厂检</text>
  94. </view>
  95. <view class="business-btn uni-row" v-if="showAdjust && !showOutsource" @click="handleToAdjust">
  96. <text class="label">交检审核</text>
  97. </view>
  98. <!-- v-hasRoles="['porter']" 可通过v-Roles自定义指令进行显隐 -->
  99. <view class="business-btn uni-row" v-if="showTurn && !showOutsource" @click="handleToHandlingList">
  100. <text class="label">周转</text>
  101. </view>
  102. <view class="business-btn uni-row" v-if="showOutSourceList && !showOutsource" @click="handleOutsourceList">
  103. <text class="label">外协验箱</text>
  104. </view>
  105. <view class="business-btn uni-row" v-if="showChangeTurnover && !showOutsource" @click="handleChangeTurnover">
  106. <text class="label">更换工段加工</text>
  107. </view>
  108. <view class="bottom-btn-container">
  109. <!-- <view class="start-batch-btn uni-row" @click="handleToEquiPmentList"><text class="label">绑定设备</text></view> -->
  110. <view class="start-batch-btn uni-row" @click="handleSwitchOrQuit">
  111. <text class="label">切换 / 退出账号</text>
  112. </view>
  113. </view>
  114. </view>
  115. <dialog-confirm ref="confirm" @submit="logout"></dialog-confirm>
  116. <dialog-inspectionChamber ref="inspectionChanberRef"
  117. @handleSelectInspectionChamber='handleSelectInspectionChamber'></dialog-inspectionChamber>
  118. </template>
  119. <script setup>
  120. import {
  121. ref
  122. } from 'vue'
  123. import {
  124. onLoad,
  125. onReady
  126. } from '@dcloudio/uni-app'
  127. import {
  128. getSubPlanDetailsList
  129. } from '../../api/business/subPlanDetails'
  130. import {
  131. checkCarrier
  132. } from '../../api/business/processInspection'
  133. import {
  134. getTenantList,
  135. } from '@/api/login/index.js'
  136. import {
  137. getUserDeptList
  138. } from '@/api/dept/dept.js'
  139. import {
  140. listInnerTurnover
  141. } from '../../api/business/innerTurnover'
  142. import {
  143. store
  144. } from '@/store/index.js'
  145. const userName = ref('') // 用户名
  146. const curSelectedDeptId = ref(null) // 用户当前选择的工段
  147. const curSelectedTenantId = ref(null) // 用户当前选择的厂别
  148. const userInfo = ref({}) // 用户信息
  149. const tenantList = ref([]) // 厂别列表
  150. const userDeptList = ref([]) // 用户所在所有工段列表
  151. const userDeptsByTenantId = ref([])
  152. const showOutsource = ref(false)
  153. const showSortOutsource = ref(false)
  154. const confirm = ref(null) // 确认组件
  155. const inspectionChanberRef = ref(null)
  156. const showTurn = ref(false)
  157. const showOther = ref(false)
  158. const showInspector = ref(false);
  159. const showOnSiteInspector = ref(false)
  160. const showInstrumentRoomInspection = ref(false)
  161. const showAdjust = ref(false)
  162. const showAuxiliary = ref(false)
  163. const showQuick = ref(false)
  164. const showSizing = ref(false)
  165. const showTakeStock = ref(false)
  166. const showInnerTurnover = ref(false)
  167. const showOutsourcedInspector = ref(false)
  168. const showDeliveryInspection = ref(false)
  169. const showFirstArticleInspection = ref(false)
  170. const showOutSourceList = ref(false)
  171. const showChangeTurnover = ref(false)
  172. const showAssistDaywork = ref(false)
  173. const versionName = ref(null)
  174. onLoad(() => {
  175. uni.getSystemInfo({
  176. success: function(res) {
  177. versionName.value = res.appVersion;
  178. }
  179. });
  180. console.log(versionName.value)
  181. console.log(store.userInfo)
  182. userInfo.value = store.userInfo || {
  183. nickName: ""
  184. };
  185. store.tenantId = userInfo.value.tenantId;
  186. // console.log("-----------", store.userInfo.roles)
  187. // console.log("-----permissions-----", store.userInfo)
  188. if (store.userInfo.roles.some(item => item.roleId == 124) && store.userInfo.roles.length > 1) {
  189. console.log("111")
  190. showTurn.value = true;
  191. showOther.value = true;
  192. } else if (store.userInfo.roles.some(item => item.roleId == 124) && store.userInfo.roles.length == 1) {
  193. console.log("222")
  194. showTurn.value = true;
  195. showOther.value = false;
  196. } else if (store.userInfo.roles.some(item => item.roleId == 128)) {
  197. console.log("333")
  198. showInspector.value = true
  199. } else {
  200. console.log("444")
  201. showTurn.value = false;
  202. showOther.value = true;
  203. }
  204. //盘点状态
  205. if (store.userInfo.takeStock) {
  206. showTakeStock.value = true
  207. } else {
  208. showTakeStock.value = false
  209. }
  210. //巡检
  211. if (store.userInfo.roles.some(item => item.roleKey == 'patrolInspection')) {
  212. showOnSiteInspector.value = true
  213. } else {
  214. showOnSiteInspector.value = false
  215. }
  216. //交检
  217. if (store.userInfo.roles.some(item => item.roleKey == 'deliveryInspection')) {
  218. showDeliveryInspection.value = true
  219. } else {
  220. showDeliveryInspection.value = false
  221. }
  222. //仪器室
  223. if (store.userInfo.roles.some(item => item.roleKey == 'instrumentRoomInspection')) {
  224. showInstrumentRoomInspection.value = true
  225. } else {
  226. showInstrumentRoomInspection.value = false
  227. }
  228. //首件检
  229. if (store.userInfo.roles.some(item => item.roleKey == 'firstArticleInspection')) {
  230. showFirstArticleInspection.value = true
  231. } else {
  232. showFirstArticleInspection.value = false
  233. }
  234. //交检审核
  235. if (store.userInfo.roles.some(item => item.roleKey == 'adjuster')) {
  236. showAdjust.value = true
  237. } else {
  238. showAdjust.value = false
  239. }
  240. //协助报工
  241. if (store.userInfo.permissions.some(item => item === 'business:assistDaywork:list') || store.userInfo
  242. .permissions.some(item => item === "*:*:*")) {
  243. showAssistDaywork.value = true
  244. } else {
  245. showAssistDaywork.value = false
  246. }
  247. if (store.userInfo.permissions.some(item => item === 'business:outsource:checkBox') || store.userInfo
  248. .permissions.some(item => item === "*:*:*")) {
  249. showOutSourceList.value = true;
  250. } else {
  251. showOutSourceList.value = false;
  252. }
  253. if (store.userInfo.permissions.some(item => item === 'business:switchDept:change') || store.userInfo
  254. .permissions.some(item => item === "*:*:*")) {
  255. showChangeTurnover.value = true;
  256. } else {
  257. showChangeTurnover.value = false;
  258. }
  259. if (store.userInfo.roles.some(item => item.roleId == 129)) {
  260. showOutsourcedInspector.value = true
  261. // showOther.value = true;
  262. }
  263. showAuxiliary.value = true
  264. init();
  265. })
  266. /******************************** 定义一些方法 ********************************/
  267. function init() {
  268. getTenant();
  269. getUserDepts(store.userInfo.userId, store.tenantId);
  270. //getUserDeptsByTenantId(store.tenantId);
  271. }
  272. // 获取租户列表
  273. function getTenant() {
  274. getTenantList().then((res) => {
  275. if (res.code == 200) {
  276. for (var i = 0; i < res.rows.length; i++) {
  277. tenantList.value[i] = {
  278. text: res.rows[i].orgName,
  279. value: res.rows[i].id
  280. }
  281. }
  282. curSelectedTenantId.value = store.userInfo.tenantId;
  283. }
  284. })
  285. }
  286. //根据权限判断是否全部展示分选报工和普通报工
  287. function dayworkall(tape) {
  288. //判断是否有权限,如果没有权限则判断按钮类型
  289. if ((store.userInfo.permissions.some(item => item === 'business:dawworkAll:list') || store.userInfo
  290. .permissions.some(item => item === "*:*:*")) && !showQuick.value) {
  291. // 有权限则全部展示
  292. return true
  293. } else if (tape === "showOther") { //普通报工按钮判断
  294. return (showOther.value && !showSizing.value && !showOutsource.value)
  295. } else if (tape === "showSizing") { //分选报工按钮判断
  296. return (showSizing.value && !showOutsource.value)
  297. }
  298. }
  299. // 获取人员工段
  300. function getUserDepts(userId, tenantId) {
  301. userDeptsByTenantId.value = []
  302. getUserDeptList(userId).then((res) => {
  303. if (res.code == 200) {
  304. userDeptList.value = res.data;
  305. for (let i = 0; i < res.data.length; i++) {
  306. if (res.data[i].tenantId == tenantId) {
  307. userDeptsByTenantId.value.push({
  308. text: res.data[i].deptName,
  309. value: res.data[i].deptId
  310. })
  311. }
  312. }
  313. console.log(userDeptsByTenantId.value)
  314. if (userDeptsByTenantId.value && userDeptsByTenantId.value.length > 0) {
  315. curSelectedDeptId.value = userDeptsByTenantId.value[0].value
  316. console.log(curSelectedDeptId.value)
  317. let curDept = userDeptList.value.find(item => item.deptId === curSelectedDeptId.value)
  318. store.curDeptDetails = curDept
  319. console.log(curDept, "77777")
  320. if (curDept.deptCode === '105060' || store.userInfo.roles.some(item => item.roleKey ==
  321. 'sortingInspector')) {
  322. showSizing.value = true
  323. } else {
  324. showSizing.value = false
  325. }
  326. if (curDept.isSortPackaging == 1) {
  327. showSortOutsource.value = true
  328. } else {
  329. showSortOutsource.value = false
  330. }
  331. if (curDept.isOutsourcing == 1) {
  332. showOutsource.value = true
  333. } else {
  334. showOutsource.value = false
  335. }
  336. console.log(showSortOutsource.value, showOutsource.value)
  337. console.log(store)
  338. handleSelectInnerTurnover()
  339. }
  340. if (res.data.some(v => v.hasQuick === 1) &&
  341. (store.userInfo.permissions.some(item => item ===
  342. 'business:quickDaywork:list') || store.userInfo
  343. .permissions.some(item => item === "*:*:*"))
  344. ) {
  345. showQuick.value = true
  346. } else {
  347. showQuick.value = false
  348. }
  349. }
  350. })
  351. }
  352. // 根据租户id获取到工段
  353. function getUserDeptsByTenantId(tenantId) {
  354. userDeptsByTenantId.value = [];
  355. let newArr = userDeptList.value.filter((item, index, arrs) => item.tenantId == tenantId);
  356. for (var i = 0; i < newArr.length; i++) {
  357. userDeptsByTenantId.value.push({
  358. text: newArr[i].deptName,
  359. value: newArr[i].deptId
  360. })
  361. }
  362. if (newArr && newArr.length > 0) {
  363. curSelectedDeptId.value = userDeptsByTenantId.value[0].value
  364. let curDept = userDeptList.value.find(item => item.deptId === curSelectedDeptId.value)
  365. store.curDeptDetails = curDept
  366. if (curDept.deptCode === '105060' || store.userInfo.roles.some(item => item.roleKey ==
  367. 'sortingInspector')) {
  368. showSizing.value = true
  369. } else {
  370. showSizing.value = false
  371. }
  372. console.log(store)
  373. handleSelectInnerTurnover()
  374. }
  375. }
  376. /*
  377. // 半成品接收
  378. function handleRecerptSfprod() {
  379. if (curSelectedDeptId.value) {
  380. uni.navigateTo({
  381. url: '/pages/recerptSfprod/index'
  382. })
  383. } else {
  384. uni.showToast({
  385. icon: "none",
  386. title: "请选择工段"
  387. })
  388. }
  389. }
  390. */
  391. function handeleToReportHistory() {
  392. uni.navigateTo({
  393. url: '/pages/reportHistory/index'
  394. })
  395. }
  396. function handleToGetLotInfo() {
  397. uni.navigateTo({
  398. url: '/pages/queryLotInfo/index'
  399. })
  400. }
  401. function handleInnerTurnover() {
  402. uni.navigateTo({
  403. url: '/pages/innerTurnover/index'
  404. })
  405. }
  406. function handleFastToProductionPlan() {
  407. if (curSelectedDeptId.value) {
  408. uni.navigateTo({
  409. url: '/pages/fastProductionPlan/index'
  410. })
  411. } else {
  412. uni.showToast({
  413. icon: "none",
  414. title: "请选择工段"
  415. })
  416. }
  417. }
  418. function handleToProductionPlan() {
  419. if (curSelectedDeptId.value) {
  420. uni.navigateTo({
  421. url: '/pages/productionPlan/index'
  422. })
  423. } else {
  424. uni.showToast({
  425. icon: "none",
  426. title: "请选择工段"
  427. })
  428. }
  429. }
  430. function handleToNormalOutsource() {
  431. if (curSelectedDeptId.value) {
  432. uni.navigateTo({
  433. url: '/pages/outsourceProductionPlan/index'
  434. })
  435. } else {
  436. uni.showToast({
  437. icon: "none",
  438. title: "请选择工段"
  439. })
  440. }
  441. }
  442. //检查列表
  443. function handleToInspectionDetails() {
  444. if (curSelectedDeptId.value) {
  445. uni.navigateTo({
  446. url: '/pages/inspectionDetails/index'
  447. })
  448. } else {
  449. uni.showToast({
  450. icon: "none",
  451. title: "请选择工段"
  452. })
  453. }
  454. }
  455. //盘点
  456. function handleToTakeStock() {
  457. if (curSelectedDeptId.value) {
  458. uni.navigateTo({
  459. url: '/pages/takeStock/index'
  460. })
  461. } else {
  462. uni.showToast({
  463. icon: "none",
  464. title: "请选择工段"
  465. })
  466. }
  467. }
  468. //交检审核
  469. function handleToAdjust() {
  470. if (curSelectedDeptId.value) {
  471. uni.navigateTo({
  472. url: '/pages/deliveryExamine/index'
  473. })
  474. } else {
  475. uni.showToast({
  476. icon: "none",
  477. title: "请选择工段"
  478. })
  479. }
  480. }
  481. // 分选
  482. function handleToSorting() {
  483. if (curSelectedDeptId.value) {
  484. uni.navigateTo({
  485. url: '/pages/sortProductionPlan/index'
  486. })
  487. } else {
  488. uni.showToast({
  489. icon: "none",
  490. title: "请选择工段"
  491. })
  492. }
  493. }
  494. // 分选
  495. function handleToUnNormalOutsource() {
  496. if (curSelectedDeptId.value) {
  497. uni.navigateTo({
  498. url: '/pages/sortInnerProductionPlan/index'
  499. })
  500. } else {
  501. uni.showToast({
  502. icon: "none",
  503. title: "请选择工段"
  504. })
  505. }
  506. }
  507. //检查列表
  508. function handleToInspectionReceive() {
  509. const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
  510. if (mpaasScanModule) {
  511. // 调用插件的 mpaasScan 方法
  512. mpaasScanModule.mpaasScan({
  513. // 扫码识别类型,参数可多选,qrCode、barCode,
  514. // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
  515. scanType: ["qrCode", "barCode"],
  516. // 是否隐藏相册,默认false不隐藏
  517. hideAlbum: false,
  518. },
  519. (ret) => {
  520. console.log(ret);
  521. let vehicleObj = {
  522. carrierCode: ret.resp_result
  523. };
  524. if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
  525. uni.showToast({
  526. icon: "none",
  527. title: "请扫载具码",
  528. duration: 1000
  529. })
  530. return;
  531. }
  532. checkCarrier({
  533. carrierCode: vehicleObj.carrierCode,
  534. }).then(response => {
  535. if (response.code == 200) {
  536. uni.navigateTo({
  537. url: "/pages/processInspectionReceive/form",
  538. success: (res) => {
  539. // 通过eventChannel向被打开页面传送数据
  540. res.eventChannel.emit("inspecionCarrierCode", {
  541. carrierCode: vehicleObj.carrierCode
  542. })
  543. }
  544. })
  545. } else {
  546. uni.showToast({
  547. icon: 'none',
  548. title: response.msg,
  549. duration: 2000
  550. })
  551. }
  552. })
  553. }
  554. );
  555. } else {
  556. // 测试时用
  557. checkCarrier({
  558. carrierCode: "300086",
  559. }).then(response => {
  560. if (response.code == 200) {
  561. uni.navigateTo({
  562. url: "/pages/processInspectionReceive/form",
  563. success: (res) => {
  564. // 通过eventChannel向被打开页面传送数据
  565. res.eventChannel.emit("inspecionCarrierCode", {
  566. carrierCode: "300086"
  567. })
  568. }
  569. })
  570. } else {
  571. uni.showToast({
  572. icon: 'none',
  573. title: response.msg,
  574. duration: 2000
  575. })
  576. }
  577. })
  578. }
  579. }
  580. // 外协检查
  581. function handleToOutsourcedInspection() {
  582. uni.navigateTo({
  583. url: '/pages/outsourcedInspection/index'
  584. })
  585. }
  586. // 工序检查
  587. function handleToProcessInspection() {
  588. uni.navigateTo({
  589. url: '/pages/processInspection/index'
  590. })
  591. }
  592. //检查
  593. function handleToInspection() {
  594. inspectionTypeDialog.value.open()
  595. }
  596. function handleToHandlingList() {
  597. console.log(store)
  598. uni.navigateTo({
  599. url: '/pages/handlingList/index'
  600. })
  601. }
  602. function handleOutsourceList() {
  603. uni.navigateTo({
  604. url: '/pages/outsourcedReturnCheck/index'
  605. })
  606. }
  607. //协助报工
  608. function handleToAssistDaywork() {
  609. if (curSelectedDeptId.value) {
  610. uni.navigateTo({
  611. url: '/pages/assistDaywork/index'
  612. })
  613. } else {
  614. uni.showToast({
  615. icon: "none",
  616. title: "请选择工段"
  617. })
  618. }
  619. }
  620. //
  621. function handleChangeTurnover() {
  622. if (curSelectedDeptId.value) {
  623. uni.navigateTo({
  624. url: '/pages/switchDept/index'
  625. })
  626. } else {
  627. uni.showToast({
  628. icon: "none",
  629. title: "请选择工段"
  630. })
  631. }
  632. }
  633. //交检
  634. function handleToDeliveryInspection() {
  635. if (curSelectedDeptId.value) {
  636. uni.navigateTo({
  637. url: '/pages/deliveryInspection/index'
  638. })
  639. } else {
  640. uni.showToast({
  641. icon: "none",
  642. title: "请选择工段"
  643. })
  644. }
  645. }
  646. //首件检
  647. function handleToFirstInspection() {
  648. if (curSelectedDeptId.value) {
  649. uni.navigateTo({
  650. url: '/pages/firstInspection/index'
  651. })
  652. } else {
  653. uni.showToast({
  654. icon: "none",
  655. title: "请选择工段"
  656. })
  657. }
  658. }
  659. //巡检
  660. function handleToOnSiteInspection() {
  661. if (curSelectedDeptId.value) {
  662. uni.navigateTo({
  663. url: '/pages/onSiteInspection/index'
  664. })
  665. } else {
  666. uni.showToast({
  667. icon: "none",
  668. title: "请选择工段"
  669. })
  670. }
  671. }
  672. //仪器室
  673. function handleToInstrumentInspection() {
  674. //选择仪器室
  675. inspectionChanberRef.value.open()
  676. }
  677. function handleSelectInspectionChamber(data) {
  678. uni.navigateTo({
  679. url: "/pages/instrumentRoomInspection/index",
  680. success: (res) => {
  681. // 通过eventChannel向被打开页面传送数据
  682. res.eventChannel.emit("inspectionChamberInfo", {
  683. data: data
  684. })
  685. }
  686. })
  687. }
  688. //出厂检
  689. function handleToFactoryInspection() {
  690. uni.navigateTo({
  691. url: '/pages/factoryInspection/index'
  692. })
  693. }
  694. function logout() {
  695. uni.reLaunch({
  696. url: '/pages/index/index'
  697. })
  698. }
  699. function handleSwitchOrQuit() {
  700. let msg = "确认退出登录吗?"
  701. confirm.value.open(msg);
  702. }
  703. /*
  704. // 绑定设备
  705. function handleToEquiPmentList() {
  706. uni.navigateTo({
  707. url: "/pages/equipmentList/index"
  708. })
  709. }
  710. */
  711. function handleTenantChange() {
  712. console.log(curSelectedTenantId)
  713. store.tenantId = curSelectedTenantId.value
  714. curSelectedDeptId.value = null
  715. getUserDeptsByTenantId(store.tenantId)
  716. }
  717. function handleDeptChange() {
  718. let curDept = userDeptList.value.find(item => item.deptId === curSelectedDeptId.value)
  719. store.curDeptDetails = curDept
  720. if (curDept.deptCode === '105060' || store.userInfo.roles.some(item => item.roleKey ==
  721. 'sortingInspector')) {
  722. showSizing.value = true
  723. } else {
  724. showSizing.value = false
  725. }
  726. if (curDept.isOutsourcing == 1) {
  727. showOutsource.value = true
  728. } else {
  729. showOutsource.value = false
  730. }
  731. if (curDept.isSortPackaging == 1) {
  732. showSortOutsource.value = true
  733. } else {
  734. showSortOutsource.value = false
  735. }
  736. console.log(store)
  737. handleSelectInnerTurnover()
  738. }
  739. //查询当前工段当前操作者是否能看见内部周转按钮
  740. function handleSelectInnerTurnover() {
  741. listInnerTurnover({
  742. deptId: store.curDeptDetails.deptId,
  743. userId: store.userInfo.userId
  744. }).then(res => {
  745. if (res.code == 200) {
  746. showInnerTurnover.value = res.rows.length > 0 ? true : false
  747. }
  748. })
  749. }
  750. function handleToAuxiliary() {
  751. if (curSelectedDeptId.value) {
  752. uni.navigateTo({
  753. url: '/pages/auxiliaryDaywork/index'
  754. })
  755. } else {
  756. uni.showToast({
  757. icon: "none",
  758. title: "请选择工段"
  759. })
  760. }
  761. }
  762. </script>
  763. <style lang="scss">
  764. .page-container {
  765. height: calc(100% - 208rpx);
  766. overflow: auto;
  767. }
  768. .logo-container {
  769. justify-content: center;
  770. .logo {
  771. width: 120rpx;
  772. height: 120rpx;
  773. }
  774. }
  775. .title {
  776. align-items: center;
  777. .label {
  778. font-size: 40rpx;
  779. font-weight: bold;
  780. }
  781. }
  782. .user-info-container {
  783. margin: 16rpx 0 20rpx 20rpx;
  784. align-items: center;
  785. .icon {
  786. width: 120rpx;
  787. height: 120rpx;
  788. justify-content: center;
  789. align-items: center;
  790. border-radius: 60rpx;
  791. border: 1px solid #e1e1e1;
  792. .label {
  793. font-size: 64rpx;
  794. }
  795. }
  796. .user-info {
  797. box-sizing: border-box;
  798. padding-top: 8rpx;
  799. margin-left: 24rpx;
  800. justify-content: center;
  801. // font-size: 20rpx;
  802. .nickname {
  803. margin-bottom: 16rpx;
  804. .label {
  805. font-weight: bold;
  806. font-size: 32rpx;
  807. }
  808. }
  809. .process {
  810. .label {
  811. font-size: 32rpx;
  812. }
  813. }
  814. }
  815. .data-select {
  816. flex: 3;
  817. width: 100%;
  818. height: 50rpx;
  819. border-radius: 18rpx;
  820. background-color: #FFF;
  821. .data-select-options {
  822. width: 200rpx;
  823. }
  824. }
  825. }
  826. .business-btn {
  827. margin: 0 20rpx 20rpx 20rpx;
  828. background-color: #fff;
  829. min-height: 100rpx;
  830. width: 94%;
  831. align-items: center;
  832. justify-content: center;
  833. border: 1rpx solid #e1e1e1;
  834. border-radius: 8rpx;
  835. z-index: 3;
  836. .label {
  837. font-size: 35rpx;
  838. }
  839. }
  840. .bottom-btn-container {
  841. position: fixed;
  842. right: 20rpx;
  843. bottom: 0;
  844. left: 20rpx;
  845. z-index: 3;
  846. .start-batch-btn {
  847. // background-color: grey;
  848. background-color: #1684fc;
  849. margin-bottom: 24rpx;
  850. border-radius: 8rpx;
  851. justify-content: center;
  852. align-items: center;
  853. height: 80rpx;
  854. .label {
  855. font-size: 32rpx;
  856. color: #ffffff;
  857. }
  858. }
  859. }
  860. </style>