index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932
  1. <template>
  2. <view class='container uni-column'>
  3. <view class='nav uni-row'>
  4. <view v-for="(item,index) in statusList" :key="index" :class="{'selecter':singleSelectd(item)}">
  5. <text @click='selectedStatus(item)'> {{item['name']}}</text>
  6. </view>
  7. </view>
  8. <!-- 待周转页面 -->
  9. <view class="padding-container" v-if='selectedInfo.id == 4'>
  10. <view class="scroll-container">
  11. <!-- <uni-section title="本地数据" type="line" padding style="height: calc(100vh - 100px);"> -->
  12. <!-- <uni-data-picker placeholder="请选车间与周转区" popup-title="请选择所在车间与周转区" :localdata="dataTree"
  13. v-model="classes" @change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened"
  14. @popupclosed="onpopupclosed">
  15. </uni-data-picker> -->
  16. <view
  17. style="font-size: 30rpx;font-weight: bold; flex-direction: row; display: inline-block; line-height: 35px; height: 38px;">
  18. <uni-data-select v-model="workshopId" :localdata="dataTree" :clear="true" placeholder="请选择车间"
  19. @change="handleSelectedWorkshopChange" style="background-color: #ffffff;"></uni-data-select>
  20. <uni-data-select v-model="turnoverId" :localdata="dataChildren" :clear="true" plac
  21. placeholder="请选择周转区" @change="handleSelectedTurnoverIdChange"
  22. style="background-color: #ffffff;"></uni-data-select>
  23. </view>
  24. <!-- </uni-section> -->
  25. <view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
  26. <text>暂无待周转批次</text>
  27. </view>
  28. <view v-else v-for="(item, index) in listData" :key="index"
  29. :class="{'list-item':true,'selected':isSelected(item)}">
  30. <!-- @click="handleSelection(item)" -->
  31. <view class="title-container uni-row">
  32. <view class="title uni-row">
  33. <text class="label">{{ item['turnoverArea'] }}</text>
  34. <text class="label code">{{ item['preDeptName'] }}</text>
  35. <text class="label code" style="margin-left: 16rpx;">→</text>
  36. <text class="label code" style="margin-left: 16rpx;">{{ item['deptName'] }}</text>
  37. </view>
  38. <view class="right-info uni-row">
  39. <view class="uni-row"><text class="label right">待周转</text></view>
  40. </view>
  41. </view>
  42. <view class="item-info uni-row"> <text class="label ">批次</text>
  43. <text class="label right">{{ item['lotCode'] }}</text>
  44. </view>
  45. <view class="item-info uni-row"> <text class="label">箱数</text>
  46. <text class="label right ">{{ item['carriers'] }}</text>
  47. </view>
  48. <view class="item-info uni-row">
  49. <text class="label">数量</text>
  50. <text class="label right">{{ item['daywork'].temporaryProcessQualifiedNum }}</text>
  51. </view>
  52. <view class="item-info uni-row">
  53. <text class="label">箱号</text>
  54. <text class="label right">{{ item['carrierName']}}</text>
  55. </view>
  56. <view class="item-info uni-row">
  57. <text class="label">申请时间</text>
  58. <text class="label right">{{ item['startTime']}}</text>
  59. </view>
  60. <view class="item-info uni-row" style="align-items: center;">
  61. <text class="label">申请人</text>
  62. <text class="label right">{{ item['nickName']}}</text>
  63. <view class="uni-row">
  64. <button v-if="item['turnoverType'] == 2" size="mini" style="
  65. color: #ffffff;background-color: #1989fa;margin-right: 10rpx;"
  66. @click.stop="handleChangeDept(item)">变更工段</button>
  67. <button size="mini" @click.stop="handleClickProcessList(item)">&nbsp;工艺列表
  68. </button>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 抽屉 -->
  74. <uni-drawer ref="showRight" mode="right" :mask-click="true">
  75. <view style="text-align: center; font-size: 48rpx; padding: 48rpx 0 24rpx 0;">工艺列表</view>
  76. <view style="font-size: 24rpx;text-align: center;color: red; margin-bottom: 16rpx;">
  77. 仅显示当前工序及后面工艺
  78. </view>
  79. <scroll-view scroll-y="true" style="height: 82%;" @touchmove.stop>
  80. <view v-for="(item,index) in curProcessAfte" :key="index"
  81. style="padding: 8rpx 5% 8rpx 14%; border-top: 1px solid #cccccc">
  82. <text>{{ index + 1 }}.{{item.processAlias}}</text>
  83. </view>
  84. </scroll-view>
  85. </uni-drawer>
  86. <view class="bottom-btn-container uni-row">
  87. <button class="bottom-btn" @click="handleStartTurn">开始周转</button>
  88. </view>
  89. </view>
  90. <!-- 周转中页面 -->
  91. <view class='turnover-container' v-if='selectedInfo.id == 5'>
  92. <view class="scroll-container">
  93. <view v-if="lotList.length == 0" style="color: #999;margin: 50% auto;">
  94. <text>暂无周转中批次</text>
  95. </view>
  96. <!-- 循环周转中的数据 -->
  97. <view v-else class='item-container'>
  98. <!-- <view v-if="products.length > 0" class="turnover-title uni-row">
  99. <view class="uni-row" style="align-items: center;">
  100. <view><text class='title-color'>{{turnoverContentTitle}}箱</text></view>
  101. <view><text class="second-info">{{turnoverSecondTitle}}</text></view>
  102. </view>
  103. <view><text class="label">周转中</text></view>
  104. </view> -->
  105. <view :class="{'list-container':true,'selected':isSelected(item)}" v-for="(item,index) in lotList"
  106. @click="handleSelection(item)" :key='index'>
  107. <view class="turnover-title uni-row">
  108. <view class="uni-row" style="align-items: center;">
  109. <view><text class='title-color'>{{ item[0]['totalCarrier'] }}箱</text></view>
  110. <view><text class="second-info">目标工段: {{ item[0].deptName }}</text>
  111. </view>
  112. </view>
  113. </view>
  114. <view v-for="(lot,index) in item" :key="index" style="margin-bottom: 10rpx;">
  115. <view class="list-container-item product-description uni-row">
  116. <text class="label left-value">产品描述</text>
  117. <text class="label right-value">{{lot['productDescription']}}</text>
  118. </view>
  119. <view class="list-container-item uni-row">
  120. <text class="label left-value">目标</text>
  121. <text class="label right-value">{{item[0].preDeptName + '→' + item[0].deptName }}</text>
  122. </view>
  123. <view class="list-container-item uni-row">
  124. <text class="label left-value">批次</text>
  125. <text class="label right-value">{{lot['lotCode']}}</text>
  126. </view>
  127. <view class="list-container-item uni-row">
  128. <text class="label left-value">箱数</text>
  129. <text class="label right-value">{{lot['carrierName'].split('、').length}}</text>
  130. </view>
  131. <view class="list-container-item uni-row">
  132. <text class="label left-value">箱号</text>
  133. <text class="label right-value">{{lot['carrierName']}}</text>
  134. </view>
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. <!-- <view class='bottom-btn-container uni-row'>
  140. <button type='success' class='bottom-btn' @click="handleScan">扫码确认送达</button>
  141. </view> -->
  142. <view class='bottom-btn-container-2 uni-column'>
  143. <view class="bottom-btn-line uni-row">
  144. <button class='bottom-btn' @click="handleScan" style="background-color: #03d111;">扫码确认送达</button>
  145. </view>
  146. <view class="bottom-btn-line uni-row">
  147. <button type='primary' class='bottom-btn'
  148. @click="handleConfirm('确认送达',store.itemStatus.received)">确认送达</button>
  149. <button class='bottom-btn' @click="handleConfirm('取消周转',store.itemStatus.pendingTurnover,true)"
  150. style="margin-left: 24rpx;background-color: coral;">取消周转</button>
  151. </view>
  152. </view>
  153. </view>
  154. <!-- 已送达页面 -->
  155. <view class='turnover-container' v-if='selectedInfo.id == 7'>
  156. <view class="scroll-container">
  157. <view v-if="deliveredList.length == 0" style="color: #999;margin: 50% auto;">
  158. <text>暂无已送达批次</text>
  159. </view>
  160. <!-- 循环已送达的数据 -->
  161. <view v-else class='item-container'>
  162. <view :class="{'list-container':true,'selected':isSelectedDelivered(item)}"
  163. v-for="(item,index) in deliveredList" @click="handleSelectionDelivered(item)" :key='index'>
  164. <view class="list-container-item product-description uni-row">
  165. <text class="label left-value">周转路径</text>
  166. <text class="">{{item.preDeptName + '→' + item.deptName }}</text>
  167. </view>
  168. <view class="list-container-item product-description uni-row">
  169. <text class="label left-value">产品描述</text>
  170. <text class="label right-value">{{item['productDescription']}}</text>
  171. </view>
  172. <view class="list-container-item uni-row">
  173. <text class="label left-value">批次</text>
  174. <text class="label right-value">{{item['lotCode']}}</text>
  175. </view>
  176. <view class="list-container-item uni-row">
  177. <text class="label left-value">箱数</text>
  178. <text class="label right-value">{{item['carrierName'].split('、').length}}</text>
  179. </view>
  180. <view class="list-container-item uni-row">
  181. <text class="label left-value">箱号</text>
  182. <text class="label right-value">{{item['carrierName']}}</text>
  183. </view>
  184. </view>
  185. </view>
  186. </view>
  187. <view class='bottom-btn-container uni-row'>
  188. <button type='primary' class='bottom-btn'
  189. @click="handleConfirm('取消送达',store.itemStatus.turnoveing)">取消送达</button>
  190. </view>
  191. </view>
  192. </view>
  193. <dialog-turnoverTask ref="turnoverTask"></dialog-turnoverTask>
  194. <dialog-changeTurnover ref="changeTurnoverDialog" @reflushTurnoverList="reflush()" />
  195. </template>
  196. <script setup>
  197. import {
  198. ref
  199. } from 'vue'
  200. import {
  201. onLoad,
  202. onShow
  203. } from '@dcloudio/uni-app'
  204. // import pending from './pending';
  205. // import turnover from './turnover';
  206. import {
  207. getDayWorkItemList,
  208. getItemList,
  209. getHandlingByCarrierCode
  210. } from '@/api/business/dayWorkItem.js'
  211. import {
  212. isTakeStock
  213. } from '@/api/business/taksStackLot.js'
  214. import {
  215. debounce
  216. } from '@/utils/common.js'
  217. import {
  218. updateDayWorkItem,
  219. updateDayWorkItemBatch,
  220. updateBatchBack
  221. } from '@/api/business/dayWorkItem.js'
  222. import {
  223. getDictInfoByType
  224. } from '@/api/dict/dict.js'
  225. import {
  226. getTreeData
  227. } from '@/api/business/workshop.js'
  228. import {
  229. store
  230. } from '../../store'
  231. const classes = ref(null)
  232. const dataTree = ref([])
  233. const dataChildren = ref([])
  234. const sum = ref(0)
  235. const pendingClass = ref({
  236. selecter: true
  237. })
  238. const turnoverClass = ref({
  239. selecter: false
  240. })
  241. const changeTurnoverDialog = ref(null)
  242. const selection = ref([])
  243. const selectedInfo = ref({})
  244. const curProcessAfte = ref([])
  245. const pendingShow = ref(true)
  246. const turnoverShow = ref(false)
  247. const listData = ref([])
  248. const products = ref([])
  249. const confirm = ref(null) // 弹窗组件
  250. const turnoverTask = ref(null) // 弹窗组件
  251. const lotList = ref([])
  252. const deliveredList = ref([])
  253. const showRight = ref(null) // 抽屉
  254. const workshopId = ref(null)
  255. const turnoverId = ref(null)
  256. const statusList = ref([{
  257. "id": 4,
  258. "name": "待周转"
  259. },
  260. {
  261. "id": 5,
  262. "name": "周转中"
  263. },
  264. // {
  265. // "id": 7,
  266. // "name": "已送达"
  267. // }
  268. ])
  269. onLoad(() => {
  270. selectedInfo.value = statusList.value[0]
  271. })
  272. onShow(() => {
  273. // init();
  274. getWorkShops()
  275. })
  276. function getWorkShops() {
  277. console.log('getWorkShops')
  278. getTreeData().then(res => {
  279. console.log(res)
  280. if (res.code === 200) {
  281. dataTree.value = res.data
  282. workshopId.value = dataTree.value[0].value
  283. dataChildren.value = dataTree.value[0].children
  284. turnoverId.value = dataChildren.value.length > 0 ? dataChildren.value[0].value : null
  285. handleSelectedTurnoverIdChange()
  286. }
  287. })
  288. }
  289. // function handleScan() {
  290. // console.log('scan')
  291. // }
  292. function init() {
  293. uni.showLoading({
  294. title: '加载中'
  295. })
  296. Promise.all([getItemList({
  297. status: 4,
  298. //turnoverType设置值是为了筛选掉车间内周转
  299. workshopId: workshopId.value,
  300. turnoverId: turnoverId.value,
  301. turnoverType: 1
  302. }), getItemList({
  303. status: 5,
  304. turnoverType: 1,
  305. updaterId: store.userInfo.userId
  306. }), getItemList({
  307. status: 7,
  308. turnoverType: 1,
  309. updaterId: store.userInfo.userId
  310. })])
  311. .then(([res1, res2, res3]) => {
  312. //待周转
  313. if (res1.code == 200) {
  314. listData.value = res1.rows;
  315. // 设置箱数
  316. for (var i = 0; i < listData.value.length; i++) {
  317. listData.value[i].carriers = listData.value[i].carrierName == null ? 0 : listData.value[i]
  318. .carrierName.split('、').length;
  319. }
  320. console.log("待周转任务", res1)
  321. }
  322. //周转
  323. if (res2.code == 200) {
  324. // 通过dayworkId再分组
  325. const groupedRows = res2.rows.reduce((acc, item) => {
  326. const dept = item.deptId;
  327. if (acc.hasOwnProperty(dept)) {
  328. acc[dept].push(item);
  329. } else {
  330. acc[dept] = [item];
  331. }
  332. return acc;
  333. }, {});
  334. // groupedRows 是一个对象,其键是dayworkId,值是具有相同dayworkId的对象数组
  335. // 如果需要将它转换为二维数组,您可以使用 Object.values 方法
  336. lotList.value = Object.values(groupedRows);
  337. // 设置箱数
  338. for (let i = 0; i < lotList.value.length; i++) {
  339. lotList.value[i][0].totalCarrier = 0;
  340. for (let j = 0; j < lotList.value[i].length; j++) {
  341. lotList.value[i][0].totalCarrier += lotList.value[i][j].carrierName.split('、').length;
  342. }
  343. }
  344. console.log(lotList.value)
  345. console.log(res2.rows)
  346. }
  347. if (res3.code == 200) {
  348. deliveredList.value = res3.rows;
  349. }
  350. uni.hideLoading();
  351. })
  352. }
  353. //变更工段
  354. function handleChangeDept(item) {
  355. changeTurnoverDialog.value.open(item)
  356. }
  357. function handleClickProcessList(item) {
  358. let curProcessAfterList = [];
  359. console.log("工序列表", item)
  360. let nextIndex = 0;
  361. for (let i = 0; i < item.processSequence.length; i++) {
  362. if (item.processStepNumber == item.processSequence[i].processStepNumber) {
  363. nextIndex = i;
  364. }
  365. }
  366. for (let i = 0; i < item.processSequence.length; i++) {
  367. if (i >= nextIndex) {
  368. curProcessAfterList.push(item.processSequence[i]);
  369. }
  370. }
  371. if (item.status == 3) {
  372. curProcessAfterList.splice(0, 1)
  373. }
  374. console.log(curProcessAfterList)
  375. curProcessAfte.value = curProcessAfterList;
  376. showRight.value.open();
  377. }
  378. function reflush() {
  379. // turnoverContentTitle.value = 0;
  380. lotList.value = [];
  381. init();
  382. }
  383. function handleStartTurn() {
  384. isTakeStock().then(response => {
  385. if (response.data) {
  386. uni.showToast({
  387. icon: 'none',
  388. title: '正在盘点,不能开始周转',
  389. duration: 2000
  390. })
  391. } else {
  392. // if(selection.value.length > 0){
  393. // let msg = '是否确认周转?';
  394. // confirm.value.open(msg);
  395. // }
  396. // turnoverTask.value.open(selection.value);
  397. uni.navigateTo({
  398. url: "/pages/startTurnover/index"
  399. })
  400. }
  401. })
  402. }
  403. /**
  404. * 确认后修改item方法
  405. * @param str 弹窗显示的内容
  406. * @param status 修改的状态
  407. * @param isBack 是否为回退修改
  408. */
  409. function handleConfirm(str, status, isBack = false) {
  410. if (selection.value.length > 0) {
  411. uni.showModal({
  412. title: '提示',
  413. content: `是否${str}?`,
  414. success: function(res) {
  415. if (res.confirm) {
  416. handleUpadteStatus(status, isBack);
  417. } else if (res.cancel) {
  418. }
  419. }
  420. })
  421. } else {
  422. uni.showToast({
  423. icon: 'none',
  424. title: `请选择后再点击${str}按钮`,
  425. duration: 2000
  426. })
  427. }
  428. }
  429. function handleUpadteStatus(status, isBack) {
  430. //盘点
  431. isTakeStock().then(response => {
  432. if (response.data) {
  433. uni.showToast({
  434. icon: 'none',
  435. title: '正在盘点,不能操作周转',
  436. duration: 2000
  437. })
  438. } else {
  439. // 设置周转状态
  440. for (let i = 0; i < selection.value.length; i++) {
  441. selection.value[i].status = status;
  442. }
  443. if (isBack) {
  444. updateBatchBack(selection.value).then(res => {
  445. if (res.code === 200) {
  446. uni.showToast({
  447. icon: 'success',
  448. title: '操作成功',
  449. duration: 2000
  450. });
  451. reflush();
  452. } else {
  453. uni.showToast({
  454. icon: 'none',
  455. title: '操作失败',
  456. duration: 2000
  457. });
  458. }
  459. })
  460. } else {
  461. updateDayWorkItemBatch(selection.value).then(res => {
  462. if (res.code === 200) {
  463. uni.showToast({
  464. icon: 'success',
  465. title: '操作成功',
  466. duration: 2000
  467. });
  468. reflush();
  469. } else {
  470. uni.showToast({
  471. icon: 'none',
  472. title: '操作失败',
  473. duration: 2000
  474. });
  475. }
  476. })
  477. }
  478. // 清空选中数组
  479. selection.value = [];
  480. }
  481. })
  482. }
  483. function isSelected(item) {
  484. //单选
  485. return selection.value == item;
  486. //多选
  487. // return selection.value.includes(item);
  488. }
  489. async function handleScan() {
  490. // 先判断是否在盘点中假设不在盘点中则可以继续
  491. const res = await isTakeStock()
  492. if (res.data) {
  493. uni.showToast({
  494. icon: 'none',
  495. title: '正在盘点,不能操作周转',
  496. duration: 2000
  497. })
  498. return
  499. }
  500. const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
  501. if (mpaasScanModule) {
  502. // 调用插件的 mpaasScan 方法
  503. mpaasScanModule.mpaasScan({
  504. // 扫码识别类型,参数可多选,qrCode、barCode,
  505. // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
  506. scanType: ["qrCode", "barCode"],
  507. // 是否隐藏相册,默认false不隐藏
  508. hideAlbum: false,
  509. },
  510. (ret) => {
  511. let vehicleObj = {
  512. carrierCode: ret.resp_result
  513. };
  514. if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
  515. uni.showToast({
  516. icon: "none",
  517. title: "请扫载具码",
  518. duration: 1000
  519. })
  520. return;
  521. }
  522. getHandlingByCarrierCode({
  523. carrierCode: vehicleObj.carrierCode
  524. }).then(response => {
  525. if (response.code == 200) {
  526. reflush()
  527. debounce(handleScan, 700)
  528. } else {
  529. uni.showToast({
  530. icon: 'none',
  531. title: response.msg,
  532. duration: 2000
  533. })
  534. }
  535. })
  536. }
  537. );
  538. } else {
  539. // 测试时用
  540. getHandlingByCarrierCode({
  541. carrierCode: '900005'
  542. }).then(response => {
  543. if (response.code == 200) {
  544. reflush()
  545. debounce(handleScan, 700)
  546. } else {
  547. uni.showToast({
  548. icon: 'none',
  549. title: response.msg,
  550. duration: 2000
  551. })
  552. }
  553. })
  554. }
  555. }
  556. function handleSelection(item) {
  557. // 单选
  558. if (selection.value == item) {
  559. selection.value = []
  560. } else {
  561. selection.value = item;
  562. }
  563. console.log(selection.value, "selection");
  564. }
  565. function isSelectedDelivered(item) {
  566. //多选
  567. return selection.value.includes(item);
  568. }
  569. function handleSelectionDelivered(item) {
  570. //多选
  571. const buttonIndex = selection.value.findIndex(selectedItem => selectedItem === item);
  572. if (buttonIndex > -1) {
  573. selection.value.splice(buttonIndex, 1); // 取消选中
  574. } else {
  575. selection.value.push(item); // 选中
  576. }
  577. }
  578. function selectPending() {
  579. pendingClass.value['selecter'] = true;
  580. turnoverClass.value['selecter'] = false;
  581. pendingShow.value = true;
  582. turnoverShow.value = false;
  583. }
  584. function selectTurnover() {
  585. pendingClass.value['selecter'] = false;
  586. turnoverClass.value['selecter'] = true;
  587. pendingShow.value = false;
  588. turnoverShow.value = true;
  589. }
  590. function selectedStatus(item) {
  591. console.log(item)
  592. selectedInfo.value = item
  593. }
  594. function singleSelectd(item) {
  595. return selectedInfo.value == item
  596. }
  597. function onchange(e) {
  598. // console.log(e)
  599. // console.log(classes.value)
  600. if (e.detail.value.length == 0) {
  601. workshopId.value = null
  602. turnoverId.value = null
  603. } else if (e.detail.value.length == 1) {
  604. workshopId.value = classes.value
  605. turnoverId.value = null
  606. } else if (e.detail.value.length == 2) {
  607. turnoverId.value = classes.value
  608. }
  609. console.log(workshopId.value)
  610. console.log(turnoverId.value)
  611. reflush()
  612. }
  613. function onpopupopened(e) {
  614. // console.log('popupopend', e)
  615. }
  616. function onpopupclosed(e) {
  617. // console.log('onpopupclosed', e)
  618. }
  619. function onnodeclick(e) {
  620. // console.log('nodeclick', e)
  621. }
  622. function handleSelectedWorkshopChange() {
  623. const item = dataTree.value.find(e => e.value == workshopId.value)
  624. if (item != null) {
  625. dataChildren.value = item.children
  626. const currentItem = dataChildren.value.find(e => e.value == turnoverId.value)
  627. turnoverId.value = currentItem != null ? turnoverId.value : null
  628. } else {
  629. turnoverId.value = null
  630. dataChildren.value = []
  631. }
  632. reflush()
  633. }
  634. function handleSelectedTurnoverIdChange() {
  635. reflush()
  636. }
  637. </script>
  638. <style lang="scss">
  639. $navHeight: 48rpx;
  640. /* 导航栏样式 */
  641. .container {
  642. // height: calc(100% - $navHeight);
  643. height: 1500rpx;
  644. position: relative;
  645. top: $navHeight;
  646. background-color: #f5f5f5;
  647. }
  648. .selected {
  649. border: 1px solid #1684fc;
  650. border-radius: 8rpx;
  651. padding: 8rpx;
  652. }
  653. .nav {
  654. justify-content: space-around;
  655. // position: fixed;
  656. // top:0;
  657. width: 100%;
  658. height: $navHeight;
  659. border-bottom: 3rpx solid rgba(228, 231, 237, 1);
  660. background-color: rgba(255, 255, 255, 1);
  661. .img {
  662. width: 24rpx;
  663. height: 24rpx;
  664. position: fixed;
  665. right: 10rpx;
  666. top: 0;
  667. }
  668. }
  669. .selecter {
  670. height: 48rpx;
  671. color: rgba(25, 137, 250, 1);
  672. border-bottom: 3rpx solid rgba(25, 137, 250, 1);
  673. }
  674. /* 待周转样式 */
  675. .padding-container,
  676. .turnover-container {
  677. position: absolute;
  678. top: 56rpx;
  679. right: 0;
  680. bottom: 0rpx;
  681. left: 0;
  682. background-color: #f5f5f5;
  683. .scroll-container {
  684. position: absolute;
  685. top: 24rpx;
  686. right: 0;
  687. bottom: 136rpx;
  688. left: 0;
  689. }
  690. .bottom-btn-container {
  691. height: 10%;
  692. position: fixed;
  693. right: 0;
  694. bottom: 0;
  695. left: 0;
  696. height: 80rpx;
  697. border-top: 1px solid #999999;
  698. padding: 16rpx 32rpx;
  699. align-items: center;
  700. background-color: #fff;
  701. .bottom-btn {
  702. // padding-left: 0;
  703. // padding-top: 4rpx;
  704. flex: 1;
  705. font-size: 28rpx;
  706. color: #FFFFFF;
  707. background-color: #1684fc;
  708. }
  709. }
  710. .bottom-btn-container-2 {
  711. // height: 50px;
  712. position: fixed;
  713. right: 0;
  714. bottom: 0;
  715. left: 0;
  716. height: 140rpx;
  717. border-top: 1px solid #999999;
  718. padding: 16rpx 32rpx;
  719. align-items: center;
  720. background-color: #fff;
  721. .bottom-btn-line {
  722. display: flex;
  723. width: 100%;
  724. .bottom-btn {
  725. // padding-left: 0;
  726. // padding-top: 4rpx;
  727. flex: 1;
  728. width: 100%;
  729. font-size: 28rpx;
  730. color: #FFFFFF;
  731. background-color: #1684fc;
  732. margin-bottom: 4rpx;
  733. }
  734. .bottom-btn .success {
  735. background-color: #03d111;
  736. }
  737. }
  738. }
  739. }
  740. .padding-container {
  741. .scroll-container {
  742. max-height: 90%;
  743. overflow: auto;
  744. .list-item {
  745. background-color: #fff;
  746. padding: 0 24rpx;
  747. padding-bottom: 24rpx;
  748. margin: 0 24rpx;
  749. margin-bottom: 24rpx;
  750. border-radius: 8rpx;
  751. .title-container {
  752. justify-content: space-between;
  753. margin-top: 8rpx;
  754. margin-bottom: 16rpx;
  755. .title {
  756. height: 48rpx;
  757. align-items: center;
  758. .label {
  759. color: #1684fc;
  760. font-size: 32rpx;
  761. font-weight: bold;
  762. &.code {
  763. color: #000000;
  764. margin-left: 32rpx;
  765. }
  766. }
  767. }
  768. }
  769. .item-info {
  770. margin-bottom: 16rpx;
  771. .label {
  772. font-size: 28rpx;
  773. width: 160rpx;
  774. color: #808080;
  775. &.right {
  776. flex: 1;
  777. color: #000000;
  778. }
  779. }
  780. }
  781. .right-info {
  782. justify-content: flex-end;
  783. margin-top: 2rpx;
  784. .label {
  785. font-size: 28rpx;
  786. color: #808080;
  787. }
  788. }
  789. }
  790. }
  791. }
  792. /* 周转中样式 */
  793. .turnover-container {
  794. .scroll-container {
  795. height: 90%;
  796. overflow: scroll;
  797. .item-container {
  798. // height: 90%;
  799. // padding: 8rpx 0 32rpx 0;
  800. margin: 0 24rpx;
  801. margin-bottom: 24rpx;
  802. background-color: rgba(255, 255, 255, 1);
  803. border-radius: 8rpx;
  804. .turnover-title {
  805. width: auto;
  806. justify-content: space-between;
  807. margin: 16rpx;
  808. font-weight: bold;
  809. .label {
  810. font-size: 28rpx;
  811. color: #808080;
  812. }
  813. }
  814. .list-container {
  815. // margin: 16rpx 24rpx 16rpx 24rpx;
  816. width: calc(100% - 48rpx);
  817. margin: 16rpx auto;
  818. .list-container-item {
  819. border-bottom: 1px solid #999999;
  820. padding: 12rpx 8rpx;
  821. background-color: #EEF0F5;
  822. &.product-description {
  823. background-color: #ECF5FF;
  824. }
  825. .label {
  826. font-size: 28rpx;
  827. color: #999999;
  828. &.left-value {
  829. width: 152rpx;
  830. }
  831. &.right-value {
  832. flex: 1;
  833. color: #000000;
  834. }
  835. }
  836. }
  837. }
  838. .title-color {
  839. color: rgba(22, 132, 252, 1);
  840. font-size: 36rpx;
  841. font-weight: bold;
  842. }
  843. .second-info {
  844. font-size: 36rpx;
  845. font-weight: bold;
  846. margin-left: 32rpx;
  847. }
  848. .turnover-info {
  849. color: rgba(128, 128, 128, 1);
  850. position: absolute;
  851. top: 10rpx;
  852. right: 40rpx;
  853. font-size: 30rpx;
  854. }
  855. }
  856. }
  857. }
  858. </style>