SyCottonYarnList.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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. :loading="loading"
  60. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  61. @change="handleTableChange">
  62. <span slot="state" slot-scope="text, record">
  63. <span v-if="record.state == '0'">草稿</span>
  64. <span v-if="record.state == '1'">计划签字中</span>
  65. <span v-if="record.state == '2'">人事行政审批中</span>
  66. <span v-if="record.state == '3'">财务经理审批中</span>
  67. <span v-if="record.state == '4'">已完成</span>
  68. </span>
  69. <span slot="action" slot-scope="text, record">
  70. <a @click="handleEdit(record,'0')" v-if="record.state == '0'">编辑</a>
  71. <a-divider type="vertical" v-if="record.state == '0'"/>
  72. <a @click="handleEdit(record,'1')">详情</a>
  73. <a-divider type="vertical" />
  74. <a-dropdown>
  75. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  76. <a-menu slot="overlay">
  77. <a-menu-item>
  78. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)" v-if="record.state == '0'">
  79. <a>删除</a>
  80. </a-popconfirm>
  81. <a-popconfirm title="确定计划员提交吗?" @confirm="() =>plannerSubmit(record,1)" v-if="record.state == '0'">
  82. <a>计划员提交</a>
  83. </a-popconfirm>
  84. <a-popconfirm title="确定人事行政审批吗?" @confirm="() =>plannerSubmit(record,2)" v-if="record.state == '2'">
  85. <a>人事行政审批</a>
  86. </a-popconfirm>
  87. <a-popconfirm title="确定财务经理审批吗?" @confirm="() =>plannerSubmit(record,3)" v-if="record.state == '3'">
  88. <a>财务经理审批</a>
  89. </a-popconfirm>
  90. </a-menu-item>
  91. </a-menu>
  92. </a-dropdown>
  93. </span>
  94. </a-table>
  95. </div>
  96. <!-- table区域-end -->
  97. <!-- 表单区域 -->
  98. <syCottonYarn-modal ref="modalForm" @ok="modalFormOk" @close="loadData"/>
  99. <sy-cotton-yarn-detail-modal ref="syCottonYarnDetailModal" @close="loadData"></sy-cotton-yarn-detail-modal>
  100. </a-card>
  101. </template>
  102. <script>
  103. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  104. import SyCottonYarnModal from './modules/SyCottonYarnModal'
  105. import SyCottonYarnDetailModal from './modules/SyCottonYarnDetailModal'
  106. import { getAction } from '@/api/manage'
  107. import moment from 'moment'
  108. export default {
  109. name: "SyCottonYarnList",
  110. mixins: [JeecgListMixin],
  111. components: {
  112. SyCottonYarnModal,
  113. SyCottonYarnDetailModal,
  114. moment
  115. },
  116. data () {
  117. return {
  118. description: '搬运装卸费用-棉纱-主表管理页面',
  119. // 表头
  120. columns: [
  121. {
  122. title: '#',
  123. dataIndex: '',
  124. key: 'rowIndex',
  125. width: 60,
  126. align: "center",
  127. customRender:function (t, r, index) {
  128. return parseInt(index)+1;
  129. }
  130. },
  131. {
  132. title: '名称',
  133. align:"center",
  134. dataIndex: 'name'
  135. },
  136. {
  137. title: '编号',
  138. align:"center",
  139. dataIndex: 'code'
  140. },
  141. {
  142. title: '状态',
  143. align:"center",
  144. dataIndex: 'state',
  145. scopedSlots: { customRender: 'state' },
  146. },
  147. {
  148. title: '备注',
  149. align:"center",
  150. dataIndex: 'demo'
  151. },
  152. {
  153. title: '操作',
  154. dataIndex: 'action',
  155. align:"center",
  156. scopedSlots: { customRender: 'action' },
  157. }
  158. ],
  159. // 请求参数
  160. url: {
  161. list: "/oa/syCottonYarn/list",
  162. delete: "/oa/syCottonYarn/delete",
  163. deleteBatch: "/oa/syCottonYarn/deleteBatch",
  164. exportXlsUrl: "oa/syCottonYarn/exportXls",
  165. importExcelUrl: "oa/syCottonYarn/importExcel",
  166. editListUrl: '/oa/syCottonYarn/querySyCottonYarnBByMainId'
  167. },
  168. }
  169. },
  170. computed: {
  171. importExcelUrl: function(){
  172. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  173. }
  174. },
  175. methods: {
  176. // 计划员提交
  177. plannerSubmit(record,state){
  178. getAction('/oa/syCottonYarn/commitBatch', {ids:record.id,state:state}).then((res) => {
  179. if(res.success){
  180. this.loadData()
  181. }else{
  182. this.$message.warning(res.message)
  183. }
  184. })
  185. },
  186. searchQuery(){
  187. this.loadData()
  188. },
  189. searchReset(){
  190. this.queryParam={}
  191. this.loadData()
  192. },
  193. handleEdit(record,data){
  194. if(data == '0'){
  195. this.$refs.modalForm.visible = true
  196. this.$refs.modalForm.defultMethods = 'edit'
  197. this.$refs.modalForm.getHeaderList(record.id)
  198. }else{
  199. this.$refs.syCottonYarnDetailModal.visible = true
  200. this.$refs.syCottonYarnDetailModal.getHeaderList(record.id)
  201. }
  202. },
  203. initDictConfig() {
  204. }
  205. }
  206. }
  207. </script>
  208. <style scoped>
  209. @import '~@assets/less/common.less'
  210. </style>