home_list.vue 29 KB

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