commerce_list.vue 14 KB

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