SyCarryList.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-item label="编码">
  9. <a-input placeholder="请输入编码" v-model="queryParam.code"></a-input>
  10. </a-form-item>
  11. </a-col> -->
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <a-form-item label="名称">
  14. <a-input placeholder="请输入名称" v-model="queryParam.name"></a-input>
  15. </a-form-item>
  16. </a-col>
  17. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  18. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  19. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  20. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  21. </span>
  22. </a-col>
  23. </a-row>
  24. </a-form>
  25. </div>
  26. <!-- 操作按钮区域 -->
  27. <div class="table-operator">
  28. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  29. <!-- <a-button type="primary" icon="download" @click="handleExportXls('搬运装卸费用-搬运工对账单')">导出</a-button>
  30. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  31. <a-button type="primary" icon="import">导入</a-button>
  32. </a-upload> -->
  33. <a-dropdown v-if="selectedRowKeys.length > 0">
  34. <a-menu slot="overlay">
  35. <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
  36. </a-menu>
  37. <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
  38. </a-dropdown>
  39. </div>
  40. <!-- table区域-begin -->
  41. <div>
  42. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  43. <i class="anticon anticon-info-circle ant-alert-icon"></i>
  44. <span>已选择</span>
  45. <a style="font-weight: 600">
  46. {{ selectedRowKeys.length }}
  47. </a>
  48. <span>项</span>
  49. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  50. </div>
  51. <a-table
  52. ref="table"
  53. size="middle"
  54. bordered
  55. rowKey="id"
  56. :columns="columns"
  57. :dataSource="dataSource"
  58. :pagination="ipagination"
  59. :scroll="{y:400}"
  60. :loading="loading"
  61. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  62. @change="handleTableChange">
  63. <span slot="state" slot-scope="text, record">
  64. <span v-if="record.state == '0'">草稿</span>
  65. <span v-if="record.state == '1'">计划签字中</span>
  66. <span v-if="record.state == '2'">人事行政审批中</span>
  67. <span v-if="record.state == '3'">财务经理审批中</span>
  68. <span v-if="record.state == '4'">已完成</span>
  69. </span>
  70. <span slot="action" slot-scope="text, record">
  71. <a @click="handleEdit(record,'0')" v-if="record.state !== '70'">编辑</a>
  72. <a-divider type="vertical" v-if="record.state !== '70'"/>
  73. <a @click="handleEdit(record,'1')">详情</a>
  74. <a-divider type="vertical" />
  75. <a-popconfirm :title="'确定'+record.roleText+'吗?'" @confirm="() => plannerSubmit(record,1)" >
  76. <a v-if="record.state !== '70' && record.state !== '0' && record.state !== '1'">{{ record.roleText }}</a>
  77. </a-popconfirm>
  78. <a-popconfirm :title="'确定提交吗?'" @confirm="() => plannerSubmit(record,1)" >
  79. <a v-if="record.state == '0'">提交</a>
  80. </a-popconfirm>
  81. <!-- <a-popconfirm title="确定人事行政审批吗?" @confirm="() => plannerSubmit(record,2)" v-if="record.state == '2'">
  82. <a >人事行政审批</a>
  83. </a-popconfirm>
  84. <a-popconfirm title="确定财务经理审批吗?" @confirm="() => plannerSubmit(record,3)" v-if="record.state == '3'">
  85. <a >财务经理审批</a>
  86. </a-popconfirm> -->
  87. <a-divider type="vertical" v-if="record.state !== '0' && record.state !== '1'||record.state !== '70'" />
  88. <a-dropdown>
  89. <a class="ant-dropdown-link">操作<a-icon type="down" /></a>
  90. <a-menu slot="overlay">
  91. <a-menu-item>
  92. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)" v-if="record.state == '0'">
  93. <a>删除</a>
  94. </a-popconfirm>
  95. <a-popconfirm title="确定计划员取消提交吗?" @confirm="() => plannerSubmit(record,-1)" v-if="record.state !== '0' && record.state !== '70'">
  96. <a >计划员取消提交</a>
  97. </a-popconfirm>
  98. <a-popconfirm title="确定一键回退吗?" @confirm="() => Fallback(record)" v-if="record.state !== '0' && record.state !== '1' && record.state !== '70'" v-has="'syCarry:initial'">
  99. <a >一键回退</a>
  100. </a-popconfirm>
  101. </a-menu-item>
  102. </a-menu>
  103. </a-dropdown>
  104. </span>
  105. </a-table>
  106. </div>
  107. <!-- table区域-end -->
  108. <!-- 表单区域 -->
  109. <syCarry-modal ref="modalForm" @ok="modalFormOk" @close='loadData'/>
  110. <sy-carry-detail-modal ref="syCarryDetailModal" @close='loadData'></sy-carry-detail-modal>
  111. </a-card>
  112. </template>
  113. <script>
  114. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  115. import SyCarryModal from './modules/SyCarryModal'
  116. import SyCarryDetailModal from './modules/SyCarryDetailModal'
  117. import { getAction } from '@/api/manage'
  118. import moment from 'moment'
  119. export default {
  120. name: "SyCarryList",
  121. mixins: [JeecgListMixin],
  122. components: {
  123. SyCarryModal,
  124. SyCarryDetailModal,
  125. moment
  126. },
  127. data () {
  128. return {
  129. description: '搬运装卸费用-搬运工对账单-主表管理页面',
  130. // 表头
  131. columns: [
  132. {
  133. title: '序号',
  134. dataIndex: '',
  135. key: 'rowIndex',
  136. width: 40,
  137. align: "center",
  138. customRender:function (t, r, index) {
  139. return parseInt(index)+1;
  140. }
  141. },
  142. {
  143. title: '名称',
  144. align:"center",
  145. width: 100,
  146. dataIndex: 'name'
  147. },
  148. // {
  149. // title: '编号',
  150. // align:"center",
  151. // dataIndex: 'code'
  152. // },
  153. {
  154. title: '状态',
  155. align:"center",
  156. dataIndex: 'roleText',
  157. width: 100,
  158. // scopedSlots: { customRender: 'state' },
  159. },
  160. {
  161. title: '账户信息',
  162. align:"center",
  163. width: 350,
  164. dataIndex: 'demo'
  165. },
  166. {
  167. title: '操作',
  168. dataIndex: 'action',
  169. align:"center",
  170. width: 120,
  171. scopedSlots: { customRender: 'action' },
  172. }
  173. ],
  174. queryParam:{},
  175. // 请求参数
  176. url: {
  177. list: "/oa/syCarry/list",
  178. delete: "/oa/syCarry/delete",
  179. deleteBatch: "/oa/syCarry/deleteBatch",
  180. exportXlsUrl: "oa/syCarry/exportXls",
  181. importExcelUrl: "oa/syCarry/importExcel",
  182. editListUrl: '/oa/syCarry/querySyCarryBByMainId'
  183. },
  184. }
  185. },
  186. computed: {
  187. importExcelUrl: function(){
  188. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  189. }
  190. },
  191. methods: {
  192. searchQuery(){
  193. this.loadData()
  194. },
  195. // 计划员提交
  196. plannerSubmit(record,state){
  197. if(state=='-1'){
  198. state='-1'
  199. }else{
  200. state=record.state
  201. }
  202. getAction('/oa/syCarry/commitBatch', {ids:record.id,state:state}).then((res) => {
  203. if(res.success){
  204. this.loadData()
  205. }else{
  206. this.$message.warning(res.message)
  207. }
  208. })
  209. },
  210. Fallback(record){
  211. getAction('/oa/syCarry/initial', {id:record.id}).then((res) => {
  212. if(res.success){
  213. this.loadData()
  214. }else{
  215. this.$message.warning(res.message)
  216. }
  217. })
  218. },
  219. searchReset(){
  220. this.queryParam={}
  221. this.loadData()
  222. },
  223. handleEdit(record,data){
  224. if(data == '0'){
  225. this.$refs.modalForm.visible = true
  226. if(record.state!=='0'){
  227. this.$refs.modalForm.editAll = 'yes'
  228. }else{
  229. this.$refs.modalForm.editAll = 'no'
  230. }
  231. this.$refs.modalForm.getHeaderList(record.id)
  232. this.$refs.modalForm.defultMethods = 'edit'
  233. }else{
  234. this.$refs.syCarryDetailModal.visible = true
  235. this.$refs.syCarryDetailModal.getHeaderList(record.id)
  236. }
  237. },
  238. initDictConfig() {
  239. },
  240. }
  241. }
  242. </script>
  243. <style scoped>
  244. @import '~@assets/less/common.less'
  245. </style>