home_list.vue 18 KB

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