commerce_list.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowForm && !isShowExamine && !isShowReturn">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form ref="screenForm" :model="screenForm" label-width="100px" size="mini" 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-checkbox-group v-model="screenForm.status" @change="getList()">
  11. <el-checkbox-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-checkbox-button>
  12. </el-checkbox-group>
  13. </el-form-item>
  14. </el-col>
  15. <el-col :xs="24" :sm="12" :lg="6">
  16. <el-form-item label="工程订单号" prop="orderNum">
  17. <el-input v-model="screenForm.orderNum" placeholder="请输入工程订单号"></el-input>
  18. </el-form-item>
  19. </el-col>
  20. <el-col :xs="24" :sm="12" :lg="6">
  21. <el-form-item label="工程编号" prop="enginNum">
  22. <el-input v-model="screenForm.enginNum" placeholder="请输入工程编号"></el-input>
  23. </el-form-item>
  24. </el-col>
  25. <el-col :xs="24" :sm="12" :lg="6">
  26. <el-form-item label="工程信息单号" prop="loginNum">
  27. <el-input v-model="screenForm.loginNum" placeholder="请输入工程信息单号"></el-input>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :xs="24" :sm="12" :lg="6">
  31. <el-form-item label="项目名称" prop="enginName">
  32. <el-input v-model="screenForm.enginName" placeholder="请输入项目名称"></el-input>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :xs="24" :sm="12" :lg="6">
  36. <el-form-item label="单据日期" prop="date">
  37. <el-date-picker
  38. v-model="screenForm.date"
  39. type="datetimerange"
  40. range-separator="至"
  41. style="width: 100%;"
  42. value-format="yyyy-MM-dd HH:mm:ss"
  43. start-placeholder="开始日期"
  44. end-placeholder="结束日期">
  45. </el-date-picker>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :xs="24" :sm="12" :lg="6">
  49. <el-form-item label="销售类型" prop="saleType">
  50. <el-select v-model="screenForm.saleType" placeholder="选择销售类型" style="width: 100%" clearable>
  51. <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
  52. </el-select>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :xs="24" :sm="12" :lg="6">
  56. <el-form-item label="经销商" prop="dealer">
  57. <el-input v-model="screenForm.dealer" placeholder="请输入经销商"></el-input>
  58. </el-form-item>
  59. </el-col>
  60. <el-col :xs="24" :sm="12" :lg="6">
  61. <el-form-item label="制表人" prop="createMan">
  62. <el-input v-model="screenForm.createMan" placeholder="请输入制表人"></el-input>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :xs="24" :sm="12" :lg="6">
  66. <el-form-item label="审核人" prop="examineMan">
  67. <el-input v-model="screenForm.examineMan" placeholder="请输入审核人"></el-input>
  68. </el-form-item>
  69. </el-col>
  70. <el-col :xs="24" :sm="12" :lg="6">
  71. <el-form-item label="表头业务员" prop="salesMan">
  72. <el-select v-model="screenForm.salesMan" placeholder="选择表头业务员" clearable filterable style="width: 100%">
  73. <el-option
  74. v-for="item in salesmanList"
  75. :key="item.adminUserId"
  76. :label="item.nickName"
  77. :value="item.adminUserId">
  78. </el-option>
  79. </el-select>
  80. </el-form-item>
  81. </el-col>
  82. <el-col :xs="24" :sm="12" :lg="6">
  83. <el-form-item label="规格型号" prop="model">
  84. <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :xs="24" :sm="12" :lg="6">
  88. <el-form-item label="是否直调" prop="isDirectTransfer">
  89. <el-select v-model="screenForm.isDirectTransfer" placeholder="选择是否直" style="width: 100%">
  90. <el-option :value="null" label="默认"></el-option>
  91. <el-option
  92. v-for="item in transfer"
  93. :key="item.value"
  94. :label="item.label"
  95. :value="item.value">
  96. </el-option>
  97. </el-select>
  98. </el-form-item>
  99. </el-col>
  100. <el-col :xs="24" :sm="12" :lg="24" class="tr">
  101. <el-form-item label="">
  102. <el-button @click="resetScreenForm">清空</el-button>
  103. <el-button type="primary" @click="submitScreenForm">搜索</el-button>
  104. </el-form-item>
  105. </el-col>
  106. </el-row>
  107. </el-form>
  108. </div>
  109. <div class="mymain-container">
  110. <div class="btn-group clearfix">
  111. <div class="fl">
  112. <el-button size="mini" type="primary" icon="el-icon-plus" @click="toForm()" v-if="$checkBtnRole('add', $route.meta.roles)">新增</el-button>
  113. <el-button size="mini" type="danger" icon="el-icon-minus" :disabled="multipleSelection.length < 1" @click="batchDelete()" v-if="$checkBtnRole('del', $route.meta.roles)">批量删除</el-button>
  114. </div>
  115. <div class="fr">
  116. <ExportButton :exUrl="'engin-order/export'" :exParams="exParams" />
  117. </div>
  118. </div>
  119. <div class="table">
  120. <el-table
  121. v-loading="listLoading"
  122. :data="dataList"
  123. element-loading-text="Loading"
  124. border
  125. fit
  126. highlight-current-row
  127. stripe
  128. @selection-change="handleSelectionChange"
  129. show-summary
  130. :summary-method="$getSummaries">
  131. <el-table-column align="center" type="selection" width="55"></el-table-column>
  132. <el-table-column align="left" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
  133. <template slot-scope="scope">
  134. {{scope.row.examineStatus | statusFilter}}
  135. </template>
  136. </el-table-column>
  137. <el-table-column align="left" label="工程订单号" prop="enginOrderNo" min-width="140" show-overflow-tooltip>
  138. <template slot-scope="scope">
  139. <CopyButton :copyText="scope.row.enginOrderNo" />
  140. <span>{{scope.row.enginOrderNo}}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column align="left" label="订单日期" prop="orderDate" min-width="120" show-overflow-tooltip>
  144. <template slot-scope="scope">
  145. <div>
  146. <span>{{scope.row.orderDate | dateToDayFilter}}</span>
  147. <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>
  148. </div>
  149. </template>
  150. </el-table-column>
  151. <el-table-column align="left" label="工程编号" prop="refProjectNo" min-width="160" show-overflow-tooltip></el-table-column>
  152. <el-table-column align="left" label="工程登录编号" prop="refEnginRecordNo" min-width="200" show-overflow-tooltip>
  153. <template slot-scope="scope">
  154. <CopyButton :copyText="scope.row.refEnginRecordNo" />
  155. <span>{{scope.row.refEnginRecordNo}}</span>
  156. </template>
  157. </el-table-column>
  158. <el-table-column align="left" label="订单类型" prop="enginOrderType" min-width="100" show-overflow-tooltip>
  159. <template slot-scope="scope">
  160. {{scope.row.enginOrderType | typeFilter}}
  161. </template>
  162. </el-table-column>
  163. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  164. <template slot-scope="scope">
  165. <CopyButton :copyText="scope.row.customerName" />
  166. <span>{{ scope.row.customerName }}</span>
  167. </template>
  168. </el-table-column>
  169. <el-table-column align="left" label="使用单位" prop="refUseUnit" min-width="160" show-overflow-tooltip></el-table-column>
  170. <el-table-column align="left" label="项目名称" prop="refProjectName" min-width="160" show-overflow-tooltip></el-table-column>
  171. <!-- <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>-->
  172. <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip>
  173. <template slot-scope="scope">
  174. <CopyButton :copyText="scope.row.materialNumber" />
  175. <span>{{scope.row.materialNumber}}</span>
  176. </template>
  177. </el-table-column>
  178. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  179. <template slot-scope="scope">
  180. <CopyButton :copyText="scope.row.materialOldNumber" />
  181. <span>{{scope.row.materialOldNumber}}</span>
  182. </template>
  183. </el-table-column>
  184. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  185. <template slot-scope="scope">
  186. <CopyButton :copyText="scope.row.materialName" />
  187. <span>{{scope.row.materialName}}</span>
  188. </template>
  189. </el-table-column>
  190. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  191. <template slot-scope="scope">
  192. <CopyButton :copyText="scope.row.specification" />
  193. <span>{{scope.row.specification}}</span>
  194. </template>
  195. </el-table-column>
  196. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  197. <el-table-column align="right" label="总数量" prop="qty" min-width="100" sortable show-overflow-tooltip></el-table-column>
  198. <el-table-column align="left" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
  199. <template slot-scope="scope">
  200. {{scope.row.isDirectTransfer ? '是':'否'}}
  201. </template>
  202. </el-table-column>
  203. <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="110" sortable show-overflow-tooltip></el-table-column>
  204. <el-table-column align="right" label="出库数量" prop="hasSendQty" min-width="110" sortable show-overflow-tooltip></el-table-column>
  205. <el-table-column align="right" label="单价" prop="price" min-width="100" sortable show-overflow-tooltip>
  206. <template slot-scope="scope">
  207. {{scope.row.price | numToFixed}}
  208. </template>
  209. </el-table-column>
  210. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="110" sortable show-overflow-tooltip>
  211. <template slot-scope="scope">
  212. {{scope.row.payAmount | numToFixed}}
  213. </template>
  214. </el-table-column>
  215. <el-table-column align="left" label="返利钱包" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
  216. <el-table-column align="right" label="使用返利金额" prop="rebateAmount" min-width="120" show-overflow-tooltip>
  217. <template slot-scope="scope">
  218. <div v-if="scope.row.examineStatus === 'OK'">{{scope.row.payRebateAmount | numToFixed}}</div>
  219. <div v-else>{{scope.row.rebateAmount | numToFixed}}</div>
  220. </template>
  221. </el-table-column>
  222. <el-table-column align="right" label="格力折扣" prop="discAmount" min-width="110" sortable show-overflow-tooltip>
  223. <template slot-scope="scope">
  224. {{ scope.row.discAmount | numToFixed }}
  225. </template>
  226. </el-table-column>
  227. <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  228. <el-table-column align="left" label="表头业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column>
  229. <el-table-column align="left" label="表体业务员" prop="itemServiceName" min-width="100" show-overflow-tooltip></el-table-column>
  230. <el-table-column align="left" label="制表人" prop="createName" min-width="100" show-overflow-tooltip></el-table-column>
  231. <el-table-column align="left" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
  232. <el-table-column align="left" label="审核人" prop="confirmName" min-width="100" show-overflow-tooltip></el-table-column>
  233. <el-table-column align="left" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip></el-table-column>
  234. <el-table-column align="center" label="操作" width="220" fixed="right">
  235. <template slot-scope="scope">
  236. <el-popconfirm
  237. style="margin-right: 10px;"
  238. title="确定申请吗?"
  239. @onConfirm="handleSubmit(scope.row.parentId)"
  240. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
  241. <el-button slot="reference" type="text">申请</el-button>
  242. </el-popconfirm>
  243. <el-popconfirm
  244. style="margin-right: 10px;"
  245. title="确定撤回吗?"
  246. @onConfirm="handleWithdraw(scope.row.parentId)"
  247. v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
  248. <el-button slot="reference" type="text">撤回</el-button>
  249. </el-popconfirm>
  250. <el-popconfirm
  251. style="margin-right: 10px;"
  252. title="确定弃审吗?"
  253. @onConfirm="handleAbandon(scope.row.parentId)"
  254. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
  255. <el-button slot="reference" type="text">弃审</el-button>
  256. </el-popconfirm>
  257. <el-button
  258. type="text"
  259. @click="toForm(scope.row)"
  260. v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">
  261. 编辑
  262. </el-button>
  263. <el-button
  264. type="text"
  265. @click="toExamine(scope.row)"
  266. v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">
  267. 审批
  268. </el-button>
  269. <el-button
  270. type="text"
  271. @click="toReturn(scope.row)"
  272. v-if="$checkBtnRole('examine', $route.meta.roles)">
  273. 退订
  274. </el-button>
  275. <el-button
  276. type="text"
  277. @click="toDetail(scope.row)">
  278. 详情
  279. </el-button>
  280. <el-popconfirm
  281. style="margin-left: 10px;"
  282. title="确定删除吗?"
  283. @onConfirm="handleDelete(scope.row.parentId)"
  284. v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'">
  285. <el-button slot="reference" type="text" style="color: #f56c6c;">删除</el-button>
  286. </el-popconfirm>
  287. </template>
  288. </el-table-column>
  289. </el-table>
  290. </div>
  291. </div>
  292. <div class="pagination clearfix">
  293. <div class="fr">
  294. <el-pagination
  295. @size-change="handleSizeChange"
  296. @current-change="handleCurrentChange"
  297. :current-page="currentPage"
  298. :page-sizes="[10, 20, 30, 50]"
  299. :page-size="10"
  300. layout="total, sizes, prev, pager, next, jumper"
  301. :total="listTotal">
  302. </el-pagination>
  303. </div>
  304. </div>
  305. </div>
  306. <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
  307. <CommerceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
  308. <CommerceForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
  309. <CommerceExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
  310. <CommerceReturn :listItem="queryItem" v-if="isShowReturn" @backListFormDetail="backList" />
  311. </div>
  312. </template>
  313. <script>
  314. import { getOrderList, applyCom, withdrawCom, deleteCom, editDateCom, abandonCom } from "@/api/supply/engin";
  315. import { getSalesmanList, getTypeList } from '@/api/common'
  316. import CommerceDetail from "@/views/supply/engin/components/commerce_detail";
  317. import CommerceForm from "@/views/supply/engin/components/commerce_form";
  318. import CommerceExamine from "@/views/supply/engin/components/commerce_examine";
  319. import CommerceReturn from "@/views/supply/engin/components/commerce_return";
  320. import EditDateDialog from "@/components/Common/edit-date-dialog";
  321. let that
  322. export default {
  323. components: {
  324. CommerceDetail,
  325. CommerceForm,
  326. CommerceExamine,
  327. CommerceReturn,
  328. EditDateDialog,
  329. },
  330. filters: {
  331. statusFilter(val) {
  332. let obj = that.statusList.find(o => o.value == val);
  333. return obj ? obj.label : ''
  334. },
  335. typeFilter(val) {
  336. const MAP = {
  337. TRADE: '商用',
  338. HOME: '家用',
  339. }
  340. return MAP[val];
  341. }
  342. },
  343. data() {
  344. return {
  345. currentPage: 1, // 当前页码
  346. pageSize: 10, // 每页数量
  347. listTotal: 0, // 列表总数
  348. dataList: null, // 列表数据
  349. listLoading: false, // 列表加载loading
  350. screenForm: { // 筛选表单数据
  351. status: [],
  352. orderNum: '',
  353. enginNum: '',
  354. loginNum: '',
  355. enginName: '',
  356. date: '',
  357. saleType: '',
  358. createMan: '',
  359. examineMan: '',
  360. salesMan: '',
  361. dealer: '',
  362. model: '',
  363. isDirectTransfer:null
  364. },
  365. statusList: [
  366. { label: '已保存', value: 'SAVE' },
  367. { label: '待审核', value: 'WAIT' },
  368. { label: '审核通过', value: 'OK' },
  369. // // { label: '审核驳回', value: 'FAIL' },,
  370. { label: '已关闭', value: 'CLOSE' },
  371. ],
  372. salesmanList: [],
  373. salesTypeList: [],
  374. multipleSelection: [],
  375. transfer:[
  376. {label:'是',value:true},
  377. {label:'否',value:false}
  378. ],
  379. queryItem: {},
  380. isShowDetail: false,
  381. isShowForm: false,
  382. isShowExamine: false,
  383. isShowReturn: false,
  384. editId: null,
  385. isShowEditDateDialog: false,
  386. dateForm: {
  387. date: '',
  388. },
  389. }
  390. },
  391. computed: {
  392. exParams() {
  393. let ids = this.multipleSelection.map(item => {
  394. return item.enginOrderNo;
  395. });
  396. return {
  397. examineStatus: this.screenForm.status.join(','),
  398. enginOrderNo: (ids && ids.length) ? ids.join(',') : this.screenForm.orderNum,
  399. refProjectNo: this.screenForm.enginNum,
  400. refEnginRecordNo: this.screenForm.loginNum,
  401. refProjectName: this.screenForm.enginName,
  402. startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
  403. endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
  404. saleTypeId: this.screenForm.saleType,
  405. createName: this.screenForm.createMan,
  406. confirmName: this.screenForm.examineMan,
  407. serviceId: this.screenForm.salesMan,
  408. customerKeyWord: this.screenForm.dealer,
  409. specification: this.screenForm.model,
  410. isDirectTransfer:this.screenForm.isDirectTransfer,
  411. enginOrderType: 'TRADE', // TRADE=商用 HOME=家用
  412. }
  413. },
  414. },
  415. beforeCreate() {
  416. that = this;
  417. },
  418. created() {
  419. this.getSalesTypeList();
  420. this.getSalesmanList();
  421. this.getList();
  422. },
  423. methods: {
  424. // 获取业务员列表
  425. getSalesmanList() {
  426. getSalesmanList({
  427. pageNum: 1,
  428. pageSize: -1,
  429. isCustomer: 0,
  430. status: true,
  431. }).then(res => {
  432. this.salesmanList = res.data.records;
  433. })
  434. },
  435. // 获取销售类型列表
  436. getSalesTypeList() {
  437. getTypeList({
  438. pageNum: 1,
  439. pageSize: -1
  440. }).then((res) => {
  441. this.salesTypeList = res.data.records;
  442. })
  443. },
  444. // 查询列表
  445. getList() {
  446. this.listLoading = true;
  447. let params = {
  448. pageNum: this.currentPage,
  449. pageSize: this.pageSize,
  450. examineStatus: this.screenForm.status.join(','),
  451. enginOrderNo: this.screenForm.orderNum,
  452. refProjectNo: this.screenForm.enginNum,
  453. refEnginRecordNo: this.screenForm.loginNum,
  454. refProjectName: this.screenForm.enginName,
  455. startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
  456. endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
  457. saleTypeId: this.screenForm.saleType,
  458. createName: this.screenForm.createMan,
  459. confirmName: this.screenForm.examineMan,
  460. serviceId: this.screenForm.salesMan,
  461. customerKeyword: this.screenForm.dealer,
  462. isDirectTransfer:this.screenForm.isDirectTransfer,
  463. specification: this.screenForm.model,
  464. enginOrderType: 'TRADE', // TRADE=商用 HOME=家用
  465. };
  466. getOrderList(params).then((res) => {
  467. res.data.records.forEach(item => {
  468. item.sums1 = ['qty', 'directTransferQty', 'hasSendQty'];
  469. item.sums2 = ['price', 'payAmount', 'discAmount'];
  470. })
  471. this.dataList = res.data.records;
  472. this.listTotal = res.data.total;
  473. this.listLoading = false;
  474. })
  475. },
  476. // 提交筛选表单
  477. submitScreenForm() {
  478. this.currentPage = 1;
  479. this.getList();
  480. },
  481. // 重置筛选表单
  482. resetScreenForm() {
  483. this.$refs.screenForm.resetFields();
  484. this.currentPage = 1;
  485. this.getList();
  486. },
  487. // 更改每页数量
  488. handleSizeChange(val) {
  489. this.pageSize = val;
  490. this.currentPage = 1;
  491. this.getList();
  492. },
  493. // 更改当前页
  494. handleCurrentChange(val) {
  495. this.currentPage = val;
  496. this.getList();
  497. },
  498. // 进入表单
  499. toForm(item) {
  500. this.queryItem = item;
  501. this.isShowForm = true;
  502. },
  503. // 进入审批
  504. toExamine(item) {
  505. this.queryItem = item;
  506. this.isShowExamine = true;
  507. },
  508. // 进入详情
  509. toDetail(item) {
  510. this.queryItem = item;
  511. this.isShowDetail = true;
  512. },
  513. // 进入退订
  514. toReturn(item) {
  515. this.queryItem = item;
  516. this.isShowReturn = true;
  517. },
  518. backList() {
  519. this.queryItem = {};
  520. this.isShowDetail = false;
  521. this.isShowForm = false;
  522. this.isShowExamine = false;
  523. this.isShowReturn = false;
  524. },
  525. // 申请
  526. handleSubmit(id) {
  527. applyCom({id}).then(res => {
  528. this.$successMsg();
  529. this.getList();
  530. })
  531. },
  532. // 撤回
  533. handleWithdraw(id) {
  534. withdrawCom({id}).then(res => {
  535. this.$successMsg();
  536. this.getList();
  537. })
  538. },
  539. // 弃审
  540. handleAbandon(id) {
  541. abandonCom({id}).then(res => {
  542. this.$successMsg();
  543. this.getList();
  544. })
  545. },
  546. // 删除
  547. handleDelete(id) {
  548. deleteCom({ids: id}).then(res => {
  549. this.$successMsg();
  550. this.getList();
  551. })
  552. },
  553. // 批量删除
  554. batchDelete() {
  555. this.$confirm('此操作将永久删除, 是否继续?', '提示', {
  556. confirmButtonText: '确定',
  557. cancelButtonText: '取消',
  558. type: 'warning'
  559. }).then(() => {
  560. let ids = this.multipleSelection.map(item => {
  561. return item.parentId;
  562. });
  563. deleteCom({ids: ids.join(',')}).then(res => {
  564. this.$successMsg();
  565. this.getList();
  566. })
  567. }).catch(() => {});
  568. },
  569. handleSelectionChange(val) {
  570. this.multipleSelection = val;
  571. },
  572. // 打开 修改订单日期
  573. editDate(item) {
  574. this.editId = item.parentId;
  575. this.dateForm.date = item.orderDate.slice(0, 10);
  576. this.isShowEditDateDialog = true;
  577. },
  578. // 提交 修改订单日期
  579. submitDateForm() {
  580. editDateCom({
  581. enginOrderId: this.editId,
  582. orderDate: this.dateForm.date + ' 00:00:00',
  583. }).then(res => {
  584. this.isShowEditDateDialog = false;
  585. this.getList();
  586. this.$successMsg('修改成功');
  587. })
  588. },
  589. }
  590. }
  591. </script>
  592. <style lang="scss" scoped>
  593. </style>