home_list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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="90px" size="small" 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. style="width: 100%; height: 33px;"
  49. value-format="yyyy-MM-dd HH:mm:ss"
  50. start-placeholder="开始日期"
  51. end-placeholder="结束日期">
  52. </el-date-picker>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :xs="24" :sm="12" :lg="6">
  56. <el-form-item label="产品名称" prop="chName">
  57. <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
  58. </el-form-item>
  59. </el-col>
  60. <el-col :xs="24" :sm="12" :lg="6">
  61. <el-form-item label="规格型号" prop="model">
  62. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :xs="24" :sm="12" :lg="6">
  66. <el-form-item prop="type" label="存货类别">
  67. <el-select v-model="screenForm.type" placeholder="选择存货类别" style="width: 100%" clearable>
  68. <el-option v-for="item in categoryList" :key="item.name" :label="item.name" :value="item.name"></el-option>
  69. </el-select>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :xs="24" :sm="12" :lg="18" class="tr">
  73. <el-form-item label="">
  74. <el-button size="small" @click="resetScreenForm">清空</el-button>
  75. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  76. </el-form-item>
  77. </el-col>
  78. </el-row>
  79. </el-form>
  80. </div>
  81. <div class="mymain-container">
  82. <div class="btn-group clearfix">
  83. <div class="fl">
  84. <!-- <el-button size="small" type="warning" icon="el-icon-close">退货</el-button> -->
  85. </div>
  86. <div class="fr">
  87. <ExportButton :exUrl="'ship/pExport'" :exParams="exParams" />
  88. </div>
  89. </div>
  90. <div class="table">
  91. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  92. <el-table-column align="center" label="发货单号" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
  93. <el-table-column align="center" label="发货日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
  94. <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
  95. <el-table-column align="center" label="订单号" prop="enginOrderNo" min-width="200" show-overflow-tooltip></el-table-column>
  96. <el-table-column align="center" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip></el-table-column>
  97. <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  98. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  99. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  100. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  101. <el-table-column align="right" label="价税合计" prop="payAmount" min-width="100" show-overflow-tooltip>
  102. <template slot-scope="scope">
  103. {{scope.row.payAmount | numToFixed}}
  104. </template>
  105. </el-table-column>
  106. <el-table-column align="right" label="无税金额" prop="noTotalAmount" min-width="100" show-overflow-tooltip>
  107. <template slot-scope="scope">
  108. {{scope.row.noTotalAmount | numToFixed}}
  109. </template>
  110. </el-table-column>
  111. <el-table-column align="right" label="无税单价" prop="afterTaxPrice" min-width="100" show-overflow-tooltip>
  112. <template slot-scope="scope">
  113. {{scope.row.afterTaxPrice | numToFixed}}
  114. </template>
  115. </el-table-column>
  116. <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  117. <el-table-column align="right" label="未出库数量" min-width="100" show-overflow-tooltip>
  118. <template slot-scope="scope">
  119. {{scope.row.salesStatus ? 0 : scope.row.refundableQty}}
  120. </template>
  121. </el-table-column>
  122. <el-table-column align="center" label="备注信息" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  123. <el-table-column align="center" label="操作" width="200" fixed="right">
  124. <template slot-scope="scope">
  125. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  126. <el-button type="text" @click="getPassword(scope.row.id)">获取密码</el-button>
  127. <el-button type="text" @click="openShareDetail(scope.row.id)">密码记录</el-button>
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. </div>
  132. </div>
  133. <div class="pagination clearfix">
  134. <div class="fr">
  135. <el-pagination
  136. @size-change="handleSizeChange"
  137. @current-change="handleCurrentChange"
  138. :current-page="currentPage"
  139. :page-sizes="[10, 20, 30, 50]"
  140. :page-size="10"
  141. layout="total, sizes, prev, pager, next, jumper"
  142. :total="listTotal">
  143. </el-pagination>
  144. </div>
  145. </div>
  146. </div>
  147. <!-- 密码记录 -->
  148. <el-dialog title="密码记录" :visible.sync="isShowDialog" :show-close="false" width="50%" :close-on-click-modal="false">
  149. <div class="table" style="margin: 10px 0 20px;">
  150. <el-table
  151. v-loading="dialogTable_listLoading"
  152. :data="dialogTable_dataList"
  153. element-loading-text="Loading"
  154. tooltip-effect="dark"
  155. style="width: 100%"
  156. max-height="270">
  157. <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
  158. <el-table-column align="center" prop="printPassword" label="密码"></el-table-column>
  159. <el-table-column align="center" prop="createTime" label="打印时间"></el-table-column>
  160. </el-table>
  161. </div>
  162. <div class="pagination clearfix">
  163. <div class="fr">
  164. <el-pagination
  165. @current-change="dialogTableCurrentChange"
  166. :current-page="dialogTable_currentPage"
  167. :page-size="dialogTable_pageSize"
  168. background
  169. layout="prev, pager, next"
  170. :total="dialogTable_listTotal">
  171. </el-pagination>
  172. </div>
  173. </div>
  174. <div slot="footer" class="dialog-footer">
  175. <el-button @click="isShowDialog = false">关 闭</el-button>
  176. </div>
  177. </el-dialog>
  178. <HomeDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  179. </div>
  180. </template>
  181. <script>
  182. import { getEnginList, getPassword, getPasswordRecord } from "@/api/supply/deliver";
  183. import { getCategoryList } from '@/api/common'
  184. import HomeDetail from "@/views/supply/deliver/components/home_detail";
  185. let that
  186. export default {
  187. components: {
  188. HomeDetail,
  189. },
  190. data() {
  191. return {
  192. currentPage: 1, // 当前页码
  193. pageSize: 10, // 每页数量
  194. listTotal: 0, // 列表总数
  195. dataList: null, // 列表数据
  196. listLoading: false, // 列表加载loading
  197. screenForm: { // 筛选表单数据
  198. orderNum: '',
  199. orderNo: '',
  200. contractNo: '',
  201. jxsName: '',
  202. chName: '',
  203. model: '',
  204. date: '',
  205. jxsNum: '',
  206. status: '',
  207. },
  208. categoryList: [],
  209. isShowDialog: false, // 密码记录 - 弹窗
  210. dialogTable_dataList: null, // 密码记录 - 列表数据
  211. dialogTable_listLoading: true, // 密码记录 - 列表加载loading
  212. dialogTable_currentPage: 1, // 密码记录 - 当前页码
  213. dialogTable_pageSize: 10, // 密码记录 - 每页数量
  214. dialogTable_listTotal: 0, // 密码记录 - 列表总数
  215. queryItem: {},
  216. }
  217. },
  218. computed: {
  219. exParams() {
  220. return {
  221. id: this.screenForm.orderNum,
  222. enginOrderNo: this.screenForm.orderNo,
  223. refEnginRecordNo: this.screenForm.contractNo,
  224. customerNumber: this.screenForm.jxsNum,
  225. customerName: this.screenForm.jxsName,
  226. materialName: this.screenForm.chName,
  227. specification: this.screenForm.model,
  228. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  229. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  230. categoryName: this.screenForm.type,
  231. orderType: 2, // 2家用工程 3商用工程
  232. }
  233. },
  234. isShowDetail() {
  235. return this.queryItem.hasOwnProperty('id');
  236. },
  237. },
  238. beforeCreate() {
  239. that = this;
  240. },
  241. created() {
  242. this.getCategoryList();
  243. this.getList();
  244. },
  245. methods: {
  246. // 查询按钮权限
  247. checkBtnRole(value) {
  248. // let btnRole = this.$route.meta.roles;
  249. // if(!btnRole) {return true}
  250. // let index = btnRole.indexOf(value);
  251. // return index >= 0;
  252. return true
  253. },
  254. // 获取存货类别列表
  255. getCategoryList() {
  256. getCategoryList({
  257. pageNum: 1,
  258. pageSize: -1,
  259. }).then(res => {
  260. this.categoryList = res.data.records;
  261. })
  262. },
  263. // 查询列表
  264. getList() {
  265. this.listLoading = true;
  266. let params = {
  267. pageNum: this.currentPage,
  268. pageSize: this.pageSize,
  269. id: this.screenForm.orderNum,
  270. enginOrderNo: this.screenForm.orderNo,
  271. refEnginRecordNo: this.screenForm.contractNo,
  272. customerNumber: this.screenForm.jxsNum,
  273. customerName: this.screenForm.jxsName,
  274. materialName: this.screenForm.chName,
  275. specification: this.screenForm.model,
  276. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  277. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  278. categoryName: this.screenForm.type,
  279. orderType: 2, // 2家用工程 3商用工程
  280. };
  281. getEnginList(params).then((res) => {
  282. this.dataList = res.data.records;
  283. this.listTotal = res.data.total;
  284. this.listLoading = false;
  285. })
  286. },
  287. // 提交筛选表单
  288. submitScreenForm() {
  289. this.currentPage = 1;
  290. this.getList();
  291. },
  292. // 重置筛选表单
  293. resetScreenForm() {
  294. this.$refs.screenForm.resetFields();
  295. this.currentPage = 1;
  296. this.getList();
  297. },
  298. // 更改每页数量
  299. handleSizeChange(val) {
  300. this.pageSize = val;
  301. this.currentPage = 1;
  302. this.getList();
  303. },
  304. // 更改当前页
  305. handleCurrentChange(val) {
  306. this.currentPage = val;
  307. this.getList();
  308. },
  309. // 进入详情
  310. toDetail(item) {
  311. this.queryItem = item;
  312. },
  313. backList() {
  314. this.queryItem = {};
  315. },
  316. // 获取密码
  317. getPassword(id) {
  318. getPassword({id}).then(res => {
  319. this.$alert(res.data, '新密码', {
  320. confirmButtonText: '确定',
  321. callback: action => {}
  322. });
  323. })
  324. },
  325. // 密码记录 - 获取列表
  326. getPasswordRecord(id) {
  327. getPasswordRecord({
  328. pageNum: this.dialogTable_currentPage,
  329. pageSize: this.dialogTable_pageSize,
  330. id
  331. }).then(res => {
  332. this.dialogTable_dataList = res.data.records;
  333. this.dialogTable_listTotal = res.data.total;
  334. this.dialogTable_listLoading = false;
  335. })
  336. },
  337. // 密码记录 - 打开弹窗
  338. openShareDetail(id) {
  339. this.isShowDialog = true;
  340. this.dialogTable_currentPage = 1;
  341. this.getPasswordRecord(id);
  342. },
  343. // 密码记录 - 更改列表当前页
  344. dialogTableCurrentChange(val) {
  345. this.dialogTable_currentPage = val;
  346. this.getPasswordRecord();
  347. },
  348. }
  349. }
  350. </script>
  351. <style lang="scss" scoped>
  352. </style>