direct_list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  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="mini" 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" @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 @click="resetScreenForm">清空</el-button>
  62. <el-button 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="mini" type="danger" icon="el-icon-minus" :disabled="multipleSelection.length < 1" @click="batchDelete()" v-if="$checkBtnRole('del', $route.meta.roles)">批量删除</el-button>
  72. </div>
  73. <div class="fr">
  74. <ExportButton :exUrl="'requisition/export'" :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 @selection-change="handleSelectionChange">
  79. <el-table-column align="center" type="selection" width="55"></el-table-column>
  80. <el-table-column align="left" label="直接调拨单号" prop="id" min-width="190" show-overflow-tooltip>
  81. <template slot-scope="scope">
  82. <CopyButton :copyText="scope.row.id" />
  83. <span>{{scope.row.id}}</span>
  84. </template>
  85. </el-table-column>
  86. <el-table-column align="left" label="订单号" prop="mainOrderId" min-width="140" show-overflow-tooltip>
  87. <template slot-scope="scope">
  88. <CopyButton :copyText="scope.row.orderType === 'TRADE' ? scope.row.enginOrderNo : scope.row.mainOrderId" />
  89. <span>{{scope.row.orderType === 'TRADE' ? scope.row.enginOrderNo : scope.row.mainOrderId}}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column align="left" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  93. <template slot-scope="scope">
  94. {{scope.row.examineStatus | statusFilter}}
  95. </template>
  96. </el-table-column>
  97. <el-table-column align="left" label="单据日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
  98. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
  99. <template slot-scope="scope">
  100. <CopyButton :copyText="scope.row.customerNumber" />
  101. <span>{{scope.row.customerNumber}}</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  105. <template slot-scope="scope">
  106. <CopyButton :copyText="scope.row.customerName" />
  107. <span>{{scope.row.customerName}}</span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="left" label="调拨方向" prop="direction" min-width="100" show-overflow-tooltip></el-table-column>
  111. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  112. <template slot-scope="scope">
  113. <CopyButton :copyText="scope.row.materialCode" />
  114. <span>{{scope.row.materialCode}}</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  118. <template slot-scope="scope">
  119. <CopyButton :copyText="scope.row.materialOldNumber" />
  120. <span>{{scope.row.materialOldNumber}}</span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  124. <template slot-scope="scope">
  125. <CopyButton :copyText="scope.row.materialName" />
  126. <span>{{scope.row.materialName}}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  130. <template slot-scope="scope">
  131. <CopyButton :copyText="scope.row.specification" />
  132. <span>{{scope.row.specification}}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  136. <el-table-column align="left" label="调拨数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  137. <el-table-column align="left" label="调出仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
  138. <el-table-column align="left" label="调出仓位" prop="stockName" min-width="100" show-overflow-tooltip></el-table-column>
  139. <el-table-column align="left" label="调入仓库" prop="inCorrespondName" min-width="100" show-overflow-tooltip></el-table-column>
  140. <el-table-column align="left" label="调入仓位" prop="inStockName" min-width="100" show-overflow-tooltip></el-table-column>
  141. <el-table-column align="left" label="备注信息" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  142. <el-table-column align="left" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
  143. <el-table-column align="left" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  144. <el-table-column align="left" label="审核人" prop="approvalName" min-width="100" show-overflow-tooltip></el-table-column>
  145. <el-table-column align="left" label="审核日期" prop="approvalTime" min-width="160" show-overflow-tooltip></el-table-column>
  146. <el-table-column align="center" label="操作" width="180" fixed="right">
  147. <template slot-scope="scope">
  148. <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
  149. <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审单</el-button>
  150. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  151. <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)" v-if="$checkBtnRole('del', $route.meta.roles)">
  152. <el-button slot="reference" type="text">删除</el-button>
  153. </el-popconfirm>
  154. </template>
  155. </el-table-column>
  156. </el-table>
  157. </div>
  158. </div>
  159. <div class="pagination clearfix">
  160. <div class="fr">
  161. <el-pagination
  162. @size-change="handleSizeChange"
  163. @current-change="handleCurrentChange"
  164. :current-page="currentPage"
  165. :page-sizes="[10, 20, 30, 50]"
  166. :page-size="10"
  167. layout="total, sizes, prev, pager, next, jumper"
  168. :total="listTotal">
  169. </el-pagination>
  170. </div>
  171. </div>
  172. </div>
  173. <DirectDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  174. <DirectExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  175. <DirectForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  176. </div>
  177. </template>
  178. <script>
  179. import { getList, submitApply, deleteData } from "@/api/supply/direct";
  180. import DirectDetail from "@/views/supply/direct/components/direct_detail";
  181. import DirectExamine from "@/views/supply/direct/components/direct_examine";
  182. import DirectForm from "@/views/supply/direct/components/direct_form";
  183. let that
  184. export default {
  185. components: {
  186. DirectDetail,
  187. DirectExamine,
  188. DirectForm
  189. },
  190. filters: {
  191. statusFilter(val) {
  192. let obj = that.statusList.find(o => o.value == val);
  193. return obj ? obj.label : ''
  194. }
  195. },
  196. data() {
  197. return {
  198. currentPage: 1, // 当前页码
  199. pageSize: 10, // 每页数量
  200. listTotal: 0, // 列表总数
  201. dataList: null, // 列表数据
  202. listLoading: false, // 列表加载loading
  203. screenForm: { // 筛选表单数据
  204. orderNum: '',
  205. warehouse: '',
  206. jxsNum: '',
  207. jxsName: '',
  208. date: '',
  209. chName: '',
  210. model: '',
  211. status: '',
  212. },
  213. statusList: [
  214. { label: '已保存', value: 'SAVE' },
  215. { label: '待审核', value: 'WAIT' },
  216. { label: '审核通过', value: 'OK' },
  217. { label: '审核驳回', value: 'FAIL' },
  218. { label: '已关闭', value: 'CLOSE' },
  219. ],
  220. queryItem: {},
  221. isShowDetail: false,
  222. isShowExamine: false,
  223. isShowForm: false,
  224. multipleSelection: [],
  225. }
  226. },
  227. computed: {
  228. exParams() {
  229. return {
  230. id: this.screenForm.orderNum,
  231. correspondId: this.screenForm.warehouse,
  232. customerNumber: this.screenForm.jxsNum,
  233. customerName: this.screenForm.jxsName,
  234. productName: this.screenForm.chName,
  235. specification: this.screenForm.model,
  236. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  237. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  238. examineStatus: this.screenForm.status,
  239. }
  240. },
  241. },
  242. beforeCreate() {
  243. that = this;
  244. },
  245. created() {
  246. this.getList();
  247. },
  248. methods: {
  249. // 查询列表
  250. getList() {
  251. this.listLoading = true;
  252. let params = {
  253. pageNum: this.currentPage,
  254. pageSize: this.pageSize,
  255. id: this.screenForm.orderNum,
  256. correspondId: this.screenForm.warehouse,
  257. customerNumber: this.screenForm.jxsNum,
  258. customerName: this.screenForm.jxsName,
  259. productName: this.screenForm.chName,
  260. specification: this.screenForm.model,
  261. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  262. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  263. examineStatus: this.screenForm.status,
  264. };
  265. getList(params).then((res) => {
  266. this.dataList = res.data.records;
  267. this.listTotal = res.data.total;
  268. this.listLoading = false;
  269. })
  270. },
  271. // 提交筛选表单
  272. submitScreenForm() {
  273. this.currentPage = 1;
  274. this.getList();
  275. },
  276. // 重置筛选表单
  277. resetScreenForm() {
  278. this.$refs.screenForm.resetFields();
  279. this.currentPage = 1;
  280. this.getList();
  281. },
  282. // 更改每页数量
  283. handleSizeChange(val) {
  284. this.pageSize = val;
  285. this.currentPage = 1;
  286. this.getList();
  287. },
  288. // 更改当前页
  289. handleCurrentChange(val) {
  290. this.currentPage = val;
  291. this.getList();
  292. },
  293. // 进入表单
  294. toForm(item) {
  295. this.queryItem = item;
  296. this.isShowForm = true;
  297. },
  298. // 进入审批
  299. toExamine(item) {
  300. this.queryItem = item;
  301. this.isShowExamine = true;
  302. },
  303. // 进入详情
  304. toDetail(item) {
  305. this.queryItem = item;
  306. this.isShowDetail = true;
  307. },
  308. backList() {
  309. this.queryItem = {};
  310. this.isShowDetail = false;
  311. this.isShowExamine = false;
  312. this.isShowForm = false;
  313. },
  314. // 删除
  315. handleDelete(id) {
  316. deleteData({ids: id}).then(res => {
  317. this.$successMsg();
  318. this.getList();
  319. })
  320. },
  321. // 批量删除
  322. batchDelete() {
  323. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  324. confirmButtonText: '确定',
  325. cancelButtonText: '取消',
  326. type: 'warning'
  327. }).then(() => {
  328. let ids = this.multipleSelection.map(item => {
  329. return item.id;
  330. });
  331. deleteData({ids: ids.join(',')}).then(res => {
  332. this.$successMsg();
  333. this.getList();
  334. })
  335. }).catch(() => {});
  336. },
  337. handleSelectionChange(val) {
  338. this.multipleSelection = val;
  339. },
  340. // 申请/撤回
  341. handleSubmit(id, examineStatus) {
  342. submitApply({id, examineStatus}).then(res => {
  343. this.$successMsg();
  344. this.getList();
  345. })
  346. },
  347. }
  348. }
  349. </script>
  350. <style lang="scss" scoped>
  351. </style>