engin_list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  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="120" show-overflow-tooltip>
  91. <template slot-scope="scope">
  92. <div>
  93. <span>{{scope.row.orderDate | dateToDayFilter}}</span>
  94. <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" v-if="$checkBtnRole('date', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT')" ></el-button>
  95. </div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column align="center" label="经销商编码" prop="customerId" min-width="120" show-overflow-tooltip></el-table-column>
  99. <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
  100. <el-table-column align="center" label="工程名称" prop="projectName" min-width="160" show-overflow-tooltip></el-table-column>
  101. <el-table-column align="center" label="使用单位" prop="useUnit" min-width="160" show-overflow-tooltip></el-table-column>
  102. <el-table-column align="center" label="安装地址" prop="installAddress" min-width="160" show-overflow-tooltip></el-table-column>
  103. <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
  104. <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
  105. <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  106. <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
  107. <el-table-column align="center" label="金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
  108. <el-table-column align="center" label="制表人" prop="createName" min-width="100" show-overflow-tooltip></el-table-column>
  109. <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  110. <el-table-column align="center" label="审核人" prop="confirmName" min-width="100" show-overflow-tooltip></el-table-column>
  111. <el-table-column align="center" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip></el-table-column>
  112. <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  113. <template slot-scope="scope">
  114. {{scope.row.examineStatus | statusFilter}}
  115. </template>
  116. </el-table-column>
  117. <el-table-column align="center" label="操作" width="180" fixed="right">
  118. <template slot-scope="scope">
  119. <el-popconfirm
  120. style="margin-right: 10px;"
  121. title="确定申请吗?"
  122. @onConfirm="handleSubmit(scope.row.enginInfoId)"
  123. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
  124. <el-button slot="reference" type="text">申请</el-button>
  125. </el-popconfirm>
  126. <el-popconfirm
  127. style="margin-right: 10px;"
  128. title="确定撤回吗?"
  129. @onConfirm="handleWithdraw(scope.row.enginInfoId)"
  130. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
  131. <el-button slot="reference" type="text">撤回</el-button>
  132. </el-popconfirm>
  133. <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
  134. <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
  135. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  136. <el-popconfirm
  137. style="margin-left: 10px;"
  138. title="确定删除吗?"
  139. @onConfirm="handleDelete(scope.row.enginInfoId)"
  140. v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'">
  141. <el-button slot="reference" type="text">删除</el-button>
  142. </el-popconfirm>
  143. </template>
  144. </el-table-column>
  145. </el-table>
  146. </div>
  147. </div>
  148. <div class="pagination clearfix">
  149. <div class="fr">
  150. <el-pagination
  151. @size-change="handleSizeChange"
  152. @current-change="handleCurrentChange"
  153. :current-page="currentPage"
  154. :page-sizes="[10, 20, 30, 50]"
  155. :page-size="10"
  156. layout="total, sizes, prev, pager, next, jumper"
  157. :total="listTotal">
  158. </el-pagination>
  159. </div>
  160. </div>
  161. </div>
  162. <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
  163. <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  164. <EnginForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  165. <EnginExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  166. </div>
  167. </template>
  168. <script>
  169. import { getEnginList, applyEngin, withdrawEngin, deleteEngin, editDateEngin } from "@/api/supply/engin";
  170. import EnginDetail from "@/views/supply/engin/components/engin_detail";
  171. import EnginForm from "@/views/supply/engin/components/engin_form";
  172. import EnginExamine from "@/views/supply/engin/components/engin_examine";
  173. import EditDateDialog from "@/components/Common/edit-date-dialog";
  174. let that
  175. export default {
  176. components: {
  177. EnginDetail,
  178. EnginForm,
  179. EnginExamine,
  180. EditDateDialog,
  181. },
  182. filters: {
  183. statusFilter(val) {
  184. let obj = that.statusList.find(o => o.value == val);
  185. return obj ? obj.label : ''
  186. }
  187. },
  188. data() {
  189. return {
  190. currentPage: 1, // 当前页码
  191. pageSize: 10, // 每页数量
  192. listTotal: 0, // 列表总数
  193. dataList: null, // 列表数据
  194. listLoading: false, // 列表加载loading
  195. screenForm: { // 筛选表单数据
  196. orderNum: '',
  197. enginNum: '',
  198. loginNum: '',
  199. enginName: '',
  200. date: '',
  201. dealer: '',
  202. company: '',
  203. createMan: '',
  204. examineMan: '',
  205. status: '',
  206. },
  207. statusList: [
  208. { label: '已保存', value: 'SAVE' },
  209. { label: '待审核', value: 'WAIT' },
  210. { label: '审核通过', value: 'OK' },
  211. { label: '审核驳回', value: 'FAIL' },
  212. { label: '已关闭', value: 'CLOSE' },
  213. ],
  214. queryItem: {},
  215. isShowDetail: false,
  216. isShowForm: false,
  217. isShowExamine: false,
  218. editId: null,
  219. isShowEditDateDialog: false,
  220. dateForm: {
  221. date: '',
  222. },
  223. }
  224. },
  225. computed: {
  226. exParams() {
  227. return {
  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. },
  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. enginInfoNo: this.screenForm.orderNum,
  256. projectNo: this.screenForm.enginNum,
  257. enginSignType: this.screenForm.loginNum,
  258. projectName: this.screenForm.enginName,
  259. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  260. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  261. customerKeyWord: this.screenForm.dealer,
  262. useUnit: this.screenForm.company,
  263. createName: this.screenForm.createMan,
  264. confirmName: this.screenForm.examineMan,
  265. status: this.screenForm.status,
  266. };
  267. getEnginList(params).then((res) => {
  268. this.dataList = res.data.records;
  269. this.listTotal = res.data.total;
  270. this.listLoading = false;
  271. })
  272. },
  273. // 提交筛选表单
  274. submitScreenForm() {
  275. this.currentPage = 1;
  276. this.getList();
  277. },
  278. // 重置筛选表单
  279. resetScreenForm() {
  280. this.$refs.screenForm.resetFields();
  281. this.currentPage = 1;
  282. this.getList();
  283. },
  284. // 更改每页数量
  285. handleSizeChange(val) {
  286. this.pageSize = val;
  287. this.currentPage = 1;
  288. this.getList();
  289. },
  290. // 更改当前页
  291. handleCurrentChange(val) {
  292. this.currentPage = val;
  293. this.getList();
  294. },
  295. // 进入表单
  296. toForm(item) {
  297. this.queryItem = item;
  298. this.isShowForm = true;
  299. },
  300. // 进入审批
  301. toExamine(item) {
  302. this.queryItem = item;
  303. this.isShowExamine = true;
  304. },
  305. // 进入详情
  306. toDetail(item) {
  307. this.queryItem = item;
  308. this.isShowDetail = true;
  309. },
  310. backList() {
  311. this.queryItem = {};
  312. this.isShowDetail = false;
  313. this.isShowForm = false;
  314. this.isShowExamine = false;
  315. },
  316. // 申请
  317. handleSubmit(id) {
  318. applyEngin({id}).then(res => {
  319. this.$successMsg();
  320. this.getList();
  321. })
  322. },
  323. // 撤回
  324. handleWithdraw(id) {
  325. withdrawEngin({id}).then(res => {
  326. this.$successMsg();
  327. this.getList();
  328. })
  329. },
  330. // 删除
  331. handleDelete(id) {
  332. deleteEngin({ids: id}).then(res => {
  333. this.$successMsg();
  334. this.getList();
  335. })
  336. },
  337. // 打开 修改订单日期
  338. editDate(item) {
  339. this.editId = item.enginInfoId;
  340. this.dateForm.date = item.orderDate.slice(0, 10);
  341. this.isShowEditDateDialog = true;
  342. },
  343. // 提交 修改订单日期
  344. submitDateForm() {
  345. editDateEngin({
  346. enginInfoId: this.editId,
  347. orderDate: this.dateForm.date + ' 00:00:00',
  348. }).then(res => {
  349. this.isShowEditDateDialog = false;
  350. this.getList();
  351. this.$successMsg('修改成功');
  352. })
  353. },
  354. }
  355. }
  356. </script>
  357. <style lang="scss" scoped>
  358. </style>