index.vue 26 KB

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