apply_list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowExamine && !isShowForm">
  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="warehouse">
  23. <el-input v-model="screenForm.warehouse" 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="jxsNum">
  28. <el-input v-model="screenForm.jxsNum" 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="jxsName">
  33. <el-input v-model="screenForm.jxsName" 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="chName">
  51. <el-input v-model="screenForm.chName" 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="model">
  56. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :xs="24" :sm="12" :lg="6" class="tr">
  60. <el-form-item label="">
  61. <el-button size="small" @click="resetScreenForm">清空</el-button>
  62. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  63. </el-form-item>
  64. </el-col>
  65. </el-row>
  66. </el-form>
  67. </div>
  68. <div class="mymain-container">
  69. <div class="btn-group clearfix">
  70. <div class="fl">
  71. <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">发货申请</el-button>
  72. </div>
  73. <div class="fr">
  74. <ExportButton :exUrl="'invoice/listExport'" :exParams="exParams" />
  75. </div>
  76. </div>
  77. <div class="table">
  78. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  79. <el-table-column align="center" label="发货申请单" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
  80. <el-table-column align="center" label="发货申请日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  81. <el-table-column align="center" label="仓库" prop="correspondName" min-width="120" show-overflow-tooltip></el-table-column>
  82. <el-table-column align="center" label="订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
  83. <el-table-column align="center" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip></el-table-column>
  84. <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  85. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  86. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  87. <el-table-column align="center" label="计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  88. <el-table-column align="center" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  89. <el-table-column align="center" label="已退数量" prop="retiredQty" min-width="100" show-overflow-tooltip></el-table-column>
  90. <el-table-column align="center" label="备注信息" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  91. <el-table-column align="center" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
  92. <el-table-column align="center" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  93. <el-table-column align="center" label="审核人" prop="approvalName" min-width="100" show-overflow-tooltip></el-table-column>
  94. <el-table-column align="center" label="审核日期" prop="approvalTime" min-width="160" show-overflow-tooltip></el-table-column>
  95. <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  96. <template slot-scope="scope">
  97. {{scope.row.examineStatus | statusFilter}}
  98. </template>
  99. </el-table-column>
  100. <el-table-column align="center" label="操作" width="180" fixed="right">
  101. <template slot-scope="scope">
  102. <el-popconfirm
  103. style="margin-right: 10px;"
  104. title="确定申请吗?"
  105. @onConfirm="handleSubmit(scope.row.id, 'WAIT')"
  106. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
  107. <el-button slot="reference" type="text">申请</el-button>
  108. </el-popconfirm>
  109. <el-popconfirm
  110. style="margin-right: 10px;"
  111. title="确定撤回吗?"
  112. @onConfirm="handleSubmit(scope.row.id, 'SAVE')"
  113. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
  114. <el-button slot="reference" type="text">撤回</el-button>
  115. </el-popconfirm>
  116. <el-popconfirm
  117. style="margin-right: 10px;"
  118. title="确定弃审吗?"
  119. @onConfirm="handleAbandon(scope.row.id)"
  120. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
  121. <el-button slot="reference" type="text">弃审</el-button>
  122. </el-popconfirm>
  123. <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
  124. <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审单</el-button>
  125. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  126. <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)" v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'">
  127. <el-button slot="reference" type="text">删除</el-button>
  128. </el-popconfirm>
  129. </template>
  130. </el-table-column>
  131. </el-table>
  132. </div>
  133. </div>
  134. <div class="pagination clearfix">
  135. <div class="fr">
  136. <el-pagination
  137. @size-change="handleSizeChange"
  138. @current-change="handleCurrentChange"
  139. :current-page="currentPage"
  140. :page-sizes="[10, 20, 30, 50]"
  141. :page-size="10"
  142. layout="total, sizes, prev, pager, next, jumper"
  143. :total="listTotal">
  144. </el-pagination>
  145. </div>
  146. </div>
  147. </div>
  148. <ApplyDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  149. <ApplyExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  150. <ApplyForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  151. </div>
  152. </template>
  153. <script>
  154. import { getApplyList, submitApply, deleteApply, abandonApply } from "@/api/supply/apply";
  155. import ApplyDetail from "@/views/supply/apply/components/apply_detail";
  156. import ApplyExamine from "@/views/supply/apply/components/apply_examine";
  157. import ApplyForm from "@/views/supply/apply/components/apply_form";
  158. let that
  159. export default {
  160. components: {
  161. ApplyDetail,
  162. ApplyExamine,
  163. ApplyForm
  164. },
  165. filters: {
  166. statusFilter(val) {
  167. let obj = that.statusList.find(o => o.value == val);
  168. return obj ? obj.label : ''
  169. }
  170. },
  171. data() {
  172. return {
  173. currentPage: 1, // 当前页码
  174. pageSize: 10, // 每页数量
  175. listTotal: 0, // 列表总数
  176. dataList: null, // 列表数据
  177. listLoading: false, // 列表加载loading
  178. screenForm: { // 筛选表单数据
  179. orderNum: '',
  180. warehouse: '',
  181. jxsNum: '',
  182. jxsName: '',
  183. date: '',
  184. chName: '',
  185. model: '',
  186. status: '',
  187. },
  188. statusList: [
  189. { label: '已保存', value: 'SAVE' },
  190. { label: '待审核', value: 'WAIT' },
  191. { label: '审核通过', value: 'OK' },
  192. { label: '审核驳回', value: 'FAIL' },
  193. { label: '已关闭', value: 'CLOSE' },
  194. ],
  195. queryItem: {},
  196. isShowDetail: false,
  197. isShowExamine: false,
  198. isShowForm: false,
  199. }
  200. },
  201. computed: {
  202. exParams() {
  203. return {
  204. id: this.screenForm.orderNum,
  205. correspondName: this.screenForm.warehouse,
  206. customerNumber: this.screenForm.jxsNum,
  207. customerName: this.screenForm.jxsName,
  208. productName: this.screenForm.chName,
  209. specification: this.screenForm.model,
  210. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  211. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  212. examineStatus: this.screenForm.status,
  213. }
  214. },
  215. },
  216. beforeCreate() {
  217. that = this;
  218. },
  219. created() {
  220. this.getList();
  221. },
  222. methods: {
  223. // 查询按钮权限
  224. checkBtnRole(value) {
  225. // let btnRole = this.$route.meta.roles;
  226. // if(!btnRole) {return true}
  227. // let index = btnRole.indexOf(value);
  228. // return index >= 0;
  229. return true
  230. },
  231. // 查询列表
  232. getList() {
  233. this.listLoading = true;
  234. let params = {
  235. pageNum: this.currentPage,
  236. pageSize: this.pageSize,
  237. id: this.screenForm.orderNum,
  238. correspondName: this.screenForm.warehouse,
  239. customerNumber: this.screenForm.jxsNum,
  240. customerName: this.screenForm.jxsName,
  241. productName: this.screenForm.chName,
  242. specification: this.screenForm.model,
  243. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  244. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  245. examineStatus: this.screenForm.status,
  246. };
  247. getApplyList(params).then((res) => {
  248. this.dataList = res.data.records;
  249. this.listTotal = res.data.total;
  250. this.listLoading = false;
  251. })
  252. },
  253. // 提交筛选表单
  254. submitScreenForm() {
  255. this.currentPage = 1;
  256. this.getList();
  257. },
  258. // 重置筛选表单
  259. resetScreenForm() {
  260. this.$refs.screenForm.resetFields();
  261. this.currentPage = 1;
  262. this.getList();
  263. },
  264. // 更改每页数量
  265. handleSizeChange(val) {
  266. this.pageSize = val;
  267. this.currentPage = 1;
  268. this.getList();
  269. },
  270. // 更改当前页
  271. handleCurrentChange(val) {
  272. this.currentPage = val;
  273. this.getList();
  274. },
  275. // 进入表单
  276. toForm(item) {
  277. this.queryItem = item;
  278. this.isShowForm = true;
  279. },
  280. // 进入审批
  281. toExamine(item) {
  282. this.queryItem = item;
  283. this.isShowExamine = true;
  284. },
  285. // 进入详情
  286. toDetail(item) {
  287. this.queryItem = item;
  288. this.isShowDetail = true;
  289. },
  290. backList() {
  291. this.queryItem = {};
  292. this.isShowDetail = false;
  293. this.isShowExamine = false;
  294. this.isShowForm = false;
  295. },
  296. handleDelete(id) {
  297. deleteApply({id}).then(res => {
  298. this.$successMsg();
  299. this.getList();
  300. })
  301. },
  302. // 申请/撤回
  303. handleSubmit(id, examineStatus) {
  304. submitApply({id, examineStatus}).then(res => {
  305. this.$successMsg();
  306. this.getList();
  307. })
  308. },
  309. // 弃审
  310. handleAbandon(id) {
  311. abandonApply({id}).then(res => {
  312. this.$successMsg();
  313. this.getList();
  314. })
  315. },
  316. }
  317. }
  318. </script>
  319. <style lang="scss" scoped>
  320. </style>