deliver_list.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form ref="screenForm" :model="screenForm" label-width="85px" size="mini" label-position="left">
  7. <el-row :gutter="20">
  8. <el-col :xs="24" :sm="12" :lg="6">
  9. <el-form-item label="发货单号" prop="orderNum">
  10. <el-input v-model="screenForm.orderNum" placeholder="请输入发货单号"></el-input>
  11. </el-form-item>
  12. </el-col>
  13. <el-col :xs="24" :sm="12" :lg="6">
  14. <el-form-item label="订单号" prop="orderNo">
  15. <el-input v-model="screenForm.orderNo" placeholder="请输入订单号"></el-input>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :xs="24" :sm="12" :lg="6">
  19. <el-form-item label="经销商编号" prop="jxsNum">
  20. <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编号"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :xs="24" :sm="12" :lg="6">
  24. <el-form-item label="经销商名称" prop="jxsName">
  25. <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
  26. </el-form-item>
  27. </el-col>
  28. <el-col :xs="24" :sm="12" :lg="6">
  29. <el-form-item label="产品名称" prop="chName">
  30. <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :xs="24" :sm="12" :lg="6">
  34. <el-form-item label="规格型号" prop="model">
  35. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :xs="24" :sm="12" :lg="6">
  39. <el-form-item prop="type" label="存货类别">
  40. <el-select v-model="screenForm.type" placeholder="选择存货类别" style="width: 100%" clearable>
  41. <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.name"></el-option>
  42. </el-select>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :xs="24" :sm="12" :lg="6">
  46. <el-form-item label="发货日期" prop="date">
  47. <el-date-picker
  48. v-model="screenForm.date"
  49. type="datetimerange"
  50. range-separator="至"
  51. style="width: 100%;"
  52. value-format="yyyy-MM-dd HH:mm:ss"
  53. start-placeholder="开始日期"
  54. end-placeholder="结束日期">
  55. </el-date-picker>
  56. </el-form-item>
  57. </el-col>
  58. <el-col :xs="24" :sm="12" :lg="6">
  59. <el-form-item label="业务员" prop="salesMan">
  60. <el-select v-model="screenForm.salesMan" placeholder="选择业务员" clearable filterable style="width: 100%">
  61. <el-option
  62. v-for="item in salesmanList"
  63. :key="item.adminUserId"
  64. :label="item.nickName"
  65. :value="item.adminUserId">
  66. </el-option>
  67. </el-select>
  68. </el-form-item>
  69. </el-col>
  70. <el-col :xs="24" :sm="12" :lg="18" class="tr">
  71. <el-form-item label="">
  72. <el-button size="mini" @click="resetScreenForm">清空</el-button>
  73. <el-button size="mini" type="primary" @click="submitScreenForm">搜索</el-button>
  74. </el-form-item>
  75. </el-col>
  76. </el-row>
  77. </el-form>
  78. </div>
  79. <div class="mymain-container">
  80. <div class="btn-group clearfix">
  81. <div class="fr">
  82. <ExportButton :exUrl="'ship/eExport'" :exParams="exParams" />
  83. </div>
  84. </div>
  85. <div class="table">
  86. <el-table
  87. v-loading="listLoading"
  88. :data="dataList"
  89. element-loading-text="Loading"
  90. border
  91. fit
  92. highlight-current-row
  93. stripe
  94. show-summary
  95. :summary-method="$getSummaries">
  96. <el-table-column align="left" label="发货单号" prop="id" min-width="120" show-overflow-tooltip>
  97. <template slot-scope="scope">
  98. <CopyButton :copyText="scope.row.id" />
  99. <span>{{scope.row.id}}</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column align="left" label="发货日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
  103. <el-table-column align="left" label="仓库" prop="correspondName" min-width="80" show-overflow-tooltip></el-table-column>
  104. <el-table-column align="left" label="订单号" prop="mainOrderId" min-width="180" show-overflow-tooltip>
  105. <template slot-scope="scope">
  106. <CopyButton :copyText="scope.row.mainOrderId" />
  107. <span>{{scope.row.mainOrderId}}</span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
  111. <template slot-scope="scope">
  112. <CopyButton :copyText="scope.row.customerNumber" />
  113. <span>{{scope.row.customerNumber}}</span>
  114. </template>
  115. </el-table-column>
  116. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  117. <template slot-scope="scope">
  118. <CopyButton :copyText="scope.row.customerName" />
  119. <span>{{scope.row.customerName}}</span>
  120. </template>
  121. </el-table-column>
  122. <el-table-column align="left" label="存货类别" prop="categoryName" min-width="80" show-overflow-tooltip></el-table-column>
  123. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  124. <template slot-scope="scope">
  125. <CopyButton :copyText="scope.row.materialCode" />
  126. <span>{{scope.row.materialCode}}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  130. <template slot-scope="scope">
  131. <CopyButton :copyText="scope.row.materialOldNumber" />
  132. <span>{{scope.row.materialOldNumber}}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  136. <template slot-scope="scope">
  137. <CopyButton :copyText="scope.row.materialName" />
  138. <span>{{scope.row.materialName}}</span>
  139. </template>
  140. </el-table-column>
  141. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  142. <template slot-scope="scope">
  143. <CopyButton :copyText="scope.row.specification" />
  144. <span>{{scope.row.specification}}</span>
  145. </template>
  146. </el-table-column>
  147. <el-table-column align="right" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip>
  148. <template slot-scope="scope">
  149. {{scope.row.payAmount | numToFixed}}
  150. </template>
  151. </el-table-column>
  152. <el-table-column align="right" label="无税金额" prop="noTotalAmount" min-width="100" show-overflow-tooltip>
  153. <template slot-scope="scope">
  154. {{scope.row.noTotalAmount | numToFixed}}
  155. </template>
  156. </el-table-column>
  157. <el-table-column align="right" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip>
  158. <template slot-scope="scope">
  159. {{scope.row.afterTaxPrice | numToFixed}}
  160. </template>
  161. </el-table-column>
  162. <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  163. <el-table-column align="right" label="未出库数量" prop="notOutNumber" min-width="100" show-overflow-tooltip></el-table-column>
  164. <el-table-column align="left" label="备注" prop="remark" min-width="200" show-overflow-tooltip></el-table-column>
  165. <el-table-column align="center" label="操作" width="200" fixed="right">
  166. <template slot-scope="scope">
  167. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  168. <el-button type="text" @click="getPassword(scope.row.id)">获取密码</el-button>
  169. <el-button type="text" @click="openShareDetail(scope.row.id)">密码记录</el-button>
  170. </template>
  171. </el-table-column>
  172. </el-table>
  173. </div>
  174. </div>
  175. <div class="pagination clearfix">
  176. <div class="fr">
  177. <el-pagination
  178. @size-change="handleSizeChange"
  179. @current-change="handleCurrentChange"
  180. :current-page="currentPage"
  181. :page-sizes="[10, 20, 30, 50]"
  182. :page-size="10"
  183. layout="total, sizes, prev, pager, next, jumper"
  184. :total="listTotal">
  185. </el-pagination>
  186. </div>
  187. </div>
  188. </div>
  189. <!-- 密码记录 -->
  190. <el-dialog title="密码记录" :visible.sync="isShowDialog" :show-close="false" width="50%" :close-on-click-modal="false">
  191. <div class="table" style="margin: 10px 0 20px;">
  192. <el-table
  193. v-loading="dialogTable_listLoading"
  194. :data="dialogTable_dataList"
  195. element-loading-text="Loading"
  196. tooltip-effect="dark"
  197. style="width: 100%"
  198. max-height="270">
  199. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  200. <el-table-column align="center" prop="printPassword" label="密码"></el-table-column>
  201. <el-table-column align="center" prop="createTime" label="打印时间"></el-table-column>
  202. </el-table>
  203. </div>
  204. <div class="pagination clearfix">
  205. <div class="fr">
  206. <el-pagination
  207. @current-change="dialogTableCurrentChange"
  208. :current-page="dialogTable_currentPage"
  209. :page-size="dialogTable_pageSize"
  210. background
  211. layout="prev, pager, next"
  212. :total="dialogTable_listTotal">
  213. </el-pagination>
  214. </div>
  215. </div>
  216. <div slot="footer" class="dialog-footer">
  217. <el-button @click="isShowDialog = false">关 闭</el-button>
  218. </div>
  219. </el-dialog>
  220. <DeliverDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  221. </div>
  222. </template>
  223. <script>
  224. import { getDeliverList, getPassword, getPasswordRecord } from "@/api/supply/deliver";
  225. import { getCategoryList, getSalesmanList } from '@/api/common'
  226. import DeliverDetail from "@/views/supply/deliver/components/deliver_detail";
  227. export default {
  228. components: {
  229. DeliverDetail,
  230. },
  231. data() {
  232. return {
  233. currentPage: 1, // 当前页码
  234. pageSize: 10, // 每页数量
  235. listTotal: 0, // 列表总数
  236. dataList: null, // 列表数据
  237. listLoading: false, // 列表加载loading
  238. screenForm: { // 筛选表单数据
  239. orderNum: '',
  240. orderNo: '',
  241. jxsNum: '',
  242. jxsName: '',
  243. chName: '',
  244. model: '',
  245. date: '',
  246. type: '',
  247. salesMan: '',
  248. },
  249. categoryList: [],
  250. salesmanList: [],
  251. isShowDialog: false, // 密码记录 - 弹窗
  252. dialogTable_dataList: null, // 密码记录 - 列表数据
  253. dialogTable_listLoading: true, // 密码记录 - 列表加载loading
  254. dialogTable_currentPage: 1, // 密码记录 - 当前页码
  255. dialogTable_pageSize: 10, // 密码记录 - 每页数量
  256. dialogTable_listTotal: 0, // 密码记录 - 列表总数
  257. queryItem: {},
  258. }
  259. },
  260. computed: {
  261. exParams() {
  262. return {
  263. id: this.screenForm.orderNum,
  264. mainOrderId: this.screenForm.orderNo,
  265. customerNumber: this.screenForm.jxsNum,
  266. customerName: this.screenForm.jxsName,
  267. productName: this.screenForm.chName,
  268. specification: this.screenForm.model,
  269. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  270. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  271. categoryName: this.screenForm.type,
  272. serviceId: this.screenForm.salesMan,
  273. }
  274. },
  275. isShowDetail() {
  276. return this.queryItem.hasOwnProperty('id');
  277. },
  278. },
  279. created() {
  280. this.getSalesmanList();
  281. this.getCategoryList();
  282. this.getList();
  283. },
  284. methods: {
  285. // 获取业务员列表
  286. getSalesmanList() {
  287. getSalesmanList({
  288. pageNum: 1,
  289. pageSize: -1,
  290. isCustomer: 0,
  291. status: true,
  292. }).then(res => {
  293. this.salesmanList = res.data.records;
  294. })
  295. },
  296. // 获取存货类别列表
  297. getCategoryList() {
  298. getCategoryList({
  299. pageNum: 1,
  300. pageSize: -1,
  301. }).then(res => {
  302. this.categoryList = res.data.records;
  303. })
  304. },
  305. // 查询列表
  306. getList() {
  307. this.listLoading = true;
  308. let params = {
  309. pageNum: this.currentPage,
  310. pageSize: this.pageSize,
  311. id: this.screenForm.orderNum,
  312. mainOrderId: this.screenForm.orderNo,
  313. customerNumber: this.screenForm.jxsNum,
  314. customerName: this.screenForm.jxsName,
  315. productName: this.screenForm.chName,
  316. specification: this.screenForm.model,
  317. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  318. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  319. categoryName: this.screenForm.type,
  320. serviceId: this.screenForm.salesMan,
  321. };
  322. getDeliverList(params).then((res) => {
  323. res.data.records.forEach(item => {
  324. item.notOutNumber = item.salesStatus ? 0 : item.refundableQty;
  325. item.sums1 = ['refundableQty', 'notOutNumber'];
  326. item.sums2 = ['payAmount', 'afterTaxPrice', 'noTotalAmount'];
  327. })
  328. this.dataList = res.data.records;
  329. this.listTotal = res.data.total;
  330. this.listLoading = false;
  331. })
  332. },
  333. // 提交筛选表单
  334. submitScreenForm() {
  335. this.currentPage = 1;
  336. this.getList();
  337. },
  338. // 重置筛选表单
  339. resetScreenForm() {
  340. this.$refs.screenForm.resetFields();
  341. this.currentPage = 1;
  342. this.getList();
  343. },
  344. // 更改每页数量
  345. handleSizeChange(val) {
  346. this.pageSize = val;
  347. this.currentPage = 1;
  348. this.getList();
  349. },
  350. // 更改当前页
  351. handleCurrentChange(val) {
  352. this.currentPage = val;
  353. this.getList();
  354. },
  355. // 进入详情
  356. toDetail(item) {
  357. this.queryItem = item;
  358. },
  359. backList() {
  360. this.queryItem = {};
  361. },
  362. // 获取密码
  363. getPassword(id) {
  364. getPassword({id}).then(res => {
  365. this.$alert(res.data, '新密码', {
  366. confirmButtonText: '确定',
  367. callback: action => {}
  368. });
  369. })
  370. },
  371. // 密码记录 - 获取列表
  372. getPasswordRecord(id) {
  373. getPasswordRecord({
  374. pageNum: this.dialogTable_currentPage,
  375. pageSize: this.dialogTable_pageSize,
  376. id
  377. }).then(res => {
  378. this.dialogTable_dataList = res.data.records;
  379. this.dialogTable_listTotal = res.data.total;
  380. this.dialogTable_listLoading = false;
  381. })
  382. },
  383. // 密码记录 - 打开弹窗
  384. openShareDetail(id) {
  385. this.isShowDialog = true;
  386. this.dialogTable_currentPage = 1;
  387. this.getPasswordRecord(id);
  388. },
  389. // 密码记录 - 更改列表当前页
  390. dialogTableCurrentChange(val) {
  391. this.dialogTable_currentPage = val;
  392. this.getPasswordRecord();
  393. },
  394. }
  395. }
  396. </script>
  397. <style lang="scss" scoped>
  398. </style>