engin_list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowForm && !isShowExamine">
  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="dealer">
  51. <el-input v-model="screenForm.dealer" 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="company">
  56. <el-input v-model="screenForm.company" 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="createMan">
  61. <el-input v-model="screenForm.createMan" placeholder="请输入制表人"></el-input>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :xs="24" :sm="12" :lg="6">
  65. <el-form-item label="审核人" prop="examineMan">
  66. <el-input v-model="screenForm.examineMan" placeholder="请输入审核人"></el-input>
  67. </el-form-item>
  68. </el-col>
  69. <el-col :xs="24" :sm="12" :lg="18" class="tr">
  70. <el-form-item label="">
  71. <el-button size="small" @click="resetScreenForm">清空</el-button>
  72. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  73. </el-form-item>
  74. </el-col>
  75. </el-row>
  76. </el-form>
  77. </div>
  78. <div class="mymain-container">
  79. <div class="btn-group clearfix">
  80. <div class="fl">
  81. <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
  82. </div>
  83. <div class="fr">
  84. <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
  85. </div>
  86. </div>
  87. <div class="table">
  88. <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  89. <el-table-column align="center" label="工程信息单" prop="enginInfoNo" min-width="200" show-overflow-tooltip></el-table-column>
  90. <el-table-column align="center" label="单据日期" prop="orderDate" min-width="160" show-overflow-tooltip></el-table-column>
  91. <el-table-column align="center" label="经销商编码" prop="customerId" min-width="120" show-overflow-tooltip></el-table-column>
  92. <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  93. <el-table-column align="center" label="工程名称" prop="projectName" min-width="160" show-overflow-tooltip></el-table-column>
  94. <el-table-column align="center" label="安装地址" prop="installAddress" min-width="160" show-overflow-tooltip></el-table-column>
  95. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  96. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  97. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  98. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  99. <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
  100. <el-table-column align="center" label="制表人" prop="createName" min-width="100" show-overflow-tooltip></el-table-column>
  101. <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  102. <el-table-column align="center" label="审核人" prop="confirmName" min-width="100" show-overflow-tooltip></el-table-column>
  103. <el-table-column align="center" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip></el-table-column>
  104. <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  105. <template slot-scope="scope">
  106. {{scope.row.examineStatus | statusFilter}}
  107. </template>
  108. </el-table-column>
  109. <el-table-column align="center" label="操作" width="180" fixed="right">
  110. <template slot-scope="scope">
  111. <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.enginInfoId)" v-if="scope.row.examineStatus === 'SAVE'" >
  112. <el-button slot="reference" type="text">申请</el-button>
  113. </el-popconfirm>
  114. <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.enginInfoId)" v-if="scope.row.examineStatus === 'WAIT'" >
  115. <el-button slot="reference" type="text">撤回</el-button>
  116. </el-popconfirm>
  117. <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
  118. <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审批</el-button>
  119. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  120. <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.enginInfoId)" >
  121. <el-button slot="reference" type="text">删除</el-button>
  122. </el-popconfirm>
  123. </template>
  124. </el-table-column>
  125. </el-table>
  126. </div>
  127. </div>
  128. <div class="pagination clearfix">
  129. <div class="fr">
  130. <el-pagination
  131. @size-change="handleSizeChange"
  132. @current-change="handleCurrentChange"
  133. :current-page="currentPage"
  134. :page-sizes="[10, 20, 30, 50]"
  135. :page-size="10"
  136. layout="total, sizes, prev, pager, next, jumper"
  137. :total="listTotal">
  138. </el-pagination>
  139. </div>
  140. </div>
  141. </div>
  142. <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  143. <EnginForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  144. <EnginExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  145. </div>
  146. </template>
  147. <script>
  148. import { getEnginList, applyEngin, withdrawEngin, deleteEngin } from "@/api/supply/engin";
  149. import EnginDetail from "@/views/supply/engin/components/engin_detail";
  150. import EnginForm from "@/views/supply/engin/components/engin_form";
  151. import EnginExamine from "@/views/supply/engin/components/engin_examine";
  152. let that
  153. export default {
  154. components: {
  155. EnginDetail,
  156. EnginForm,
  157. EnginExamine,
  158. },
  159. filters: {
  160. statusFilter(val) {
  161. let obj = that.statusList.find(o => o.value == val);
  162. return obj ? obj.label : ''
  163. }
  164. },
  165. data() {
  166. return {
  167. currentPage: 1, // 当前页码
  168. pageSize: 10, // 每页数量
  169. listTotal: 0, // 列表总数
  170. dataList: null, // 列表数据
  171. listLoading: false, // 列表加载loading
  172. screenForm: { // 筛选表单数据
  173. orderNum: '',
  174. enginNum: '',
  175. loginNum: '',
  176. enginName: '',
  177. date: '',
  178. dealer: '',
  179. company: '',
  180. createMan: '',
  181. examineMan: '',
  182. status: '',
  183. },
  184. statusList: [
  185. { label: '已保存', value: 'SAVE' },
  186. { label: '待审核', value: 'WAIT' },
  187. { label: '审核通过', value: 'OK' },
  188. { label: '审核驳回', value: 'FAIL' },
  189. { label: '已关闭', value: 'CLOSE' },
  190. ],
  191. queryItem: {},
  192. isShowDetail: false,
  193. isShowForm: false,
  194. isShowExamine: false,
  195. }
  196. },
  197. computed: {
  198. exParams() {
  199. return {
  200. enginInfoNo: this.screenForm.orderNum,
  201. projectNo: this.screenForm.enginNum,
  202. enginSignType: this.screenForm.loginNum,
  203. projectName: this.screenForm.enginName,
  204. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  205. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  206. customerKeyWord: this.screenForm.dealer,
  207. useUnit: this.screenForm.company,
  208. createName: this.screenForm.createMan,
  209. confirmName: this.screenForm.examineMan,
  210. status: this.screenForm.status,
  211. }
  212. },
  213. },
  214. beforeCreate() {
  215. that = this;
  216. },
  217. created() {
  218. this.getList();
  219. },
  220. methods: {
  221. // 查询按钮权限
  222. checkBtnRole(value) {
  223. // let btnRole = this.$route.meta.roles;
  224. // if(!btnRole) {return true}
  225. // let index = btnRole.indexOf(value);
  226. // return index >= 0;
  227. return true
  228. },
  229. // 查询列表
  230. getList() {
  231. this.listLoading = true;
  232. let params = {
  233. pageNum: this.currentPage,
  234. pageSize: this.pageSize,
  235. enginInfoNo: this.screenForm.orderNum,
  236. projectNo: this.screenForm.enginNum,
  237. enginSignType: this.screenForm.loginNum,
  238. projectName: this.screenForm.enginName,
  239. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  240. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  241. customerKeyWord: this.screenForm.dealer,
  242. useUnit: this.screenForm.company,
  243. createName: this.screenForm.createMan,
  244. confirmName: this.screenForm.examineMan,
  245. status: this.screenForm.status,
  246. };
  247. getEnginList(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.isShowForm = false;
  294. this.isShowExamine = false;
  295. },
  296. // 申请
  297. handleSubmit(id) {
  298. applyEngin({id}).then(res => {
  299. this.$successMsg();
  300. this.getList();
  301. })
  302. },
  303. // 撤回
  304. handleWithdraw(id) {
  305. withdrawEngin({id}).then(res => {
  306. this.$successMsg();
  307. this.getList();
  308. })
  309. },
  310. // 删除
  311. handleDelete(id) {
  312. deleteEngin({ids: id}).then(res => {
  313. this.$successMsg();
  314. this.getList();
  315. })
  316. }
  317. }
  318. }
  319. </script>
  320. <style lang="scss" scoped>
  321. </style>