index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936
  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="showOther && !showSizing && !showOutsource"
  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="showSizing && !showOutsource" @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. 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 getUserDepts(userId, tenantId) {
  295. userDeptsByTenantId.value = []
  296. getUserDeptList(userId).then((res) => {
  297. if (res.code == 200) {
  298. userDeptList.value = res.data;
  299. for (let i = 0; i < res.data.length; i++) {
  300. if (res.data[i].tenantId == tenantId) {
  301. userDeptsByTenantId.value.push({
  302. text: res.data[i].deptName,
  303. value: res.data[i].deptId
  304. })
  305. }
  306. }
  307. console.log(userDeptsByTenantId.value)
  308. if (userDeptsByTenantId.value && userDeptsByTenantId.value.length > 0) {
  309. curSelectedDeptId.value = userDeptsByTenantId.value[0].value
  310. console.log(curSelectedDeptId.value)
  311. let curDept = userDeptList.value.find(item => item.deptId === curSelectedDeptId.value)
  312. store.curDeptDetails = curDept
  313. console.log(curDept, "77777")
  314. if (curDept.deptCode === '105060' || store.userInfo.roles.some(item => item.roleKey ==
  315. 'sortingInspector')) {
  316. showSizing.value = true
  317. } else {
  318. showSizing.value = false
  319. }
  320. if (curDept.isSortPackaging == 1) {
  321. showSortOutsource.value = true
  322. } else {
  323. showSortOutsource.value = false
  324. }
  325. if (curDept.isOutsourcing == 1) {
  326. showOutsource.value = true
  327. } else {
  328. showOutsource.value = false
  329. }
  330. console.log(store)
  331. handleSelectInnerTurnover()
  332. }
  333. if (res.data.some(v => v.hasQuick === 1) &&
  334. (store.userInfo.permissions.some(item => item ===
  335. 'business:quickDaywork:list') || store.userInfo
  336. .permissions.some(item => item === "*:*:*"))
  337. ) {
  338. showQuick.value = true
  339. } else {
  340. showQuick.value = false
  341. }
  342. }
  343. })
  344. }
  345. // 根据租户id获取到工段
  346. function getUserDeptsByTenantId(tenantId) {
  347. userDeptsByTenantId.value = [];
  348. let newArr = userDeptList.value.filter((item, index, arrs) => item.tenantId == tenantId);
  349. for (var i = 0; i < newArr.length; i++) {
  350. userDeptsByTenantId.value.push({
  351. text: newArr[i].deptName,
  352. value: newArr[i].deptId
  353. })
  354. }
  355. if (newArr && newArr.length > 0) {
  356. curSelectedDeptId.value = userDeptsByTenantId.value[0].value
  357. let curDept = userDeptList.value.find(item => item.deptId === curSelectedDeptId.value)
  358. store.curDeptDetails = curDept
  359. if (curDept.deptCode === '105060' || store.userInfo.roles.some(item => item.roleKey ==
  360. 'sortingInspector')) {
  361. showSizing.value = true
  362. } else {
  363. showSizing.value = false
  364. }
  365. console.log(store)
  366. handleSelectInnerTurnover()
  367. }
  368. }
  369. /*
  370. // 半成品接收
  371. function handleRecerptSfprod() {
  372. if (curSelectedDeptId.value) {
  373. uni.navigateTo({
  374. url: '/pages/recerptSfprod/index'
  375. })
  376. } else {
  377. uni.showToast({
  378. icon: "none",
  379. title: "请选择工段"
  380. })
  381. }
  382. }
  383. */
  384. function handeleToReportHistory() {
  385. uni.navigateTo({
  386. url: '/pages/reportHistory/index'
  387. })
  388. }
  389. function handleToGetLotInfo() {
  390. uni.navigateTo({
  391. url: '/pages/queryLotInfo/index'
  392. })
  393. }
  394. function handleInnerTurnover() {
  395. uni.navigateTo({
  396. url: '/pages/innerTurnover/index'
  397. })
  398. }
  399. function handleFastToProductionPlan() {
  400. if (curSelectedDeptId.value) {
  401. uni.navigateTo({
  402. url: '/pages/fastProductionPlan/index'
  403. })
  404. } else {
  405. uni.showToast({
  406. icon: "none",
  407. title: "请选择工段"
  408. })
  409. }
  410. }
  411. function handleToProductionPlan() {
  412. if (curSelectedDeptId.value) {
  413. uni.navigateTo({
  414. url: '/pages/productionPlan/index'
  415. })
  416. } else {
  417. uni.showToast({
  418. icon: "none",
  419. title: "请选择工段"
  420. })
  421. }
  422. }
  423. function handleToNormalOutsource() {
  424. if (curSelectedDeptId.value) {
  425. uni.navigateTo({
  426. url: '/pages/outsourceProductionPlan/index'
  427. })
  428. } else {
  429. uni.showToast({
  430. icon: "none",
  431. title: "请选择工段"
  432. })
  433. }
  434. }
  435. //检查列表
  436. function handleToInspectionDetails() {
  437. if (curSelectedDeptId.value) {
  438. uni.navigateTo({
  439. url: '/pages/inspectionDetails/index'
  440. })
  441. } else {
  442. uni.showToast({
  443. icon: "none",
  444. title: "请选择工段"
  445. })
  446. }
  447. }
  448. //盘点
  449. function handleToTakeStock() {
  450. if (curSelectedDeptId.value) {
  451. uni.navigateTo({
  452. url: '/pages/takeStock/index'
  453. })
  454. } else {
  455. uni.showToast({
  456. icon: "none",
  457. title: "请选择工段"
  458. })
  459. }
  460. }
  461. //交检审核
  462. function handleToAdjust() {
  463. if (curSelectedDeptId.value) {
  464. uni.navigateTo({
  465. url: '/pages/deliveryExamine/index'
  466. })
  467. } else {
  468. uni.showToast({
  469. icon: "none",
  470. title: "请选择工段"
  471. })
  472. }
  473. }
  474. // 分选
  475. function handleToSorting() {
  476. if (curSelectedDeptId.value) {
  477. uni.navigateTo({
  478. url: '/pages/sortProductionPlan/index'
  479. })
  480. } else {
  481. uni.showToast({
  482. icon: "none",
  483. title: "请选择工段"
  484. })
  485. }
  486. }
  487. //H5扫码器回调
  488. function onDecodeHandler(data) {
  489. showQrCodeReader.value = false;
  490. let vehicleObj = {
  491. carrierCode: data
  492. };
  493. if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
  494. uni.showToast({
  495. icon: "none",
  496. title: "请扫载具码",
  497. duration: 1000
  498. })
  499. return;
  500. }
  501. checkCarrier({
  502. carrierCode: vehicleObj.carrierCode,
  503. }).then(response => {
  504. if (response.code == 200) {
  505. uni.navigateTo({
  506. url: "/pages/processInspectionReceive/form",
  507. success: (res) => {
  508. // 通过eventChannel向被打开页面传送数据
  509. res.eventChannel.emit("inspecionCarrierCode", {
  510. carrierCode: vehicleObj.carrierCode
  511. })
  512. }
  513. })
  514. } else {
  515. uni.showToast({
  516. icon: 'none',
  517. title: response.msg,
  518. duration: 2000
  519. })
  520. }
  521. })
  522. }
  523. //H5扫码器关闭
  524. function qrReaderClose() {
  525. showQrCodeReader.value = false;
  526. }
  527. //检查列表
  528. function handleToInspectionReceive() {
  529. showQrCodeReader.value = true;
  530. // const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
  531. // if (mpaasScanModule) {
  532. // // 调用插件的 mpaasScan 方法
  533. // mpaasScanModule.mpaasScan({
  534. // // 扫码识别类型,参数可多选,qrCode、barCode,
  535. // // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
  536. // scanType: ["qrCode", "barCode"],
  537. // // 是否隐藏相册,默认false不隐藏
  538. // hideAlbum: false,
  539. // },
  540. // (ret) => {
  541. // console.log(ret);
  542. // let vehicleObj = {
  543. // carrierCode: ret.resp_result
  544. // };
  545. // if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
  546. // uni.showToast({
  547. // icon: "none",
  548. // title: "请扫载具码",
  549. // duration: 1000
  550. // })
  551. // return;
  552. // }
  553. // checkCarrier({
  554. // carrierCode: vehicleObj.carrierCode,
  555. // }).then(response => {
  556. // if (response.code == 200) {
  557. // uni.navigateTo({
  558. // url: "/pages/processInspectionReceive/form",
  559. // success: (res) => {
  560. // // 通过eventChannel向被打开页面传送数据
  561. // res.eventChannel.emit("inspecionCarrierCode", {
  562. // carrierCode: vehicleObj.carrierCode
  563. // })
  564. // }
  565. // })
  566. // } else {
  567. // uni.showToast({
  568. // icon: 'none',
  569. // title: response.msg,
  570. // duration: 2000
  571. // })
  572. // }
  573. // })
  574. // }
  575. // );
  576. // } else {
  577. // // 测试时用
  578. // checkCarrier({
  579. // carrierCode: "300086",
  580. // }).then(response => {
  581. // if (response.code == 200) {
  582. // uni.navigateTo({
  583. // url: "/pages/processInspectionReceive/form",
  584. // success: (res) => {
  585. // // 通过eventChannel向被打开页面传送数据
  586. // res.eventChannel.emit("inspecionCarrierCode", {
  587. // carrierCode: "300086"
  588. // })
  589. // }
  590. // })
  591. // } else {
  592. // uni.showToast({
  593. // icon: 'none',
  594. // title: response.msg,
  595. // duration: 2000
  596. // })
  597. // }
  598. // })
  599. // }
  600. }
  601. // 外协检查
  602. function handleToOutsourcedInspection() {
  603. uni.navigateTo({
  604. url: '/pages/outsourcedInspection/index'
  605. })
  606. }
  607. // 工序检查
  608. function handleToProcessInspection() {
  609. uni.navigateTo({
  610. url: '/pages/processInspection/index'
  611. })
  612. }
  613. //检查
  614. function handleToInspection() {
  615. inspectionTypeDialog.value.open()
  616. }
  617. function handleToHandlingList() {
  618. console.log(store)
  619. uni.navigateTo({
  620. url: '/pages/handlingList/index'
  621. })
  622. }
  623. function handleOutsourceList() {
  624. uni.navigateTo({
  625. url: '/pages/outsourcedReturnCheck/index'
  626. })
  627. }
  628. //协助报工
  629. function handleToAssistDaywork() {
  630. if (curSelectedDeptId.value) {
  631. uni.navigateTo({
  632. url: '/pages/assistDaywork/index'
  633. })
  634. } else {
  635. uni.showToast({
  636. icon: "none",
  637. title: "请选择工段"
  638. })
  639. }
  640. }
  641. //
  642. function handleChangeTurnover() {
  643. if (curSelectedDeptId.value) {
  644. uni.navigateTo({
  645. url: '/pages/switchDept/index'
  646. })
  647. } else {
  648. uni.showToast({
  649. icon: "none",
  650. title: "请选择工段"
  651. })
  652. }
  653. }
  654. //交检
  655. function handleToDeliveryInspection() {
  656. if (curSelectedDeptId.value) {
  657. uni.navigateTo({
  658. url: '/pages/deliveryInspection/index'
  659. })
  660. } else {
  661. uni.showToast({
  662. icon: "none",
  663. title: "请选择工段"
  664. })
  665. }
  666. }
  667. //首件检
  668. function handleToFirstInspection() {
  669. if (curSelectedDeptId.value) {
  670. uni.navigateTo({
  671. url: '/pages/firstInspection/index'
  672. })
  673. } else {
  674. uni.showToast({
  675. icon: "none",
  676. title: "请选择工段"
  677. })
  678. }
  679. }
  680. //巡检
  681. function handleToOnSiteInspection() {
  682. if (curSelectedDeptId.value) {
  683. uni.navigateTo({
  684. url: '/pages/onSiteInspection/index'
  685. })
  686. } else {
  687. uni.showToast({
  688. icon: "none",
  689. title: "请选择工段"
  690. })
  691. }
  692. }
  693. //仪器室
  694. function handleToInstrumentInspection() {
  695. //选择仪器室
  696. inspectionChanberRef.value.open()
  697. }
  698. function handleSelectInspectionChamber(data) {
  699. uni.navigateTo({
  700. url: "/pages/instrumentRoomInspection/index",
  701. success: (res) => {
  702. // 通过eventChannel向被打开页面传送数据
  703. res.eventChannel.emit("inspectionChamberInfo", {
  704. data: data
  705. })
  706. }
  707. })
  708. }
  709. //出厂检
  710. function handleToFactoryInspection() {
  711. uni.navigateTo({
  712. url: '/pages/factoryInspection/index'
  713. })
  714. }
  715. function logout() {
  716. uni.reLaunch({
  717. url: '/pages/index/index'
  718. })
  719. }
  720. function handleSwitchOrQuit() {
  721. let msg = "确认退出登录吗?"
  722. confirm.value.open(msg);
  723. }
  724. /*
  725. // 绑定设备
  726. function handleToEquiPmentList() {
  727. uni.navigateTo({
  728. url: "/pages/equipmentList/index"
  729. })
  730. }
  731. */
  732. function handleTenantChange() {
  733. console.log(curSelectedTenantId)
  734. store.tenantId = curSelectedTenantId.value
  735. curSelectedDeptId.value = null
  736. getUserDeptsByTenantId(store.tenantId)
  737. }
  738. function handleDeptChange() {
  739. let curDept = userDeptList.value.find(item => item.deptId === curSelectedDeptId.value)
  740. store.curDeptDetails = curDept
  741. if (curDept.deptCode === '105060' || store.userInfo.roles.some(item => item.roleKey ==
  742. 'sortingInspector')) {
  743. showSizing.value = true
  744. } else {
  745. showSizing.value = false
  746. }
  747. if (curDept.isOutsourcing == 1) {
  748. showOutsource.value = true
  749. } else {
  750. showOutsource.value = false
  751. }
  752. if (curDept.isSortPackaging == 1) {
  753. showSortOutsource.value = true
  754. } else {
  755. showSortOutsource.value = false
  756. }
  757. console.log(store)
  758. handleSelectInnerTurnover()
  759. }
  760. //查询当前工段当前操作者是否能看见内部周转按钮
  761. function handleSelectInnerTurnover() {
  762. listInnerTurnover({
  763. deptId: store.curDeptDetails.deptId,
  764. userId: store.userInfo.userId
  765. }).then(res => {
  766. if (res.code == 200) {
  767. showInnerTurnover.value = res.rows.length > 0 ? true : false
  768. }
  769. })
  770. }
  771. function handleToAuxiliary() {
  772. if (curSelectedDeptId.value) {
  773. uni.navigateTo({
  774. url: '/pages/auxiliaryDaywork/index'
  775. })
  776. } else {
  777. uni.showToast({
  778. icon: "none",
  779. title: "请选择工段"
  780. })
  781. }
  782. }
  783. </script>
  784. <style lang="scss">
  785. .page-container {
  786. height: calc(100% - 208rpx);
  787. overflow: auto;
  788. }
  789. .logo-container {
  790. justify-content: center;
  791. .logo {
  792. width: 120rpx;
  793. height: 120rpx;
  794. }
  795. }
  796. .title {
  797. align-items: center;
  798. .label {
  799. font-size: 40rpx;
  800. font-weight: bold;
  801. }
  802. }
  803. .user-info-container {
  804. margin: 16rpx 0 20rpx 20rpx;
  805. align-items: center;
  806. .icon {
  807. width: 120rpx;
  808. height: 120rpx;
  809. justify-content: center;
  810. align-items: center;
  811. border-radius: 60rpx;
  812. border: 1px solid #e1e1e1;
  813. .label {
  814. font-size: 64rpx;
  815. }
  816. }
  817. .user-info {
  818. box-sizing: border-box;
  819. padding-top: 8rpx;
  820. margin-left: 24rpx;
  821. justify-content: center;
  822. // font-size: 20rpx;
  823. .nickname {
  824. margin-bottom: 16rpx;
  825. .label {
  826. font-weight: bold;
  827. font-size: 32rpx;
  828. }
  829. }
  830. .process {
  831. .label {
  832. font-size: 32rpx;
  833. }
  834. }
  835. }
  836. .data-select {
  837. flex: 3;
  838. width: 100%;
  839. height: 50rpx;
  840. border-radius: 18rpx;
  841. background-color: #FFF;
  842. .data-select-options {
  843. width: 200rpx;
  844. }
  845. }
  846. }
  847. .business-btn {
  848. margin: 0 20rpx 20rpx 20rpx;
  849. background-color: #fff;
  850. min-height: 100rpx;
  851. width: 94%;
  852. align-items: center;
  853. justify-content: center;
  854. border: 1rpx solid #e1e1e1;
  855. border-radius: 8rpx;
  856. .label {
  857. font-size: 35rpx;
  858. }
  859. }
  860. .bottom-btn-container {
  861. position: fixed;
  862. right: 0;
  863. bottom: 0;
  864. left: 0;
  865. height: 50px;
  866. border-top: 1px solid #999999;
  867. padding: 16rpx 32rpx;
  868. align-items: center;
  869. background-color: #fff;
  870. justify-content: space-evenly;
  871. .start-batch-btn {
  872. // background-color: grey;
  873. background-color: #1684fc;
  874. // margin-bottom: 24rpx;
  875. border-radius: 8rpx;
  876. justify-content: center;
  877. align-items: center;
  878. height: 50rpx;
  879. flex: 1;
  880. width: 100%;
  881. .label {
  882. font-size: 32rpx;
  883. color: #ffffff;
  884. }
  885. }
  886. }
  887. </style>