dispatch.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <!-- 发货管理 -->
  2. <template>
  3. <div class="order">
  4. <template v-if="!noticeChangeVisible && !attachVisible && !arrivedVisible && !detailVisible">
  5. <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryData()">
  6. <el-form-item label="名称" prop="productName">
  7. <el-input v-model="dataForm.productName" placeholder="名称" clearable></el-input>
  8. </el-form-item>
  9. <el-form-item label="任务单编码" prop="orderCode">
  10. <el-input v-model="dataForm.orderCode" placeholder="任务单编码" clearable></el-input>
  11. </el-form-item>
  12. <el-form-item label="生产状态" prop="state">
  13. <el-select
  14. v-model="dataForm.state"
  15. remote
  16. placeholder="请选择">
  17. <el-option
  18. v-for="item in optionsState"
  19. :key="item.code"
  20. :label="item.value"
  21. :value="item.code">
  22. </el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item>
  26. <el-button @click="queryData()">查询</el-button>
  27. <el-button v-if="isAuth('order:deliver:noteChangeConfig')" type="primary" @click="setNoticeChangeHandel()">发货通知人设置</el-button>
  28. </el-form-item>
  29. </el-form>
  30. <el-table
  31. :data="dataList"
  32. border
  33. v-loading="dataListLoading"
  34. @selection-change="selectionChangeHandle"
  35. style="width: 100%;">
  36. <el-table-column
  37. label="序号"
  38. type="index"
  39. width="50"
  40. align="center">
  41. </el-table-column>
  42. <el-table-column
  43. prop="orderCode"
  44. header-align="center"
  45. align="center"
  46. min-width="140"
  47. :show-tooltip-when-overflow="true"
  48. label="任务单编码">
  49. </el-table-column>
  50. <el-table-column
  51. prop="customerName"
  52. header-align="center"
  53. align="center"
  54. min-width="140"
  55. :show-tooltip-when-overflow="true"
  56. label="客户名称">
  57. </el-table-column>
  58. <el-table-column
  59. fixed="right"
  60. prop="contractNumber"
  61. header-align="center"
  62. align="center"
  63. min-width="160"
  64. :show-tooltip-when-overflow="true"
  65. label="生产编号">
  66. </el-table-column>
  67. <el-table-column
  68. fixed="right"
  69. header-align="center"
  70. align="center"
  71. min-width="80"
  72. :formatter="stateFormat"
  73. :show-tooltip-when-overflow="true"
  74. label="生产状态">
  75. </el-table-column>
  76. <el-table-column
  77. prop="productName"
  78. header-align="center"
  79. align="center"
  80. min-width="140"
  81. :show-tooltip-when-overflow="true"
  82. label="物料名称">
  83. </el-table-column>
  84. <el-table-column
  85. prop="cnt"
  86. header-align="center"
  87. align="center"
  88. min-width="120"
  89. :show-overflow-tooltip="true"
  90. label="数量">
  91. </el-table-column>
  92. <el-table-column
  93. prop="deliverCnt"
  94. header-align="center"
  95. align="center"
  96. min-width="160"
  97. :show-tooltip-when-overflow="true"
  98. label="送货数量">
  99. </el-table-column>
  100. <el-table-column
  101. prop="arriveCnt"
  102. header-align="center"
  103. align="center"
  104. min-width="160"
  105. label="送达数量">
  106. </el-table-column>
  107. <el-table-column
  108. prop="deliveryDate"
  109. header-align="center"
  110. align="center"
  111. min-width="160"
  112. label="交期时间">
  113. </el-table-column>
  114. <el-table-column
  115. prop="batchNumber"
  116. header-align="center"
  117. align="center"
  118. min-width="160"
  119. label="批次号">
  120. </el-table-column>
  121. <el-table-column
  122. prop="state"
  123. header-align="center"
  124. align="center"
  125. min-width="160"
  126. label="状态">
  127. >
  128. <template slot-scope="scope">{{stateFormat(scope.row)}}</template>
  129. </el-table-column>
  130. <el-table-column
  131. prop="consignmentDate"
  132. header-align="center"
  133. align="center"
  134. min-width="160"
  135. label="发货时间">
  136. </el-table-column>
  137. <el-table-column
  138. prop="arriveDate"
  139. header-align="center"
  140. align="center"
  141. min-width="160"
  142. label="送达时间">
  143. </el-table-column>
  144. <el-table-column
  145. header-align="center"
  146. align="center"
  147. label="签收附件">
  148. <template slot-scope="scope">
  149. <el-button :disabled="!scope.row.attachList || scope.row.attachList.length === 0" type="text" size="small" @click="attachDetails(scope.row)">查看</el-button>
  150. </template>
  151. </el-table-column>
  152. <el-table-column
  153. fixed="right"
  154. header-align="center"
  155. align="center"
  156. width="160"
  157. label="操作">
  158. <template slot-scope="scope">
  159. <el-button v-if="isAuth('order:deliver:info') && Number(scope.row.state) <= 3" type="text" size="small" @click="detailHandle(scope.row)">查看</el-button>
  160. <el-button v-if="isAuth('order:deliver:send') && Number(scope.row.state) === 2" type="text" size="small" @click="sendHandle(scope.row.deliverId)">发货</el-button>
  161. <el-button v-if="isAuth('order:deliver:arrive') && Number(scope.row.state) === 3" type="text" size="small" @click="arriveHandle(scope.row.deliverId)">送达</el-button>
  162. </template>
  163. </el-table-column>
  164. </el-table>
  165. <el-pagination
  166. @size-change="sizeChangeHandle"
  167. @current-change="currentChangeHandle"
  168. :current-page="pageIndex"
  169. :page-sizes="[10, 20, 50, 100]"
  170. :page-size="pageSize"
  171. :total="totalPage"
  172. layout="total, sizes, prev, pager, next, jumper">
  173. </el-pagination>
  174. </template>
  175. <!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>-->
  176. <!-- <detail v-if="detailVisible" ref="detail"/>-->
  177. <!-- 文件预览 -->
  178. <attach-detail v-if="attachVisible" ref="attachDetail" @onChose="onChose"/>
  179. <!-- 发货通知设置弹窗 -->
  180. <notice-change-setting v-if="noticeChangeVisible" ref="noticeChangeSetting" @onChose="onChose"/>
  181. <!--送达弹窗 -->
  182. <dispatch-arrived v-if="arrivedVisible" ref="arrivedPage" @onChose="onChose" @refreshDataList="getDataList"/>
  183. <!-- 发货详情 -->
  184. <prod-management-details v-if="detailVisible" ref="detail" @onChose="onChose"/>
  185. <!-- 确定发货 -->
  186. <dispatching v-if="dispatchVisible" ref="dispatching" @refreshDataList="getDataList"/>
  187. </div>
  188. </template>
  189. <script>
  190. import { getDispatchList } from '@/api/sale'
  191. import PreviewComponent from '../common/preview-component'
  192. import AttachDetail from '../common/attach-detail'
  193. import NoticeChangeSetting from './dispatch-notice-change-setting'
  194. import DispatchArrived from './dispatch-arrived'
  195. import DispatchDetail from './dispatch-detail'
  196. import ProdManagementDetails from '@/views/modules/production/prod-management-details'
  197. import Dispatching from '@/views/modules/order/dispatching'
  198. export default {
  199. // 发货管理
  200. name: 'dispatch',
  201. components: {
  202. Dispatching,
  203. ProdManagementDetails,
  204. AttachDetail,
  205. PreviewComponent,
  206. NoticeChangeSetting,
  207. DispatchArrived,
  208. DispatchDetail
  209. },
  210. created () {
  211. this.queryData()
  212. },
  213. data () {
  214. return {
  215. dataForm: {},
  216. dataList: [],
  217. pageIndex: 1,
  218. pageSize: 10,
  219. totalPage: 0,
  220. dataListLoading: false,
  221. dataListSelections: [],
  222. attachVisible: false,
  223. noticeChangeVisible: false,
  224. arrivedVisible: false,
  225. detailVisible: false,
  226. dispatchVisible: false,
  227. optionsState: [
  228. {
  229. code: null, value: '全部'
  230. },
  231. {
  232. code: '0', value: '待排产'
  233. },
  234. {
  235. code: '1', value: '生产中'
  236. },
  237. {
  238. code: '2', value: '已完成'
  239. },
  240. {
  241. code: '3', value: '发货中'
  242. },
  243. {
  244. code: '4', value: '已送达'
  245. }
  246. ]
  247. }
  248. },
  249. methods: {
  250. onChose () {
  251. this.attachVisible = false
  252. this.noticeChangeVisible = false
  253. this.arrivedVisible = false
  254. this.detailVisible = false
  255. this.dispatchVisible = false
  256. },
  257. // 查询
  258. queryData () {
  259. this.pageIndex = 1
  260. this.getDataList()
  261. },
  262. // 获取数据列表
  263. getDataList () {
  264. this.dataListLoading = true
  265. let params = {
  266. 'current': this.pageIndex,
  267. 'size': this.pageSize,
  268. 'productName': this.dataForm.productName ? this.dataForm.productName : null,
  269. 'orderCode': this.dataForm.orderCode ? this.dataForm.orderCode : null,
  270. 'state': this.dataForm.state ? this.dataForm.state : null
  271. }
  272. getDispatchList(params).then(({data}) => {
  273. if (data && data.code === '200') {
  274. this.dataList = data.data.records
  275. this.totalPage = Number(data.data.total)
  276. } else {
  277. this.dataList = []
  278. this.totalPage = 0
  279. }
  280. this.dataListLoading = false
  281. })
  282. },
  283. // 每页数
  284. sizeChangeHandle (val) {
  285. this.pageSize = val
  286. this.pageIndex = 1
  287. this.getDataList()
  288. },
  289. // 当前页
  290. currentChangeHandle (val) {
  291. this.pageIndex = val
  292. this.getDataList()
  293. },
  294. // 多选
  295. selectionChangeHandle (val) {
  296. this.dataListSelections = val
  297. },
  298. // 详情
  299. detailHandle (row) {
  300. this.detailVisible = true
  301. this.$nextTick(() => {
  302. this.$refs.detail.init(row.prodProductionId, 3)
  303. })
  304. },
  305. // 发货通知人设置
  306. setNoticeChangeHandel () {
  307. this.noticeChangeVisible = true
  308. this.$nextTick(() => {
  309. this.$refs.noticeChangeSetting.init()
  310. })
  311. },
  312. // 附件
  313. attachDetails (row) {
  314. this.attachVisible = true
  315. this.$nextTick(() => {
  316. this.$refs.attachDetail.init(row.attachList)
  317. })
  318. },
  319. // 送达
  320. arriveHandle (deliverId) {
  321. this.arrivedVisible = true
  322. this.$nextTick(() => {
  323. this.$refs.arrivedPage.init(deliverId)
  324. })
  325. },
  326. // 发货
  327. sendHandle (deliverId) {
  328. this.dispatchVisible = true
  329. this.$nextTick(() => {
  330. this.$refs.dispatching.init(deliverId)
  331. })
  332. },
  333. // 转换属性“状态”
  334. stateFormat (row) {
  335. if (this.optionsState) {
  336. for (let i = 0; i < this.optionsState.length; i++) {
  337. if (this.optionsState[i].code === row.state) {
  338. return this.optionsState[i].value
  339. }
  340. }
  341. }
  342. }
  343. }
  344. }
  345. </script>
  346. <style scoped>
  347. </style>