index.vue 24 KB

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