deliver_list.vue 17 KB

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