engin_list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
  82. </div>
  83. <div class="fr">
  84. <ExportButton :exUrl="'engin-info-order/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="useUnit" min-width="160" show-overflow-tooltip></el-table-column>
  95. <el-table-column align="center" label="安装地址" prop="installAddress" min-width="160" show-overflow-tooltip></el-table-column>
  96. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  97. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  98. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  99. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  100. <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
  101. <el-table-column align="center" label="制表人" prop="createName" min-width="100" show-overflow-tooltip></el-table-column>
  102. <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  103. <el-table-column align="center" label="审核人" prop="confirmName" min-width="100" show-overflow-tooltip></el-table-column>
  104. <el-table-column align="center" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip></el-table-column>
  105. <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  106. <template slot-scope="scope">
  107. {{scope.row.examineStatus | statusFilter}}
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="center" label="操作" width="180" fixed="right">
  111. <template slot-scope="scope">
  112. <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.enginInfoId)" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
  113. <el-button slot="reference" type="text">申请</el-button>
  114. </el-popconfirm>
  115. <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.enginInfoId)" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
  116. <el-button slot="reference" type="text">撤回</el-button>
  117. </el-popconfirm>
  118. <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
  119. <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
  120. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  121. <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.enginInfoId)" v-if="$checkBtnRole('del', $route.meta.roles)">
  122. <el-button slot="reference" type="text">删除</el-button>
  123. </el-popconfirm>
  124. </template>
  125. </el-table-column>
  126. </el-table>
  127. </div>
  128. </div>
  129. <div class="pagination clearfix">
  130. <div class="fr">
  131. <el-pagination
  132. @size-change="handleSizeChange"
  133. @current-change="handleCurrentChange"
  134. :current-page="currentPage"
  135. :page-sizes="[10, 20, 30, 50]"
  136. :page-size="10"
  137. layout="total, sizes, prev, pager, next, jumper"
  138. :total="listTotal">
  139. </el-pagination>
  140. </div>
  141. </div>
  142. </div>
  143. <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  144. <EnginForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  145. <EnginExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  146. </div>
  147. </template>
  148. <script>
  149. import { getEnginList, applyEngin, withdrawEngin, deleteEngin } from "@/api/supply/engin";
  150. import EnginDetail from "@/views/supply/engin/components/engin_detail";
  151. import EnginForm from "@/views/supply/engin/components/engin_form";
  152. import EnginExamine from "@/views/supply/engin/components/engin_examine";
  153. let that
  154. export default {
  155. components: {
  156. EnginDetail,
  157. EnginForm,
  158. EnginExamine,
  159. },
  160. filters: {
  161. statusFilter(val) {
  162. let obj = that.statusList.find(o => o.value == val);
  163. return obj ? obj.label : ''
  164. }
  165. },
  166. data() {
  167. return {
  168. currentPage: 1, // 当前页码
  169. pageSize: 10, // 每页数量
  170. listTotal: 0, // 列表总数
  171. dataList: null, // 列表数据
  172. listLoading: false, // 列表加载loading
  173. screenForm: { // 筛选表单数据
  174. orderNum: '',
  175. enginNum: '',
  176. loginNum: '',
  177. enginName: '',
  178. date: '',
  179. dealer: '',
  180. company: '',
  181. createMan: '',
  182. examineMan: '',
  183. status: '',
  184. },
  185. statusList: [
  186. { label: '已保存', value: 'SAVE' },
  187. { label: '待审核', value: 'WAIT' },
  188. { label: '审核通过', value: 'OK' },
  189. { label: '审核驳回', value: 'FAIL' },
  190. { label: '已关闭', value: 'CLOSE' },
  191. ],
  192. queryItem: {},
  193. isShowDetail: false,
  194. isShowForm: false,
  195. isShowExamine: false,
  196. }
  197. },
  198. computed: {
  199. exParams() {
  200. return {
  201. enginInfoNo: this.screenForm.orderNum,
  202. projectNo: this.screenForm.enginNum,
  203. enginSignType: this.screenForm.loginNum,
  204. projectName: this.screenForm.enginName,
  205. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  206. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  207. customerKeyWord: this.screenForm.dealer,
  208. useUnit: this.screenForm.company,
  209. createName: this.screenForm.createMan,
  210. confirmName: this.screenForm.examineMan,
  211. status: this.screenForm.status,
  212. }
  213. },
  214. },
  215. beforeCreate() {
  216. that = this;
  217. },
  218. created() {
  219. this.getList();
  220. },
  221. methods: {
  222. // 查询列表
  223. getList() {
  224. this.listLoading = true;
  225. let params = {
  226. pageNum: this.currentPage,
  227. pageSize: this.pageSize,
  228. enginInfoNo: this.screenForm.orderNum,
  229. projectNo: this.screenForm.enginNum,
  230. enginSignType: this.screenForm.loginNum,
  231. projectName: this.screenForm.enginName,
  232. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  233. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  234. customerKeyWord: this.screenForm.dealer,
  235. useUnit: this.screenForm.company,
  236. createName: this.screenForm.createMan,
  237. confirmName: this.screenForm.examineMan,
  238. status: this.screenForm.status,
  239. };
  240. getEnginList(params).then((res) => {
  241. this.dataList = res.data.records;
  242. this.listTotal = res.data.total;
  243. this.listLoading = false;
  244. })
  245. },
  246. // 提交筛选表单
  247. submitScreenForm() {
  248. this.currentPage = 1;
  249. this.getList();
  250. },
  251. // 重置筛选表单
  252. resetScreenForm() {
  253. this.$refs.screenForm.resetFields();
  254. this.currentPage = 1;
  255. this.getList();
  256. },
  257. // 更改每页数量
  258. handleSizeChange(val) {
  259. this.pageSize = val;
  260. this.currentPage = 1;
  261. this.getList();
  262. },
  263. // 更改当前页
  264. handleCurrentChange(val) {
  265. this.currentPage = val;
  266. this.getList();
  267. },
  268. // 进入表单
  269. toForm(item) {
  270. this.queryItem = item;
  271. this.isShowForm = true;
  272. },
  273. // 进入审批
  274. toExamine(item) {
  275. this.queryItem = item;
  276. this.isShowExamine = true;
  277. },
  278. // 进入详情
  279. toDetail(item) {
  280. this.queryItem = item;
  281. this.isShowDetail = true;
  282. },
  283. backList() {
  284. this.queryItem = {};
  285. this.isShowDetail = false;
  286. this.isShowForm = false;
  287. this.isShowExamine = false;
  288. },
  289. // 申请
  290. handleSubmit(id) {
  291. applyEngin({id}).then(res => {
  292. this.$successMsg();
  293. this.getList();
  294. })
  295. },
  296. // 撤回
  297. handleWithdraw(id) {
  298. withdrawEngin({id}).then(res => {
  299. this.$successMsg();
  300. this.getList();
  301. })
  302. },
  303. // 删除
  304. handleDelete(id) {
  305. deleteEngin({ids: id}).then(res => {
  306. this.$successMsg();
  307. this.getList();
  308. })
  309. }
  310. }
  311. }
  312. </script>
  313. <style lang="scss" scoped>
  314. </style>