index.vue 25 KB

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