commerce_list.vue 20 KB

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