home_list.vue 31 KB

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