pickup_list.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowForm">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <Collapse :screen-form="screenForm">
  7. <template #right_btn>
  8. <el-button size="mini" @click="resetScreenForm">清空</el-button>
  9. <el-button type="primary" size="mini" @click="submitScreenForm">搜索</el-button>
  10. </template>
  11. <template #search>
  12. <el-form ref="screenForm" :model="screenForm" label-width="100px" size="mini" label-position="left">
  13. <el-row :gutter="20">
  14. <el-col :xs="24" :sm="12" :lg="6">
  15. <el-form-item label="申请发货单号" prop="orderNum">
  16. <el-input v-model="screenForm.orderNum" placeholder="请输入申请发货单号" />
  17. </el-form-item>
  18. </el-col>
  19. <el-col :xs="24" :sm="12" :lg="6">
  20. <el-form-item label="经销商名称" prop="jxsName">
  21. <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称" />
  22. </el-form-item>
  23. </el-col>
  24. <el-col :xs="24" :sm="12" :lg="6">
  25. <el-form-item label="经销商编码" prop="jxsNum">
  26. <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编码" />
  27. </el-form-item>
  28. </el-col>
  29. <el-col :xs="24" :sm="12" :lg="6">
  30. <el-form-item label="仓库" prop="correspondId">
  31. <el-select
  32. v-model="screenForm.correspondId"
  33. placeholder="请选择发货仓库"
  34. size="mini"
  35. style="margin-right: 10px"
  36. >
  37. <el-option
  38. v-for="(item, index) in warehouseList"
  39. :key="index"
  40. :label="item.name"
  41. :value="item.id"
  42. />
  43. </el-select>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :xs="24" :sm="12" :lg="6">
  47. <el-form-item label="状态" prop="status">
  48. <el-select v-model="screenForm.status" placeholder="请选择">
  49. <el-option label="未打单" :value="0" />
  50. <el-option label="已打单" :value="1" />
  51. </el-select>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :xs="24" :sm="12" :lg="6">
  55. <el-form-item label="手机号" prop="takerPhone">
  56. <el-input
  57. v-model.number="screenForm.takerPhone"
  58. type="number"
  59. placeholder="请输入手机号"
  60. @mousewheel.native.prevent
  61. />
  62. </el-form-item>
  63. </el-col>
  64. <el-col :xs="24" :sm="12" :lg="6">
  65. <el-form-item label="提货人" prop="takerId">
  66. <el-select v-model="screenForm.takerId" placeholder="请选择">
  67. <el-option
  68. v-for="item in pickupManList"
  69. :key="item.id"
  70. :label="item.takerName"
  71. :value="item.id"
  72. />
  73. </el-select>
  74. </el-form-item>
  75. </el-col>
  76. <el-col :xs="24" :sm="12" :lg="6">
  77. <el-form-item label="申请日期" prop="date">
  78. <el-date-picker
  79. v-model="screenForm.date"
  80. type="datetimerange"
  81. :default-time="['00:00:00', '23:59:59']"
  82. range-separator="至"
  83. style="width: 100%"
  84. value-format="yyyy-MM-dd HH:mm:ss"
  85. start-placeholder="开始日期"
  86. end-placeholder="结束日期"
  87. />
  88. </el-form-item>
  89. </el-col>
  90. <el-col :xs="24" :sm="12" :lg="6">
  91. <el-form-item label="打印时间" prop="printTime">
  92. <el-date-picker
  93. v-model="screenForm.printTime"
  94. type="datetimerange"
  95. :default-time="['00:00:00', '23:59:59']"
  96. range-separator="至"
  97. style="width: 100%"
  98. value-format="yyyy-MM-dd HH:mm:ss"
  99. start-placeholder="开始日期"
  100. end-placeholder="结束日期"
  101. />
  102. </el-form-item>
  103. </el-col>
  104. <el-col :xs="24" :sm="12" :lg="6">
  105. <el-form-item label="出库单号" prop="salesOrderId">
  106. <el-input
  107. v-model.number="screenForm.salesOrderId"
  108. type="number"
  109. placeholder="请输入出库单号"
  110. @mousewheel.native.prevent
  111. />
  112. </el-form-item>
  113. </el-col>
  114. <el-col :xs="24" :sm="12" :lg="6">
  115. <el-form-item label="制单人" prop="createBy">
  116. <el-input v-model="screenForm.createBy" placeholder="请输入制单人" />
  117. </el-form-item>
  118. </el-col>
  119. </el-row>
  120. </el-form>
  121. </template>
  122. </Collapse>
  123. </div>
  124. <div class="mymain-container">
  125. <div class="btn-group clearfix">
  126. <div class="fl">
  127. <el-button
  128. v-if="$checkBtnRole('add', $route.meta.roles)"
  129. size="mini"
  130. type="primary"
  131. icon="el-icon-plus"
  132. @click="toForm()"
  133. >新增</el-button
  134. >
  135. </div>
  136. <div class="fr">
  137. <ExportButton :ex-url="'pick/export'" :ex-params="exParams" />
  138. </div>
  139. </div>
  140. <div class="table">
  141. <el-table
  142. v-loading="listLoading"
  143. :data="dataList"
  144. element-loading-text="Loading"
  145. border
  146. fit
  147. highlight-current-row
  148. stripe
  149. >
  150. <el-table-column align="left" label="状态" min-width="80" show-overflow-tooltip>
  151. <template slot-scope="scope">
  152. {{ scope.row.printNum ? '已打单' : '未打单' }}
  153. </template>
  154. </el-table-column>
  155. <el-table-column align="left" label="打单日期" prop="printTime" min-width="160" show-overflow-tooltip />
  156. <el-table-column align="left" label="信息密钥" prop="informationKey" min-width="100" show-overflow-tooltip>
  157. <template slot-scope="scope">
  158. <CopyButton :copy-text="scope.row.informationKey" />
  159. <span>{{ scope.row.informationKey }}</span>
  160. </template>
  161. </el-table-column>
  162. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  163. <template slot-scope="scope">
  164. <CopyButton :copy-text="scope.row.materialCode" />
  165. <span>{{ scope.row.materialCode }}</span>
  166. </template>
  167. </el-table-column>
  168. <el-table-column
  169. align="left"
  170. label="产品编码"
  171. prop="materialOldNumber"
  172. min-width="140"
  173. show-overflow-tooltip
  174. >
  175. <template slot-scope="scope">
  176. <CopyButton :copy-text="scope.row.materialOldNumber" />
  177. <span>{{ scope.row.materialOldNumber }}</span>
  178. </template>
  179. </el-table-column>
  180. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  181. <template slot-scope="scope">
  182. <CopyButton :copy-text="scope.row.materialName" />
  183. <span>{{ scope.row.materialName }}</span>
  184. </template>
  185. </el-table-column>
  186. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  187. <template slot-scope="scope">
  188. <CopyButton :copy-text="scope.row.specification" />
  189. <span>{{ scope.row.specification }}</span>
  190. </template>
  191. </el-table-column>
  192. <el-table-column
  193. align="left"
  194. label="提货总数量"
  195. prop="refundableQty"
  196. min-width="100"
  197. show-overflow-tooltip
  198. />
  199. <el-table-column align="left" label="发货申请单号" prop="invoiceId" min-width="120" show-overflow-tooltip>
  200. <template slot-scope="scope">
  201. <CopyButton :copy-text="scope.row.invoiceId" />
  202. <span>{{ scope.row.invoiceId }}</span>
  203. </template>
  204. </el-table-column>
  205. <el-table-column align="left" label="销售订单号" prop="mainOrderId" min-width="140" show-overflow-tooltip>
  206. <template slot-scope="scope">
  207. <CopyButton
  208. :copy-text="
  209. scope.row.orderType === 'TRADE' ||
  210. scope.row.orderType === 'HOME' ||
  211. scope.row.orderType === 'REQUISITION_TRADE' ||
  212. scope.row.orderType === 'REQUISITION_HOME'
  213. ? scope.row.enginOrderNo
  214. : scope.row.mainOrderId
  215. "
  216. />
  217. <span>{{
  218. scope.row.orderType === 'TRADE' ||
  219. scope.row.orderType === 'HOME' ||
  220. scope.row.orderType === 'REQUISITION_TRADE' ||
  221. scope.row.orderType === 'REQUISITION_HOME'
  222. ? scope.row.enginOrderNo
  223. : scope.row.mainOrderId
  224. }}</span>
  225. </template>
  226. </el-table-column>
  227. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip />
  228. <el-table-column align="left" label="工程订单号" prop="enginOrderNo" min-width="140" show-overflow-tooltip>
  229. <template slot-scope="scope">
  230. <CopyButton :copy-text="scope.row.enginOrderNo" />
  231. <span>{{ scope.row.enginOrderNo }}</span>
  232. </template>
  233. </el-table-column>
  234. <el-table-column align="left" label="预约日期" prop="pickTime" min-width="100" show-overflow-tooltip>
  235. <template slot-scope="scope">
  236. {{ scope.row.pickTime | dateToDayFilter }}
  237. </template>
  238. </el-table-column>
  239. <el-table-column align="left" label="提货时段" min-width="100" show-overflow-tooltip>
  240. <template slot-scope="scope">
  241. {{ scope.row.pickStatus == '1' ? '上午' : '下午' }}
  242. </template>
  243. </el-table-column>
  244. <el-table-column
  245. align="left"
  246. label="提货仓库"
  247. prop="correspondName"
  248. min-width="100"
  249. show-overflow-tooltip
  250. />
  251. <el-table-column align="left" label="提货方式" prop="pickType" min-width="100" show-overflow-tooltip>
  252. <template slot-scope="scope">
  253. {{ scope.row.pickType == '1' ? '自提' : '物流快递' }}
  254. </template>
  255. </el-table-column>
  256. <el-table-column align="left" label="单据日期" prop="theTime" min-width="120" show-overflow-tooltip>
  257. <template slot-scope="scope">
  258. {{ scope.row.theTime | dateToDayFilter }}
  259. </template>
  260. </el-table-column>
  261. <el-table-column align="left" label="备注" prop="remark" min-width="100" show-overflow-tooltip />
  262. <el-table-column align="left" label="提货人姓名" prop="takerName" min-width="100" show-overflow-tooltip />
  263. <el-table-column align="left" label="提货人电话" prop="takerPhone" min-width="150" show-overflow-tooltip />
  264. <el-table-column align="left" label="提货物流" prop="pickLogistics" min-width="200" show-overflow-tooltip />
  265. <el-table-column align="left" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip />
  266. <el-table-column align="center" label="操作" width="100" fixed="right">
  267. <template slot-scope="scope">
  268. <el-button type="text" @click="toForm(scope.row, true)">详情</el-button>
  269. <el-button
  270. v-if="$checkBtnRole('edit', $route.meta.roles) && !scope.row.printNum"
  271. type="text"
  272. @click="toForm(scope.row)"
  273. >编辑</el-button
  274. >
  275. <el-popconfirm
  276. v-if="$checkBtnRole('cancel', $route.meta.roles) && ((isDealer && !scope.row.printNum) || !isDealer)"
  277. style="margin-left: 10px"
  278. :title="'确定' + (scope.row.printNum ? '作废' : '取消') + '吗?'"
  279. @onConfirm="handleCancel(scope.row.id)"
  280. >
  281. <el-button slot="reference" type="text">{{ scope.row.printNum ? '作废' : '取消' }}</el-button>
  282. </el-popconfirm>
  283. </template>
  284. </el-table-column>
  285. </el-table>
  286. </div>
  287. </div>
  288. <div class="pagination clearfix">
  289. <div class="fr">
  290. <el-pagination
  291. :current-page="currentPage"
  292. :page-sizes="[10, 20, 30, 50]"
  293. :page-size="10"
  294. layout="total, sizes, prev, pager, next, jumper"
  295. :total="listTotal"
  296. @size-change="handleSizeChange"
  297. @current-change="handleCurrentChange"
  298. />
  299. </div>
  300. </div>
  301. </div>
  302. <PickupForm v-if="isShowForm" :list-item="queryItem" :flag="flag" @backListFormDetail="backList" />
  303. </div>
  304. </template>
  305. <script>
  306. import { getPickupList, cancelData, getPickupManList } from '@/api/supply/pickup'
  307. import { getWarehouseList } from '@/api/supply/engin'
  308. import PickupForm from '@/views/supply/pickup/components/pickup_form'
  309. export default {
  310. components: {
  311. PickupForm
  312. },
  313. data() {
  314. return {
  315. currentPage: 1, // 当前页码
  316. pageSize: 10, // 每页数量
  317. listTotal: 0, // 列表总数
  318. dataList: null, // 列表数据
  319. listLoading: false, // 列表加载loading
  320. screenForm: {
  321. // 筛选表单数据
  322. orderNum: '',
  323. jxsName: '',
  324. jxsNum: '',
  325. correspondId: '',
  326. date: '',
  327. status: '',
  328. takerPhone: '',
  329. takerId: '',
  330. printTime: '',
  331. salesOrderId: '',
  332. createBy: ''
  333. },
  334. pickupManList: '',
  335. flag: false,
  336. isCollapse: true,
  337. queryItem: {},
  338. isShowForm: false,
  339. warehouseList: []
  340. }
  341. },
  342. computed: {
  343. isDealer() {
  344. return JSON.parse(localStorage.getItem('supply_user')).isCustomer
  345. },
  346. exParams() {
  347. return {
  348. invoiceId: this.screenForm.orderNum,
  349. customerName: this.screenForm.jxsName,
  350. customerNumber: this.screenForm.jxsNum,
  351. correspondId: this.screenForm.correspondId,
  352. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  353. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  354. status: this.screenForm.status,
  355. takerPhone: this.screenForm.takerPhone,
  356. createBy: this.screenForm.createBy,
  357. takerId: this.screenForm.takerId,
  358. printStartTime: this.screenForm.printTime[0],
  359. printEndTime: this.screenForm.printTime[1],
  360. salesOrderId: this.screenForm.salesOrderId
  361. }
  362. }
  363. },
  364. created() {
  365. this.getList()
  366. this.getWarehouseList()
  367. this.getPickupManList()
  368. },
  369. methods: {
  370. // 获取仓库列表
  371. getWarehouseList() {
  372. getWarehouseList({
  373. pageNum: 1,
  374. pageSize: -1
  375. }).then(res => {
  376. this.warehouseList = res.data.records
  377. })
  378. },
  379. // 查询按钮权限
  380. checkBtnRole(value) {
  381. // let btnRole = this.$route.meta.roles;
  382. // if(!btnRole) {return true}
  383. // let index = btnRole.indexOf(value);
  384. // return index >= 0;
  385. return true
  386. },
  387. getPickupManList() {
  388. getPickupManList({ pageNum: 1, pageSize: -1 }).then(res => {
  389. this.pickupManList = res.data.records
  390. })
  391. },
  392. // 查询列表
  393. getList() {
  394. this.listLoading = true
  395. const params = {
  396. pageNum: this.currentPage,
  397. pageSize: this.pageSize,
  398. invoiceId: this.screenForm.orderNum,
  399. customerName: this.screenForm.jxsName,
  400. customerNumber: this.screenForm.jxsNum,
  401. correspondId: this.screenForm.correspondId,
  402. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  403. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  404. status: this.screenForm.status,
  405. takerPhone: this.screenForm.takerPhone,
  406. takerId: this.screenForm.takerId,
  407. createBy: this.screenForm.createBy,
  408. printStartTime: this.screenForm.printTime[0],
  409. printEndTime: this.screenForm.printTime[1],
  410. salesOrderId: this.screenForm.salesOrderId
  411. }
  412. getPickupList(params).then(res => {
  413. this.dataList = res.data.records
  414. this.listTotal = res.data.total
  415. this.listLoading = false
  416. })
  417. },
  418. // 提交筛选表单
  419. submitScreenForm() {
  420. this.currentPage = 1
  421. this.getList()
  422. },
  423. // 重置筛选表单
  424. resetScreenForm() {
  425. this.$refs.screenForm.resetFields()
  426. this.currentPage = 1
  427. this.getList()
  428. },
  429. // 更改每页数量
  430. handleSizeChange(val) {
  431. this.pageSize = val
  432. this.currentPage = 1
  433. this.getList()
  434. },
  435. // 更改当前页
  436. handleCurrentChange(val) {
  437. this.currentPage = val
  438. this.getList()
  439. },
  440. // 进入表单
  441. toForm(item, flag = false) {
  442. this.flag = flag // 详情 flag 为 details
  443. this.queryItem = item
  444. this.isShowForm = true
  445. },
  446. backList() {
  447. this.queryItem = {}
  448. this.isShowForm = false
  449. },
  450. // 取消/作废
  451. handleCancel(id) {
  452. cancelData({ id }).then(res => {
  453. this.$successMsg()
  454. this.getList()
  455. })
  456. }
  457. }
  458. }
  459. </script>
  460. <style lang="scss" scoped></style>