index.vue 22 KB

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