deliver_list.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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 @click="resetScreenForm">清空</el-button>
  73. <el-button 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="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
  97. <el-table-column align="left" label="发货单号" prop="id" min-width="120" show-overflow-tooltip>
  98. <template slot-scope="scope">
  99. <CopyButton :copyText="scope.row.id" />
  100. <span>{{scope.row.id}}</span>
  101. </template>
  102. </el-table-column>
  103. <el-table-column align="left" label="发货日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
  104. <el-table-column align="left" label="仓库" prop="correspondName" min-width="80" show-overflow-tooltip></el-table-column>
  105. <el-table-column align="left" label="订单号" prop="mainOrderId" min-width="140" show-overflow-tooltip>
  106. <template slot-scope="scope">
  107. <CopyButton :copyText="scope.row.mainOrderId" />
  108. <span>{{scope.row.mainOrderId}}</span>
  109. </template>
  110. </el-table-column>
  111. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
  112. <template slot-scope="scope">
  113. <CopyButton :copyText="scope.row.customerNumber" />
  114. <span>{{scope.row.customerNumber}}</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  118. <template slot-scope="scope">
  119. <CopyButton :copyText="scope.row.customerName" />
  120. <span>{{scope.row.customerName}}</span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column align="left" label="存货类别" prop="categoryName" min-width="80" show-overflow-tooltip></el-table-column>
  124. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  125. <template slot-scope="scope">
  126. <CopyButton :copyText="scope.row.materialCode" />
  127. <span>{{scope.row.materialCode}}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  131. <template slot-scope="scope">
  132. <CopyButton :copyText="scope.row.materialOldNumber" />
  133. <span>{{scope.row.materialOldNumber}}</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  137. <template slot-scope="scope">
  138. <CopyButton :copyText="scope.row.materialName" />
  139. <span>{{scope.row.materialName}}</span>
  140. </template>
  141. </el-table-column>
  142. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  143. <template slot-scope="scope">
  144. <CopyButton :copyText="scope.row.specification" />
  145. <span>{{scope.row.specification}}</span>
  146. </template>
  147. </el-table-column>
  148. <!-- <el-table-column align="left" label="文件编号" prop="itemFileNo" min-width="350" show-overflow-tooltip/> -->
  149. <el-table-column align="right" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip>
  150. <template slot-scope="scope">
  151. {{scope.row.payAmount | numToFixed}}
  152. </template>
  153. </el-table-column>
  154. <el-table-column align="right" label="无税金额" prop="noTotalAmount" min-width="100" show-overflow-tooltip>
  155. <template slot-scope="scope">
  156. {{scope.row.noTotalAmount | numToFixed}}
  157. </template>
  158. </el-table-column>
  159. <el-table-column align="right" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip>
  160. <template slot-scope="scope">
  161. {{scope.row.afterTaxPrice | numToFixed}}
  162. </template>
  163. </el-table-column>
  164. <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  165. <el-table-column align="right" label="未出库数量" prop="notOutNumber" min-width="100" show-overflow-tooltip></el-table-column>
  166. <el-table-column align="left" label="订单备注" prop="headerRemark" min-width="160" show-overflow-tooltip></el-table-column>
  167. <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  168. <el-table-column align="left" label="表体备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip></el-table-column>
  169. <el-table-column align="left" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
  170. <el-table-column align="center" label="操作" width="200" fixed="right">
  171. <template slot-scope="scope">
  172. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  173. <el-button type="text" @click="getPassword(scope.row.id)">获取密码</el-button>
  174. <el-button type="text" @click="openShareDetail(scope.row.id)">密码记录</el-button>
  175. </template>
  176. </el-table-column>
  177. </el-table>
  178. </div>
  179. </div>
  180. <div class="pagination clearfix">
  181. <div class="fr">
  182. <el-pagination
  183. @size-change="handleSizeChange"
  184. @current-change="handleCurrentChange"
  185. :current-page="currentPage"
  186. :page-sizes="[10, 20, 30, 50]"
  187. :page-size="10"
  188. layout="total, sizes, prev, pager, next, jumper"
  189. :total="listTotal">
  190. </el-pagination>
  191. </div>
  192. </div>
  193. </div>
  194. <!-- 密码记录 -->
  195. <el-dialog title="密码记录" :visible.sync="isShowDialog" :show-close="false" width="50%" :close-on-click-modal="false">
  196. <div class="table" style="margin: 10px 0 20px;">
  197. <el-table
  198. v-loading="dialogTable_listLoading"
  199. :data="dialogTable_dataList"
  200. element-loading-text="Loading"
  201. tooltip-effect="dark"
  202. style="width: 100%"
  203. max-height="270">
  204. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  205. <el-table-column align="center" prop="printPassword" label="密码"></el-table-column>
  206. <el-table-column align="center" prop="createTime" label="打印时间"></el-table-column>
  207. </el-table>
  208. </div>
  209. <div class="pagination clearfix">
  210. <div class="fr">
  211. <el-pagination
  212. @current-change="dialogTableCurrentChange"
  213. :current-page="dialogTable_currentPage"
  214. :page-size="dialogTable_pageSize"
  215. background
  216. layout="prev, pager, next"
  217. :total="dialogTable_listTotal">
  218. </el-pagination>
  219. </div>
  220. </div>
  221. <div slot="footer" class="dialog-footer">
  222. <el-button @click="isShowDialog = false">关 闭</el-button>
  223. </div>
  224. </el-dialog>
  225. <DeliverDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  226. </div>
  227. </template>
  228. <script>
  229. import { getDeliverList, getPassword, getPasswordRecord } from "@/api/supply/deliver";
  230. import { getCategoryList, getSalesmanList } from '@/api/common'
  231. import DeliverDetail from "@/views/supply/deliver/components/deliver_detail";
  232. export default {
  233. components: {
  234. DeliverDetail,
  235. },
  236. data() {
  237. return {
  238. currentPage: 1, // 当前页码
  239. pageSize: 10, // 每页数量
  240. listTotal: 0, // 列表总数
  241. dataList: null, // 列表数据
  242. listLoading: false, // 列表加载loading
  243. screenForm: { // 筛选表单数据
  244. orderNum: '',
  245. orderNo: '',
  246. jxsNum: '',
  247. jxsName: '',
  248. chName: '',
  249. model: '',
  250. date: '',
  251. type: '',
  252. salesMan: '',
  253. },
  254. categoryList: [],
  255. salesmanList: [],
  256. isShowDialog: false, // 密码记录 - 弹窗
  257. dialogTable_dataList: null, // 密码记录 - 列表数据
  258. dialogTable_listLoading: true, // 密码记录 - 列表加载loading
  259. dialogTable_currentPage: 1, // 密码记录 - 当前页码
  260. dialogTable_pageSize: 10, // 密码记录 - 每页数量
  261. dialogTable_listTotal: 0, // 密码记录 - 列表总数
  262. queryItem: {},
  263. }
  264. },
  265. computed: {
  266. exParams() {
  267. return {
  268. id: this.screenForm.orderNum,
  269. mainOrderId: this.screenForm.orderNo,
  270. customerNumber: this.screenForm.jxsNum,
  271. customerName: this.screenForm.jxsName,
  272. productName: this.screenForm.chName,
  273. specification: this.screenForm.model,
  274. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  275. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  276. categoryName: this.screenForm.type,
  277. serviceId: this.screenForm.salesMan,
  278. }
  279. },
  280. isShowDetail() {
  281. return this.queryItem.hasOwnProperty('id');
  282. },
  283. },
  284. created() {
  285. this.getSalesmanList();
  286. this.getCategoryList();
  287. this.getList();
  288. },
  289. methods: {
  290. // 获取业务员列表
  291. getSalesmanList() {
  292. getSalesmanList({
  293. pageNum: 1,
  294. pageSize: -1,
  295. isCustomer: 0,
  296. status: true,
  297. }).then(res => {
  298. this.salesmanList = res.data.records;
  299. })
  300. },
  301. // 获取存货类别列表
  302. getCategoryList() {
  303. getCategoryList({
  304. pageNum: 1,
  305. pageSize: -1,
  306. }).then(res => {
  307. this.categoryList = res.data.records;
  308. })
  309. },
  310. // 查询列表
  311. getList() {
  312. this.listLoading = true;
  313. let params = {
  314. pageNum: this.currentPage,
  315. pageSize: this.pageSize,
  316. id: this.screenForm.orderNum,
  317. mainOrderId: this.screenForm.orderNo,
  318. customerNumber: this.screenForm.jxsNum,
  319. customerName: this.screenForm.jxsName,
  320. productName: this.screenForm.chName,
  321. specification: this.screenForm.model,
  322. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  323. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  324. categoryName: this.screenForm.type,
  325. serviceId: this.screenForm.salesMan,
  326. };
  327. getDeliverList(params).then((res) => {
  328. res.data.records.forEach(item => {
  329. item.notOutNumber = item.salesStatus ? 0 : item.refundableQty;
  330. item.sums1 = ['refundableQty', 'notOutNumber'];
  331. item.sums2 = ['payAmount', 'afterTaxPrice', 'noTotalAmount'];
  332. })
  333. this.dataList = res.data.records;
  334. this.listTotal = res.data.total;
  335. this.listLoading = false;
  336. })
  337. },
  338. // 提交筛选表单
  339. submitScreenForm() {
  340. this.currentPage = 1;
  341. this.getList();
  342. },
  343. // 重置筛选表单
  344. resetScreenForm() {
  345. this.$refs.screenForm.resetFields();
  346. this.currentPage = 1;
  347. this.getList();
  348. },
  349. // 更改每页数量
  350. handleSizeChange(val) {
  351. this.pageSize = val;
  352. this.currentPage = 1;
  353. this.getList();
  354. },
  355. // 更改当前页
  356. handleCurrentChange(val) {
  357. this.currentPage = val;
  358. this.getList();
  359. },
  360. // 进入详情
  361. toDetail(item) {
  362. this.queryItem = item;
  363. },
  364. backList() {
  365. this.queryItem = {};
  366. },
  367. // 获取密码
  368. getPassword(id) {
  369. getPassword({id}).then(res => {
  370. this.$alert(res.data, '新密码', {
  371. confirmButtonText: '确定',
  372. callback: action => {}
  373. });
  374. })
  375. },
  376. // 密码记录 - 获取列表
  377. getPasswordRecord(id) {
  378. getPasswordRecord({
  379. pageNum: this.dialogTable_currentPage,
  380. pageSize: this.dialogTable_pageSize,
  381. id
  382. }).then(res => {
  383. this.dialogTable_dataList = res.data.records;
  384. this.dialogTable_listTotal = res.data.total;
  385. this.dialogTable_listLoading = false;
  386. })
  387. },
  388. // 密码记录 - 打开弹窗
  389. openShareDetail(id) {
  390. this.isShowDialog = true;
  391. this.dialogTable_currentPage = 1;
  392. this.getPasswordRecord(id);
  393. },
  394. // 密码记录 - 更改列表当前页
  395. dialogTableCurrentChange(val) {
  396. this.dialogTable_currentPage = val;
  397. this.getPasswordRecord();
  398. },
  399. }
  400. }
  401. </script>
  402. <style lang="scss" scoped>
  403. </style>