engin_list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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="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 style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.enginInfoId)" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
  120. <el-button slot="reference" type="text">申请</el-button>
  121. </el-popconfirm>
  122. <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.enginInfoId)" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
  123. <el-button slot="reference" type="text">撤回</el-button>
  124. </el-popconfirm>
  125. <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
  126. <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
  127. <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
  128. <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.enginInfoId)" v-if="$checkBtnRole('del', $route.meta.roles)">
  129. <el-button slot="reference" type="text">删除</el-button>
  130. </el-popconfirm>
  131. </template>
  132. </el-table-column>
  133. </el-table>
  134. </div>
  135. </div>
  136. <div class="pagination clearfix">
  137. <div class="fr">
  138. <el-pagination
  139. @size-change="handleSizeChange"
  140. @current-change="handleCurrentChange"
  141. :current-page="currentPage"
  142. :page-sizes="[10, 20, 30, 50]"
  143. :page-size="10"
  144. layout="total, sizes, prev, pager, next, jumper"
  145. :total="listTotal">
  146. </el-pagination>
  147. </div>
  148. </div>
  149. </div>
  150. <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
  151. <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  152. <EnginForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  153. <EnginExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  154. </div>
  155. </template>
  156. <script>
  157. import { getEnginList, applyEngin, withdrawEngin, deleteEngin, editDateEngin } from "@/api/supply/engin";
  158. import EnginDetail from "@/views/supply/engin/components/engin_detail";
  159. import EnginForm from "@/views/supply/engin/components/engin_form";
  160. import EnginExamine from "@/views/supply/engin/components/engin_examine";
  161. import EditDateDialog from "@/components/Common/edit-date-dialog";
  162. let that
  163. export default {
  164. components: {
  165. EnginDetail,
  166. EnginForm,
  167. EnginExamine,
  168. EditDateDialog,
  169. },
  170. filters: {
  171. statusFilter(val) {
  172. let obj = that.statusList.find(o => o.value == val);
  173. return obj ? obj.label : ''
  174. }
  175. },
  176. data() {
  177. return {
  178. currentPage: 1, // 当前页码
  179. pageSize: 10, // 每页数量
  180. listTotal: 0, // 列表总数
  181. dataList: null, // 列表数据
  182. listLoading: false, // 列表加载loading
  183. screenForm: { // 筛选表单数据
  184. orderNum: '',
  185. enginNum: '',
  186. loginNum: '',
  187. enginName: '',
  188. date: '',
  189. dealer: '',
  190. company: '',
  191. createMan: '',
  192. examineMan: '',
  193. status: '',
  194. },
  195. statusList: [
  196. { label: '已保存', value: 'SAVE' },
  197. { label: '待审核', value: 'WAIT' },
  198. { label: '审核通过', value: 'OK' },
  199. { label: '审核驳回', value: 'FAIL' },
  200. { label: '已关闭', value: 'CLOSE' },
  201. ],
  202. queryItem: {},
  203. isShowDetail: false,
  204. isShowForm: false,
  205. isShowExamine: false,
  206. editId: null,
  207. isShowEditDateDialog: false,
  208. dateForm: {
  209. date: '',
  210. },
  211. }
  212. },
  213. computed: {
  214. exParams() {
  215. return {
  216. enginInfoNo: this.screenForm.orderNum,
  217. projectNo: this.screenForm.enginNum,
  218. enginSignType: this.screenForm.loginNum,
  219. projectName: this.screenForm.enginName,
  220. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  221. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  222. customerKeyWord: this.screenForm.dealer,
  223. useUnit: this.screenForm.company,
  224. createName: this.screenForm.createMan,
  225. confirmName: this.screenForm.examineMan,
  226. status: this.screenForm.status,
  227. }
  228. },
  229. },
  230. beforeCreate() {
  231. that = this;
  232. },
  233. created() {
  234. this.getList();
  235. },
  236. methods: {
  237. // 查询列表
  238. getList() {
  239. this.listLoading = true;
  240. let params = {
  241. pageNum: this.currentPage,
  242. pageSize: this.pageSize,
  243. enginInfoNo: this.screenForm.orderNum,
  244. projectNo: this.screenForm.enginNum,
  245. enginSignType: this.screenForm.loginNum,
  246. projectName: this.screenForm.enginName,
  247. startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
  248. endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
  249. customerKeyWord: this.screenForm.dealer,
  250. useUnit: this.screenForm.company,
  251. createName: this.screenForm.createMan,
  252. confirmName: this.screenForm.examineMan,
  253. status: this.screenForm.status,
  254. };
  255. getEnginList(params).then((res) => {
  256. this.dataList = res.data.records;
  257. this.listTotal = res.data.total;
  258. this.listLoading = false;
  259. })
  260. },
  261. // 提交筛选表单
  262. submitScreenForm() {
  263. this.currentPage = 1;
  264. this.getList();
  265. },
  266. // 重置筛选表单
  267. resetScreenForm() {
  268. this.$refs.screenForm.resetFields();
  269. this.currentPage = 1;
  270. this.getList();
  271. },
  272. // 更改每页数量
  273. handleSizeChange(val) {
  274. this.pageSize = val;
  275. this.currentPage = 1;
  276. this.getList();
  277. },
  278. // 更改当前页
  279. handleCurrentChange(val) {
  280. this.currentPage = val;
  281. this.getList();
  282. },
  283. // 进入表单
  284. toForm(item) {
  285. this.queryItem = item;
  286. this.isShowForm = true;
  287. },
  288. // 进入审批
  289. toExamine(item) {
  290. this.queryItem = item;
  291. this.isShowExamine = true;
  292. },
  293. // 进入详情
  294. toDetail(item) {
  295. this.queryItem = item;
  296. this.isShowDetail = true;
  297. },
  298. backList() {
  299. this.queryItem = {};
  300. this.isShowDetail = false;
  301. this.isShowForm = false;
  302. this.isShowExamine = false;
  303. },
  304. // 申请
  305. handleSubmit(id) {
  306. applyEngin({id}).then(res => {
  307. this.$successMsg();
  308. this.getList();
  309. })
  310. },
  311. // 撤回
  312. handleWithdraw(id) {
  313. withdrawEngin({id}).then(res => {
  314. this.$successMsg();
  315. this.getList();
  316. })
  317. },
  318. // 删除
  319. handleDelete(id) {
  320. deleteEngin({ids: id}).then(res => {
  321. this.$successMsg();
  322. this.getList();
  323. })
  324. },
  325. // 打开 修改订单日期
  326. editDate(item) {
  327. this.editId = item.enginInfoId;
  328. this.dateForm.date = item.orderDate.slice(0, 10);
  329. this.isShowEditDateDialog = true;
  330. },
  331. // 提交 修改订单日期
  332. submitDateForm() {
  333. editDateEngin({
  334. enginInfoId: this.editId,
  335. orderDate: this.dateForm.date + ' 00:00:00',
  336. }).then(res => {
  337. this.isShowEditDateDialog = false;
  338. this.getList();
  339. this.$successMsg('修改成功');
  340. })
  341. },
  342. }
  343. }
  344. </script>
  345. <style lang="scss" scoped>
  346. </style>