图书馆综合管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

804 lines
31 KiB

11 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
2 weeks ago
10 months ago
2 weeks ago
10 months ago
2 weeks ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
1 week ago
1 week ago
10 months ago
10 months ago
1 week ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
10 months ago
10 months ago
2 weeks ago
11 months ago
10 months ago
10 months ago
11 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
1 week ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
2 weeks ago
10 months ago
10 months ago
2 weeks ago
10 months ago
10 months ago
2 weeks ago
2 weeks ago
1 week ago
2 weeks ago
10 months ago
2 weeks ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
2 weeks ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
11 months ago
10 months ago
10 months ago
10 months ago
10 months ago
2 weeks ago
1 week ago
11 months ago
  1. <template>
  2. <div class="app-container row-container">
  3. <div class="head-container">
  4. <div class="head-search">
  5. <!-- 搜索 -->
  6. <el-select v-model="query.stockStatus" clearable size="small" placeholder="盘点状态" class="filter-item" style="width: 120px" @change="crud.toQuery">
  7. <i slot="prefix" class="iconfont icon-zhuangtai" />
  8. <el-option v-for="item in statusOptions" :key="item.key" :label="item.display_name" :value="item.key" />
  9. </el-select>
  10. <el-select v-model="query.stockType" clearable size="small" placeholder="盘点类型" class="filter-item" style="width: 120px" @change="crud.toQuery">
  11. <i slot="prefix" class="iconfont icon-zhuangtai" />
  12. <el-option v-for="item in TypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
  13. </el-select>
  14. <date-range-picker v-model="blurryTime" class="date-item" />
  15. <el-input v-model="query.search" clearable size="small" placeholder="输入单号/备注关键字搜索" prefix-icon="el-icon-search" style="width: 220px;" class="filter-item" @clear="crud.toQuery" @keyup.enter.native="crud.toQuery" />
  16. <rrOperation />
  17. </div>
  18. <crudOperation :permission="permission">
  19. <template v-slot:middle>
  20. <el-button v-permission="permission.add" class="check-btn" size="mini" @click="crud.toAdd">
  21. <i class="iconfont icon-shengchengpandiandan" />
  22. 全量盘点
  23. </el-button>
  24. </template>
  25. </crudOperation>
  26. </div>
  27. <div class="container-wrap">
  28. <span class="right-top-line" />
  29. <span class="left-bottom-line" />
  30. <el-table
  31. ref="table"
  32. v-loading="crud.loading"
  33. class="archives-table"
  34. :data="crud.data"
  35. style="width: 100%;"
  36. height="calc(100vh - 329px)"
  37. @selection-change="crud.selectionChangeHandler"
  38. @row-click="clickRowHandler"
  39. @row-dblclick="handleDbClick"
  40. >
  41. <el-table-column prop="stockBill" label="盘点单号" />
  42. <el-table-column prop="stockType" label="盘点类型">
  43. <template slot-scope="scope">
  44. <span v-if="scope.row.stockType===1">全量盘点</span>
  45. <span v-if="scope.row.stockType===2">区域盘点</span>
  46. <span v-if="scope.row.stockType===3">计划盘点</span>
  47. <span v-if="scope.row.stockType===4">书架盘点</span>
  48. <span v-if="scope.row.stockType===5">架位盘点</span>
  49. <span v-if="scope.row.stockType===6">层位盘点</span>
  50. <span v-if="scope.row.stockType===7">移动盘点</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column prop="stockRegion" label="目标位置" min-width="180" />
  54. <el-table-column prop="stockGridNum" label="目标数量">
  55. <template slot-scope="scope">
  56. <div>{{ scope.row.stockGridNum + ' / '+ (scope.row.totalGridNum?scope.row.totalGridNum:'0') +' 层位' }}</div>
  57. </template>
  58. </el-table-column>
  59. <el-table-column prop="stockRemarks" label="备注">
  60. <template slot-scope="scope">
  61. <div v-if="scope.row.stockRemarks !== null">{{ scope.row.stockRemarks }}</div>
  62. <div v-else>-</div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column prop="startTime" label="盘点开始时间">
  66. <template slot-scope="scope">
  67. <div v-if="scope.row.startTime !== null">{{ scope.row.startTime | parseTime }}</div>
  68. <div v-else>-</div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column prop="endTime" label="盘点结束时间">
  72. <template slot-scope="scope">
  73. <div v-if="scope.row.endTime !== null">{{ scope.row.endTime | parseTime }}</div>
  74. <div v-else>-</div>
  75. </template>
  76. </el-table-column>
  77. <el-table-column prop="state" label="盘点状态" align="center">
  78. <template slot-scope="scope">
  79. <span v-if="scope.row.state === 0" class="row-state row-lending state-active">已终止</span>
  80. <span v-if="scope.row.state === 1" class="row-state row-warehousing state-active">排队中</span>
  81. <span v-if="scope.row.state === 2" class="row-state row-binding state-active">盘点中</span>
  82. <span v-if="scope.row.state === 3" class="row-state row-physical state-active">已完成</span>
  83. </template>
  84. </el-table-column>
  85. </el-table>
  86. <!--分页组件-->
  87. <pagination v-if="crud.data.length!==0" />
  88. </div>
  89. <!-- form -->
  90. <el-dialog :class="unreachable.length !== 0 ? 'stock-dialog':''" append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="crud.cancelCU" :visible="crud.status.cu > 0" :title="crud.status.title">
  91. <span class="dialog-right-top" />
  92. <span class="dialog-left-bottom" />
  93. <div class="setting-dialog" style="display: flex; justify-content: flex-start;">
  94. <div :style=" {'width': unreachable.length !== 0 ? '670px':''}">
  95. <el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
  96. <el-form-item label="盘点单号" prop="stockBill">
  97. <el-input v-model="form.stockBill" disabled />
  98. </el-form-item>
  99. <el-form-item label="盘点类型" prop="stockTypeName">
  100. <el-input v-model="form.stockTypeName" disabled />
  101. </el-form-item>
  102. <el-form-item label="目标位置" prop="stockRegion">
  103. <el-input v-model="form.stockRegion" disabled />
  104. </el-form-item>
  105. <el-form-item
  106. class="stockGridNumName-style"
  107. label="目标数量"
  108. prop="stockGridNumName"
  109. >
  110. <span v-if="stockInfoLoading" class="el-icon-loading" />
  111. <!-- <el-input v-else disabled v-html="form.stockGridNumName" /> -->
  112. <div v-else style="display: flex; justify-content: flex-start;">
  113. <el-input disabled v-html="form.stockGridNumName" />
  114. <el-popover
  115. class="stock-popover"
  116. placement="top-start"
  117. width="250"
  118. trigger="hover"
  119. >
  120. <div>
  121. <span style="display:block; font-weight: bold; margin-bottom: 10px;">A / B / C 层位 </span>
  122. A开启盘点功能 当前可盘点 层位数量<br>
  123. B开启盘点功能 当前不可盘点 层为数量<br>
  124. C具备盘点功能的 层位数量
  125. </div>
  126. <i slot="reference" class="iconfont icon-zhuyi-lan" />
  127. </el-popover>
  128. </div>
  129. </el-form-item>
  130. <el-row>
  131. <el-form-item label="备注" prop="stockRemarks">
  132. <el-input v-model="form.stockRemarks" type="textarea" style="width: 572px;" :rows="4" />
  133. </el-form-item>
  134. </el-row>
  135. </el-form>
  136. <div slot="footer" class="dialog-footer" style="padding-right: 20px;">
  137. <el-button type="text" @click="crud.cancelCU">取消</el-button>
  138. <el-button :disabled="isBtnDisabled" :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
  139. </div>
  140. </div>
  141. <div v-if="unreachable.length !== 0" style="width: 500px; margin-left: 10px;">
  142. <div class="stock-info-tips">
  143. <p>注意系统检查到有参与本次盘点的摄像头无法连接<i>{{ reachable.length }}</i>/个层架位可盘点</p>
  144. <span>不可盘点具体情况如下</span>
  145. </div>
  146. <div style="display: flex; justify-content: space-between;">
  147. <el-card class="box-card">
  148. <div slot="header">
  149. <span>无法连接的摄像头 <i style="color: #f53f3f; font-weight: bold; font-style: normal;">{{ ipStatusFalseNum }}</i> /)</span>
  150. </div>
  151. <div v-for="(item,index) in ipStatusFalse" :key="index" class="stock-info-item">
  152. <span> {{ item.ip }} </span>
  153. </div>
  154. </el-card>
  155. <el-card class="box-card">
  156. <div slot="header">
  157. <span>无法盘点的层架位 <i style="color: #f53f3f; font-weight: bold; font-style: normal;">{{ unreachable.length }}</i> /</span>
  158. </div>
  159. <div v-for="(item,index) in unreachable" :key="index" class="stock-info-item">
  160. <span> {{ item.gridName }} </span>
  161. </div>
  162. </el-card>
  163. </div>
  164. </div>
  165. </div>
  166. </el-dialog>
  167. <el-dialog class="detailBook" append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="handleCloseDialog" :visible="detailVisible" title="盘点详情">
  168. <span class="dialog-right-top" />
  169. <span class="dialog-left-bottom" />
  170. <div class="setting-dialog">
  171. <div class="detail-tab tab-content">
  172. <ul class="tab-nav">
  173. <li :class="{'active-tab-nav': tabIndex === 0}" @click="changeDetailTab(0)">基础信息</li>
  174. <li :class="{'active-tab-nav': tabIndex === 1}" @click="changeDetailTab(1)">层位盘点信息</li>
  175. </ul>
  176. <el-button v-if="detailInfo.state === 3" style="position: absolute; right: 0; top: -10px;" size="mini" @click="doExport(detailInfo)">
  177. <i class="iconfont icon-daochu" />
  178. 导出
  179. </el-button>
  180. <div v-if="tabIndex===0" class="detail-check">
  181. <ul class="book-detail">
  182. <li><span>盘点单号</span>{{ detailInfo.stockBill }}</li>
  183. <li v-if="detailInfo.stockType===1"><span>盘点类型</span>全量盘点</li>
  184. <li v-if="detailInfo.stockType===2"><span>盘点类型</span>区域盘点</li>
  185. <li v-if="detailInfo.stockType===3"><span>盘点类型</span>计划盘点</li>
  186. <li v-if="detailInfo.stockType===4"><span>盘点类型</span>书架盘点</li>
  187. <li v-if="detailInfo.stockType===5"><span>盘点类型</span>架位盘点</li>
  188. <li v-if="detailInfo.stockType===6"><span>盘点类型</span>层位盘点</li>
  189. <li v-if="detailInfo.stockType===7"><span>盘点类型</span>移动盘点</li>
  190. <li><span>目标位置</span>{{ detailInfo.stockRegion }}</li>
  191. <li><span>目标数量</span>{{ detailInfo.stockGridNum }} / {{ detailInfo.totalGridNum }} 层位</li>
  192. <li v-if="detailInfo.stockRemarks !== null" class="row-li"><span>备注</span>{{ detailInfo.stockRemarks }}</li>
  193. <li v-else class="row-li"><span>备注</span>-</li>
  194. <li v-if="detailInfo.startTime !== null"><span>开始时间</span>{{ detailInfo.startTime | parseTime }}</li>
  195. <li v-else><span>开始时间</span>-</li>
  196. <li v-if="detailInfo.endTime !== null"><span>结束时间</span>{{ detailInfo.endTime | parseTime }}</li>
  197. <li v-else><span>结束时间</span>-</li>
  198. <li class="row-li" style="margin-left: 30px;">
  199. <i v-if="detailInfo.state === 0" class="row-state cancel-state">已终止</i>
  200. <i v-if="detailInfo.state === 1" class="row-state soon-state">排队中</i>
  201. <i v-if="detailInfo.state === 2" class="row-state end-state">盘点中</i>
  202. <i v-if="detailInfo.state === 3" class="row-state ing-state">已完成</i>
  203. </li>
  204. </ul>
  205. <div class="detail-other">
  206. <ul class="book-detail">
  207. <li class="row-li"><span>在架图书</span><p><i style=" font-weight: bold;">{{ detailInfo.onShelfNum }}</i> / </p></li>
  208. <li><span>错架图书</span><p><i style="color:#ED4A41; font-weight: bold;">{{ detailInfo.errorShelfNum }}</i> / </p></li>
  209. <li><span>错架率</span><p style="color:#ED4A41; font-weight: bold;">{{ detailInfo.errorShelfProba }}</p></li>
  210. <li><span>错序图书</span><p><i style="color:#0348f3; font-weight: bold;">{{ detailInfo.errorOrderNum }}</i> / </p></li>
  211. <li><span>错序率</span><p style="color:#0348f3; font-weight: bold;">{{ detailInfo.errorOrderProba }}</p></li>
  212. </ul>
  213. <!-- 图表部分 -->
  214. <div style="width: 60%; height: 140px;">
  215. <taskStockLogEcharts :task-stock-log-data="taskStockLogData" />
  216. </div>
  217. </div>
  218. </div>
  219. <div v-if="tabIndex===1">
  220. <el-table
  221. ref="table"
  222. v-loading="gridTableLoading"
  223. class="archives-table"
  224. :data="detailTable"
  225. style="width: 100%;"
  226. >
  227. <el-table-column prop="gridName" label="层位架" min-width="180" :show-overflow-tooltip="true">
  228. <template slot-scope="scope">
  229. {{ scope.row.gridName | removeQUPrefix }}
  230. </template>
  231. </el-table-column>
  232. <el-table-column prop="floorName" label="楼层" />
  233. <el-table-column prop="regionName" label="区域" min-width="120" />
  234. <el-table-column prop="booksheflCount" label="盘点详情" min-width="280" :show-overflow-tooltip="true">
  235. <template slot-scope="scope">
  236. <ul class="detail-table-info">
  237. <li><span>在架</span><p><i>{{ scope.row.onShelfNum }}</i> / </p> </li>
  238. <li><span>错架</span><p><i style="color:#ED4A41;">{{ scope.row.errorShelfNum }}</i> / </p> </li>
  239. <li><span>错序</span><p><i style="color:#0348f3;">{{ scope.row.errorOrderNum }}</i> / </p> </li>
  240. </ul>
  241. </template>
  242. </el-table-column>
  243. <el-table-column prop="progress" label="进度" min-width="120" :show-overflow-tooltip="true">
  244. <template slot-scope="scope">
  245. <span>{{ scope.row.progress !== null ? scope.row.progress : '-' }}</span>
  246. </template>
  247. </el-table-column>
  248. <el-table-column prop="detailsRemarks" label="备注" min-width="100" :show-overflow-tooltip="true" />
  249. <el-table-column prop="state" label="状态" width="80">
  250. <template slot-scope="scope">
  251. <span v-if="scope.row.state === 0" class="row-state row-lending state-active">已终止</span>
  252. <span v-if="scope.row.state === 1" class="row-state row-warehousing state-active">排队中</span>
  253. <span v-if="scope.row.state === 2" class="row-state row-binding state-active">盘点中</span>
  254. <span v-if="scope.row.state === 3" class="row-state row-physical state-active">已完成</span>
  255. </template>
  256. </el-table-column>
  257. </el-table>
  258. <el-pagination
  259. v-if="detailTable.length !== 0"
  260. :page-size.sync="detailPage.size"
  261. :total="detailPage.total"
  262. :current-page.sync="detailPage.page"
  263. style="margin-top: 8px;"
  264. :pager-count="5"
  265. layout="total, sizes, prev, pager, next"
  266. @size-change="handleSizeChange"
  267. @current-change="handleCurrentPage"
  268. />
  269. </div>
  270. </div>
  271. <div slot="footer" class="dialog-footer">
  272. <!-- 排队中会多一个删除盘点 进行中的多一个终止盘点 -->
  273. <el-button v-if="detailInfo.state === 1" :loading="crud.delAllLoading" type="primary" class="end-btn" @click="toDelete"><i class="iconfont icon-stop" />删除盘点</el-button>
  274. <el-button v-if="detailInfo.state === 2" :loading="stopLoading" type="primary" class="end-btn" @click="toStopStockBill"><i class="iconfont icon-stop" />终止盘点</el-button>
  275. <el-button :loading="crud.status.cu === 2" type="primary" @click="detailVisible=false">确定</el-button>
  276. </div>
  277. </div>
  278. </el-dialog>
  279. </div>
  280. </template>
  281. <script>
  282. import crudStockTaskLog from '@/api/stockTaskLog/index'
  283. import CRUD, { presenter, header, form, crud } from '@crud/crud'
  284. import crudOperation from '@crud/CRUD.operation'
  285. import rrOperation from '@crud/RR.operation'
  286. import pagination from '@crud/Pagination'
  287. import taskStockLogEcharts from '@/views/components/echarts/taskStockLog.vue'
  288. import DateRangePicker from '@/components/DateRangePicker'
  289. import { mapGetters } from 'vuex'
  290. import { parseTime, saveAs, getBlob } from '@/utils/index'
  291. import qs from 'qs'
  292. const defaultForm = { stockTypeName: '全量盘点', stockType: 1, stockBill: null, stockRegion: '全部区域', stockGridNum: null, stockGridNumName: null, totalGridNum: null, stockRemarks: null, regionId: null, shelfId: null, gridShelf: null, gridId: null, reableGridIds: [], unReableGridIds: [] }
  293. export default {
  294. name: 'CheckLog',
  295. components: { crudOperation, rrOperation, pagination, taskStockLogEcharts, DateRangePicker },
  296. cruds() {
  297. return CRUD({ title: '盘点日志', idField: 'billId', url: 'api/stocktask-task/initStockLogList', crudMethod: { ...crudStockTaskLog }, sort: [], optShow: {
  298. add: false,
  299. edit: false,
  300. del: false,
  301. download: false,
  302. group: false,
  303. reset: false
  304. }})
  305. },
  306. mixins: [presenter(), header(), form(defaultForm), crud()],
  307. data() {
  308. return {
  309. statusOptions: [
  310. { key: 0, display_name: '已终止' },
  311. { key: 1, display_name: '排队中' },
  312. { key: 2, display_name: '盘点中' },
  313. { key: 3, display_name: '已完成' }
  314. ],
  315. TypeOptions: [
  316. { key: 1, display_name: '全量盘点' },
  317. { key: 2, display_name: '区域盘点' },
  318. { key: 3, display_name: '计划盘点' },
  319. { key: 4, display_name: '书架盘点' },
  320. { key: 5, display_name: '架位盘点' },
  321. { key: 6, display_name: '层位盘点' },
  322. { key: 7, display_name: '移动盘点' }
  323. ],
  324. blurryTime: null,
  325. tabIndex: 0,
  326. detailVisible: false,
  327. stopLoading: false,
  328. dbRowData: {},
  329. detailInfo: {},
  330. taskStockLogData: [],
  331. gridTableLoading: false,
  332. detailPage: {
  333. page: 1,
  334. size: 10,
  335. total: 0
  336. },
  337. detailTable: [],
  338. permission: {
  339. add: ['admin', 'checkLog:add'],
  340. edit: ['admin', 'checkLog:edit'],
  341. del: ['admin', 'checkLog:del']
  342. },
  343. rules: {
  344. stockBill: [
  345. { required: true, message: '请输入盘点单号', trigger: 'blur' }
  346. ],
  347. stockTypeName: [
  348. { required: true, message: '请输入盘点类型', trigger: 'blur' }
  349. ],
  350. stockRegion: [
  351. { required: true, message: '请输入目标位置', trigger: 'blur' }
  352. ],
  353. stockGridNumName: [
  354. { required: true, message: '请输入目标数量', trigger: 'blur' }
  355. ]
  356. },
  357. stockInfo: null,
  358. ipStatusList: [],
  359. ipStatusFalseNum: 0,
  360. unreachable: [],
  361. reachable: [],
  362. isBtnDisabled: true,
  363. stockInfoLoading: false
  364. }
  365. },
  366. computed: {
  367. ...mapGetters([
  368. 'user',
  369. 'baseApi'
  370. ])
  371. },
  372. methods: {
  373. [CRUD.HOOK.beforeRefresh]() {
  374. if (this.blurryTime) {
  375. this.crud.query.startTime = this.blurryTime[0]
  376. this.crud.query.endTime = this.blurryTime[1]
  377. } else {
  378. this.crud.query.startTime = null
  379. this.crud.query.endTime = null
  380. }
  381. },
  382. [CRUD.HOOK.afterRefresh](crud) {
  383. this.isBtnDisabled = true
  384. this.stockInfoLoading = false
  385. },
  386. // 新增前
  387. [CRUD.HOOK.beforeToAdd]() {
  388. let params
  389. if (this.crud.form.stockType === 1) {
  390. this.crud.form.stockTypeName = '全量盘点'
  391. params = {
  392. 'gridShelf': null,
  393. 'regionId': null,
  394. 'shelfId': null
  395. }
  396. }
  397. this.stockInfoLoading = true
  398. const stockInfoPromise = crudStockTaskLog.FetchStockGirdSuccess()
  399. .then(stockInfo => {
  400. this.stockInfoLoading = false
  401. return stockInfo
  402. })
  403. .catch(error => {
  404. this.stockInfoLoading = false
  405. console.error('stockInfo 接口失败:', error)
  406. throw error
  407. })
  408. const otherPromises = [
  409. crudStockTaskLog.FetchNewBillNo(),
  410. crudStockTaskLog.FetchStockGirdNum(),
  411. crudStockTaskLog.FetchTotalGirdNum(params)
  412. ]
  413. Promise.all([stockInfoPromise, ...otherPromises])
  414. .then(([stockInfo, newBillNoRes, stockGridNumRes, totalGirdNumRes]) => {
  415. console.log('stockInfo', stockInfo)
  416. this.stockInfo = stockInfo
  417. const ipStatusList = stockInfo
  418. ? Object.entries(stockInfo.ipReachableCache).map(([ip, status]) => ({ ip, status }))
  419. : []
  420. this.ipStatusList = ipStatusList
  421. this.ipStatusFalse = this.ipStatusList.filter(item => !item.status)
  422. this.ipStatusFalseNum = this.ipStatusList.filter(item => !item.status).length
  423. this.reachable = stockInfo.reachable
  424. this.unreachable = stockInfo.unreachable
  425. // 测试
  426. // this.reachable = stockInfo.unreachable
  427. // this.unreachable = []
  428. if (stockInfo && this.reachable.length !== 0) {
  429. this.isBtnDisabled = false
  430. } else {
  431. this.isBtnDisabled = true
  432. }
  433. this.crud.form.stockBill = newBillNoRes
  434. this.crud.form.stockGridNumName = stockInfo
  435. ? `<span style="color: #00b42a;">${this.reachable.length}</span> /
  436. <span style="color: #f53f3f;">${this.unreachable.length}</span> /
  437. ${totalGirdNumRes} 层位`
  438. : '数据加载失败'
  439. this.crud.form.stockGridNum = stockGridNumRes
  440. this.crud.form.totalGridNum = totalGirdNumRes
  441. })
  442. .catch(error => {
  443. console.error('整体请求失败:', error)
  444. this.isBtnDisabled = true
  445. })
  446. },
  447. [CRUD.HOOK.afterAddCancel]() {
  448. this.isBtnDisabled = true
  449. this.stockInfoLoading = false
  450. },
  451. // 初始化编辑时
  452. [CRUD.HOOK.beforeToEdit](crud, form) {
  453. },
  454. [CRUD.HOOK.beforeValidateCU](crud, form) {
  455. },
  456. // 提交前做的操作
  457. [CRUD.HOOK.afterValidateCU](crud) {
  458. console.log(crud.form)
  459. crud.form.reableGridIds = this.reachable.map(item => item.gridId)
  460. crud.form.unReableGridIds = this.unreachable.map(item => item.gridId)
  461. delete crud.form.stockGridNumName
  462. delete crud.form.stockTypeName
  463. return true
  464. },
  465. clickRowHandler(row) {
  466. // this.$refs.table.clearSelection()
  467. // this.$refs.table.toggleRowSelection(row)
  468. },
  469. doExport(data) {
  470. this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', {
  471. confirmButtonText: '继续',
  472. cancelButtonText: '取消',
  473. type: 'warning',
  474. dangerouslyUseHTMLString: true
  475. }).then(() => {
  476. const params = {
  477. 'billId': data.id
  478. }
  479. const fileName = '盘点单-' + parseTime(new Date()) + '.xlsx'
  480. getBlob(this.baseApi + '/api/stocktask-task/exportStockBill' + '?' + qs.stringify(params, { indices: false }), function(blob) {
  481. saveAs(blob, fileName)
  482. })
  483. }).catch(() => {
  484. })
  485. },
  486. handleDbClick(row) {
  487. this.tabIndex = 0
  488. this.detailVisible = true
  489. this.dbRowData = row
  490. this.detailTable = []
  491. crudStockTaskLog.FetchInitStockLogDetails({ 'billId': row.billId }).then(res => {
  492. this.detailInfo = res
  493. this.taskStockLogData = [
  494. { value: res.onShelfNum - res.errorShelfNum - res.errorOrderNum, name: '正常在架' },
  495. { value: res.errorShelfNum, name: '错架' },
  496. { value: res.errorOrderNum, name: '错序' }
  497. ]
  498. }).catch(() => {
  499. })
  500. },
  501. changeDetailTab(index) {
  502. this.tabIndex = index
  503. if (index === 1) {
  504. this.getInitStockTaskDetails()
  505. }
  506. },
  507. getInitStockTaskDetails() {
  508. this.gridTableLoading = true
  509. const params = {
  510. 'billId': this.dbRowData.billId,
  511. 'page': this.detailPage.page - 1,
  512. 'size': this.detailPage.size
  513. }
  514. crudStockTaskLog.FetchInitStockTaskDetails(params).then(res => {
  515. if (res) {
  516. if (this.dbRowData.state === 2) {
  517. const progressPromises = res.content.map(item => {
  518. const paramsProgress = {
  519. 'stockBill': this.dbRowData.stockBill,
  520. 'gridCode': item.gridCode
  521. }
  522. return crudStockTaskLog.FetchProgressByStockBillAndGridCode(paramsProgress)
  523. })
  524. Promise.all(progressPromises).then(progressResults => {
  525. this.detailTable = res.content.map((item, index) => {
  526. item.progress = progressResults[index]
  527. return item
  528. })
  529. this.gridTableLoading = false
  530. }).catch(error => {
  531. console.error(error)
  532. this.gridTableLoading = false
  533. })
  534. } else {
  535. this.detailTable = res.content.map((item, index) => {
  536. item.progress = this.dbRowData.state === 0 ? '已终止' : (this.dbRowData.state === 1 ? '排队中' : '已完成')
  537. return item
  538. })
  539. this.gridTableLoading = false
  540. }
  541. this.detailPage.total = res.totalElements
  542. }
  543. }).catch(() => {
  544. this.gridTableLoading = false
  545. })
  546. },
  547. handleSizeChange(size) {
  548. this.detailPage.size = size
  549. this.detailPage.page = 1
  550. this.tabIndex = 1
  551. this.getInitStockTaskDetails()
  552. },
  553. handleCurrentPage(val) {
  554. this.detailPage.page = val
  555. this.tabIndex = 1
  556. this.getInitStockTaskDetails()
  557. },
  558. handleCloseDialog() {
  559. this.detailVisible = false
  560. this.tabIndex = 0
  561. this.isBtnDisabled = true
  562. this.stockInfoLoading = false
  563. },
  564. toDelete() {
  565. this.$confirm('此操作将删除当前盘点单任务<span>你是否还要继续?</span>', '提示', {
  566. confirmButtonText: '继续',
  567. cancelButtonText: '取消',
  568. type: 'warning',
  569. dangerouslyUseHTMLString: true
  570. }).then(() => {
  571. this.crud.delAllLoading = true
  572. const params = {
  573. 'id': this.dbRowData.billId
  574. }
  575. console.log(params)
  576. crudStockTaskLog.del(params).then(res => {
  577. console.log(res)
  578. if (res && res.code !== 500) {
  579. this.$message({ message: '当前盘点单任务删除成功', type: 'success', offset: 8 })
  580. this.crud.refresh()
  581. } else {
  582. this.$message({ message: res.message, type: 'error', offset: 8 })
  583. }
  584. this.handleCloseDialog()
  585. this.crud.delAllLoading = false
  586. }).catch(err => {
  587. this.crud.delAllLoading = false
  588. console.log(err)
  589. })
  590. }).catch(() => {
  591. this.crud.delAllLoading = false
  592. })
  593. },
  594. toStopStockBill() {
  595. this.$confirm('此操作将终止当前盘点单任务<span>你是否还要继续?</span>', '提示', {
  596. confirmButtonText: '继续',
  597. cancelButtonText: '取消',
  598. type: 'warning',
  599. dangerouslyUseHTMLString: true
  600. }).then(() => {
  601. this.stopLoading = true
  602. const params = {
  603. 'id': this.dbRowData.billId
  604. }
  605. crudStockTaskLog.FetchStopStockBill(params).then(res => {
  606. console.log(res)
  607. if (res && res.code !== 500) {
  608. this.$message({ message: '当前盘点单任务终止成功', type: 'success', offset: 8 })
  609. this.crud.refresh()
  610. } else {
  611. this.$message({ message: res.message, type: 'error', offset: 8 })
  612. }
  613. this.handleCloseDialog()
  614. this.stopLoading = false
  615. }).catch(err => {
  616. console.log(err)
  617. this.stopLoading = false
  618. })
  619. }).catch(() => {
  620. this.stopLoading = false
  621. })
  622. }
  623. }
  624. }
  625. </script>
  626. <style lang="scss" scoped>
  627. .detailBook {
  628. ::v-deep .el-dialog {
  629. width: 1000px !important;
  630. .el-dialog__body{
  631. padding: 0 0 30px 0;
  632. }
  633. }
  634. .detail-check{
  635. padding: 20px 30px;
  636. background-color: #F6F8FC;
  637. }
  638. .book-detail{
  639. display: flex;
  640. justify-content: space-between;
  641. flex-wrap: wrap;
  642. li{
  643. width: 50%;
  644. line-height: 40px;
  645. span{
  646. display: inline-block;
  647. width: 100px;
  648. text-align: right;
  649. margin-right: 20px;
  650. color: #0C0E1E;
  651. }
  652. i{
  653. font-style: normal;
  654. padding: 0 8px;
  655. }
  656. &.row-li{
  657. width: 100%
  658. }
  659. }
  660. }
  661. .end-btn{
  662. width: auto !important;
  663. padding: 0 10px;
  664. border-color: #ED4A41;
  665. background-color: #ED4A41;
  666. }
  667. .detail-other{
  668. display: flex;
  669. justify-content: space-between;
  670. align-items: flex-start;
  671. border-top: 1px solid #edeff3;
  672. padding-top: 20px;
  673. margin-top: 20px;
  674. .book-detail{
  675. width: 50%;
  676. li{
  677. display: flex;
  678. justify-content: flex-start;
  679. // width: 50%;
  680. span{
  681. display: block;
  682. width: 100px;
  683. text-align: right;
  684. margin-right: 0;
  685. }
  686. p{
  687. width: 100px;
  688. text-align: right;
  689. i{
  690. padding: 0;
  691. }
  692. }
  693. }
  694. }
  695. }
  696. ::v-deep .dialog-footer{
  697. margin-top: 30px;
  698. }
  699. .archives-table td.el-table__cell .row-state{
  700. margin: 0 !important;
  701. }
  702. }
  703. .detail-table-info{
  704. display: flex;
  705. justify-content: flex-start;
  706. li{
  707. width: calc(100% / 3);
  708. margin-right: 15px;
  709. span{
  710. display: inline-block;
  711. width: 40px;
  712. text-align: right;
  713. }
  714. p{
  715. display: inline-block;
  716. text-align: right;
  717. width: calc(100% - 40px);
  718. i{
  719. font-weight: bold;
  720. font-style: normal;
  721. }
  722. }
  723. }
  724. }
  725. .stock-dialog{
  726. ::v-deep .el-dialog{
  727. width: 1220px !important;
  728. }
  729. }
  730. .stockGridNumName-style{
  731. ::v-deep .el-form-item__content{
  732. width: auto !important;
  733. padding: 0 10px;
  734. .stock-popover{
  735. display: inline-block;
  736. margin-left: 6px;
  737. color: #0348f3;
  738. }
  739. }
  740. }
  741. .stock-info-tips{
  742. line-height: 24px;
  743. margin-bottom: 20px;
  744. p{
  745. color: #0c0e1e;
  746. i{
  747. display: inline-block;
  748. padding: 0 4px;
  749. font-weight: bold;
  750. font-style: normal;
  751. color: #00b42a;
  752. }
  753. }
  754. span{
  755. display: block;
  756. }
  757. }
  758. ::v-deep .el-card {
  759. flex: 1;
  760. margin-right: 15px;
  761. .el-card__header{
  762. color: #0c0e1e;
  763. // font-size: 16px;
  764. background-color: #fff !important;
  765. border-bottom: 1px solid #ebeef5 !important;
  766. }
  767. .el-card__body{
  768. height: 180px;
  769. overflow: hidden;
  770. overflow-y: scroll;
  771. }
  772. .stock-info-item{
  773. display: flex; justify-content: space-between; padding: 4px 20px;
  774. span{
  775. display: block;
  776. height: 26px;
  777. line-height: 26px;
  778. }
  779. }
  780. }
  781. </style>