commerce_list.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowForm && !isShowExamine && !isShowReturn">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form ref="screenForm" :model="screenForm" label-width="100px" size="small" label-position="left">
  7. <el-row :gutter="20">
  8. <el-col :xs="24" :sm="24" :lg="24">
  9. <el-form-item prop="status" label-width="0">
  10. <el-radio-group v-model="screenForm.status" size="medium" @change="getList()">
  11. <el-radio-button label="">全部</el-radio-button>
  12. <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
  13. </el-radio-group>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :xs="24" :sm="12" :lg="6">
  17. <el-form-item label="工程订单号" prop="orderNum">
  18. <el-input v-model="screenForm.orderNum" placeholder="请输入工程订单号"></el-input>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :xs="24" :sm="12" :lg="6">
  22. <el-form-item label="工程编码" prop="enginNum">
  23. <el-input v-model="screenForm.enginNum" placeholder="请输入工程编码"></el-input>
  24. </el-form-item>
  25. </el-col>
  26. <el-col :xs="24" :sm="12" :lg="6">
  27. <el-form-item label="工程登录单号" prop="loginNum">
  28. <el-input v-model="screenForm.loginNum" placeholder="请输入工程登录单号"></el-input>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :xs="24" :sm="12" :lg="6">
  32. <el-form-item label="工程名称" prop="enginName">
  33. <el-input v-model="screenForm.enginName" placeholder="请输入工程名称"></el-input>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :xs="24" :sm="12" :lg="6">
  37. <el-form-item label="单据日期" prop="date">
  38. <el-date-picker
  39. v-model="screenForm.date"
  40. type="datetimerange"
  41. range-separator="至"
  42. style="width: 100%;"
  43. value-format="yyyy-MM-dd HH:mm:ss"
  44. start-placeholder="开始日期"
  45. end-placeholder="结束日期">
  46. </el-date-picker>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :xs="24" :sm="12" :lg="6">
  50. <el-form-item label="销售类型" prop="saleType">
  51. <el-input v-model="screenForm.saleType" placeholder="请输入销售类型"></el-input>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :xs="24" :sm="12" :lg="6">
  55. <el-form-item label="制表人" prop="createMan">
  56. <el-input v-model="screenForm.createMan" 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="examineMan">
  61. <el-input v-model="screenForm.examineMan" placeholder="请输入审核人"></el-input>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  65. <el-form-item label="">
  66. <el-button size="small" @click="resetScreenForm">清空</el-button>
  67. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  68. </el-form-item>
  69. </el-col>
  70. </el-row>
  71. </el-form>
  72. </div>
  73. <div class="mymain-container">
  74. <div class="btn-group clearfix">
  75. <div class="fl">
  76. <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
  77. <el-button size="small" type="danger" icon="el-icon-minus" :disabled="multipleSelection.length < 1" @click="batchDelete()">批量删除</el-button>
  78. </div>
  79. <div class="fr">
  80. <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
  81. </div>
  82. </div>
  83. <div class="table">
  84. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe @selection-change="handleSelectionChange">
  85. <el-table-column align="center" type="selection" width="55"></el-table-column>
  86. <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  87. <template slot-scope="scope">
  88. {{scope.row.examineStatus | statusFilter}}
  89. </template>
  90. </el-table-column>
  91. <el-table-column align="center" label="工程订单号" prop="enginOrderNo" min-width="200" show-overflow-tooltip></el-table-column>
  92. <el-table-column align="center" label="订单日期" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
  93. <el-table-column align="center" label="工程登录单号" prop="refEnginRecordNo" min-width="160" show-overflow-tooltip></el-table-column>
  94. <el-table-column align="center" label="订单类型" prop="enginOrderType" min-width="160" show-overflow-tooltip>
  95. <template slot-scope="scope">
  96. {{scope.row.enginOrderType | typeFilter}}
  97. </template>
  98. </el-table-column>
  99. <el-table-column align="center" label="工程名称" prop="refProjectName" min-width="160" show-overflow-tooltip></el-table-column>
  100. <el-table-column align="center" label="销售类型" prop="saleTypeId" min-width="160" show-overflow-tooltip></el-table-column>
  101. <el-table-column align="center" label="货品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  102. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  103. <el-table-column align="center" label="单位" prop="baseUnitId" min-width="100" show-overflow-tooltip></el-table-column>
  104. <el-table-column align="center" label="总数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  105. <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
  106. <template slot-scope="scope">
  107. {{scope.row.isDirectTransfer ? '是':'否'}}
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
  111. <el-table-column align="center" label="出库数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
  112. <el-table-column align="center" label="单价" prop="enginPrice" min-width="100" show-overflow-tooltip></el-table-column>
  113. <el-table-column align="center" label="金额" prop="enginTotality" min-width="100" show-overflow-tooltip></el-table-column>
  114. <el-table-column align="center" label="返利钱包" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
  115. <el-table-column align="center" label="使用返利金额" prop="rebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
  116. <el-table-column align="center" label="业务员" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
  117. <el-table-column align="center" label="制表人" prop="createName" min-width="100" show-overflow-tooltip></el-table-column>
  118. <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  119. <el-table-column align="center" label="审核人" prop="confirmName" min-width="100" show-overflow-tooltip></el-table-column>
  120. <el-table-column align="center" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip></el-table-column>
  121. <el-table-column align="center" label="操作" width="220" fixed="right">
  122. <template slot-scope="scope">
  123. <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.parentId)" v-if="scope.row.examineStatus === 'SAVE'" >
  124. <el-button slot="reference" type="text">申请</el-button>
  125. </el-popconfirm>
  126. <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.parentId)" v-if="scope.row.examineStatus === 'WAIT'" >
  127. <el-button slot="reference" type="text">撤回</el-button>
  128. </el-popconfirm>
  129. <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
  130. <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审批</el-button>
  131. <el-button type="text" @click="toReturn(scope.row)">退订</el-button>
  132. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  133. <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" >
  134. <el-button slot="reference" type="text">删除</el-button>
  135. </el-popconfirm>
  136. </template>
  137. </el-table-column>
  138. </el-table>
  139. </div>
  140. </div>
  141. <div class="pagination clearfix">
  142. <div class="fr">
  143. <el-pagination
  144. @size-change="handleSizeChange"
  145. @current-change="handleCurrentChange"
  146. :current-page="currentPage"
  147. :page-sizes="[10, 20, 30, 50]"
  148. :page-size="10"
  149. layout="total, sizes, prev, pager, next, jumper"
  150. :total="listTotal">
  151. </el-pagination>
  152. </div>
  153. </div>
  154. </div>
  155. <CommerceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  156. <CommerceForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  157. <CommerceExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  158. <CommerceReturn :listItem="queryItem" v-if="isShowReturn" @backListFormDetail="backList" />
  159. </div>
  160. </template>
  161. <script>
  162. import { getOrderList, applyCom, withdrawCom, deleteCom } from "@/api/supply/engin";
  163. import CommerceDetail from "@/views/supply/engin/components/commerce_detail";
  164. import CommerceForm from "@/views/supply/engin/components/commerce_form";
  165. import CommerceExamine from "@/views/supply/engin/components/commerce_examine";
  166. import CommerceReturn from "@/views/supply/engin/components/commerce_return";
  167. let that
  168. export default {
  169. components: {
  170. CommerceDetail,
  171. CommerceForm,
  172. CommerceExamine,
  173. CommerceReturn,
  174. },
  175. filters: {
  176. statusFilter(val) {
  177. let obj = that.statusList.find(o => o.value == val);
  178. return obj ? obj.label : ''
  179. },
  180. typeFilter(val) {
  181. const MAP = {
  182. TRADE: '商用',
  183. HOME: '家用',
  184. }
  185. return MAP[val];
  186. }
  187. },
  188. data() {
  189. return {
  190. currentPage: 1, // 当前页码
  191. pageSize: 10, // 每页数量
  192. listTotal: 0, // 列表总数
  193. dataList: null, // 列表数据
  194. listLoading: false, // 列表加载loading
  195. screenForm: { // 筛选表单数据
  196. status: '',
  197. orderNum: '',
  198. enginNum: '',
  199. loginNum: '',
  200. enginName: '',
  201. date: '',
  202. saleType: '',
  203. createMan: '',
  204. examineMan: '',
  205. },
  206. statusList: [
  207. { label: '已保存', value: 'SAVE' },
  208. { label: '待审核', value: 'WAIT' },
  209. { label: '审核通过', value: 'OK' },
  210. { label: '审核驳回', value: 'FAIL' },
  211. { label: '已关闭', value: 'CLOSE' },
  212. ],
  213. multipleSelection: [],
  214. queryItem: {},
  215. isShowDetail: false,
  216. isShowForm: false,
  217. isShowExamine: false,
  218. isShowReturn: false,
  219. }
  220. },
  221. computed: {
  222. exParams() {
  223. return {
  224. enginOrderNo: this.screenForm.orderNum,
  225. refProjectNo: this.screenForm.enginNum,
  226. refEnginRecordNo: this.screenForm.loginNum,
  227. refProjectName: this.screenForm.enginName,
  228. startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
  229. endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
  230. saleTypeId: this.screenForm.saleType,
  231. createName: this.screenForm.createMan,
  232. confirmName: this.screenForm.examineMan,
  233. enginOrderType: 'TRADE', // TRADE=商用 HOME=家用
  234. }
  235. },
  236. },
  237. beforeCreate() {
  238. that = this;
  239. },
  240. created() {
  241. this.getList();
  242. },
  243. methods: {
  244. // 查询按钮权限
  245. checkBtnRole(value) {
  246. // let btnRole = this.$route.meta.roles;
  247. // if(!btnRole) {return true}
  248. // let index = btnRole.indexOf(value);
  249. // return index >= 0;
  250. return true
  251. },
  252. // 查询列表
  253. getList() {
  254. this.listLoading = true;
  255. let params = {
  256. pageNum: this.currentPage,
  257. pageSize: this.pageSize,
  258. enginOrderNo: this.screenForm.orderNum,
  259. refProjectNo: this.screenForm.enginNum,
  260. refEnginRecordNo: this.screenForm.loginNum,
  261. refProjectName: this.screenForm.enginName,
  262. startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
  263. endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
  264. saleTypeId: this.screenForm.saleType,
  265. createName: this.screenForm.createMan,
  266. confirmName: this.screenForm.examineMan,
  267. enginOrderType: 'TRADE', // TRADE=商用 HOME=家用
  268. };
  269. getOrderList(params).then((res) => {
  270. this.dataList = res.data.records;
  271. this.listTotal = res.data.total;
  272. this.listLoading = false;
  273. })
  274. },
  275. // 提交筛选表单
  276. submitScreenForm() {
  277. this.currentPage = 1;
  278. this.getList();
  279. },
  280. // 重置筛选表单
  281. resetScreenForm() {
  282. this.$refs.screenForm.resetFields();
  283. this.currentPage = 1;
  284. this.getList();
  285. },
  286. // 更改每页数量
  287. handleSizeChange(val) {
  288. this.pageSize = val;
  289. this.currentPage = 1;
  290. this.getList();
  291. },
  292. // 更改当前页
  293. handleCurrentChange(val) {
  294. this.currentPage = val;
  295. this.getList();
  296. },
  297. // 进入表单
  298. toForm(item) {
  299. this.queryItem = item;
  300. this.isShowForm = true;
  301. },
  302. // 进入审批
  303. toExamine(item) {
  304. this.queryItem = item;
  305. this.isShowExamine = true;
  306. },
  307. // 进入详情
  308. toDetail(item) {
  309. this.queryItem = item;
  310. this.isShowDetail = true;
  311. },
  312. // 进入退订
  313. toReturn(item) {
  314. this.queryItem = item;
  315. this.isShowReturn = true;
  316. },
  317. backList() {
  318. this.queryItem = {};
  319. this.isShowDetail = false;
  320. this.isShowForm = false;
  321. this.isShowExamine = false;
  322. this.isShowReturn = false;
  323. },
  324. // 申请
  325. handleSubmit(id) {
  326. applyCom({id}).then(res => {
  327. this.$successMsg();
  328. this.getList();
  329. })
  330. },
  331. // 撤回
  332. handleWithdraw(id) {
  333. withdrawCom({id}).then(res => {
  334. this.$successMsg();
  335. this.getList();
  336. })
  337. },
  338. // 删除
  339. handleDelete(id) {
  340. deleteCom({ids: id}).then(res => {
  341. this.$successMsg();
  342. this.getList();
  343. })
  344. },
  345. // 批量删除
  346. batchDelete() {
  347. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  348. confirmButtonText: '确定',
  349. cancelButtonText: '取消',
  350. type: 'warning'
  351. }).then(() => {
  352. let ids = this.multipleSelection.map(item => {
  353. return item.parentId;
  354. });
  355. deleteCom({ids: ids.join(',')}).then(res => {
  356. this.$successMsg();
  357. this.getList();
  358. })
  359. }).catch(() => {});
  360. },
  361. handleSelectionChange(val) {
  362. this.multipleSelection = val;
  363. },
  364. }
  365. }
  366. </script>
  367. <style lang="scss" scoped>
  368. </style>