index.vue 22 KB

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