engin_list.vue 15 KB

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