myOrderList.vue 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472
  1. <template>
  2. <div class="app-container">
  3. <div class="title-container">
  4. <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
  5. </div>
  6. <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="selectMyOrderPage">
  7. <template slot="left">
  8. <PermissionButton
  9. menu-code="_views_assets_add_order"
  10. class-name="filter-item"
  11. type="danger"
  12. icon="el-icon-circle-plus-outline"
  13. :page-jump="true"
  14. round
  15. style="float: left"
  16. :page-query="{ 'couldEdit': true, 'saveOrderBtn': '保存订单', 'showBtn': true, 'couldBack': true }"
  17. />
  18. <el-input style="margin-left: 20px;width: 300px;float: left;" class="filter-item" v-model="listQuery.keyWord" placeholder="项目编号/报告号/项目名称/业务来源" clearable></el-input>
  19. <el-select v-model="listQuery.principalId" filterable placeholder="项目负责人(可搜索)" style=" width: 200px;margin-left: 10px;float: left;">
  20. <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id"></el-option>
  21. </el-select>
  22. <el-select v-model="listQuery.delivery" filterable placeholder="送达状态" style=" width: 200px;margin-left: 10px;float: left;">
  23. <el-option v-for="(s, value) in deliverys" :label="s.label" :value="s.value"></el-option>
  24. </el-select>
  25. <el-select v-model="listQuery.departmentId" filterable placeholder="接单部门" style=" width: 200px;margin-left: 10px;float: left;">
  26. <el-option v-for="(d, id) in allotDepartment" :label="d.name" :value="d.id"></el-option>
  27. </el-select>
  28. <el-select v-model="listQuery.productionType" filterable placeholder="产品类型" style=" width: 200px;margin-left: 10px;float: left;">
  29. <el-option label="意见书" value="STATEMENT"></el-option>
  30. <el-option label="评估报告" value="REPORT"></el-option>
  31. <el-option label="咨询报告" value="CONSULT"></el-option>
  32. <el-option label="意见函" value="LETTER"></el-option>
  33. <el-option label="订单" value="ORDER"></el-option>
  34. </el-select>
  35. <el-date-picker
  36. style="margin-left: 20px;float: left;"
  37. v-model="selectDate"
  38. type="daterange"
  39. :picker-options="pickerOptions"
  40. format="yyyy 年 MM 月 dd 日"
  41. value-format="yyyy-MM-dd"
  42. range-separator="至"
  43. start-placeholder="开始日期"
  44. end-placeholder="结束日期"
  45. align="right"
  46. ></el-date-picker>
  47. <el-button class="filter-item" style="margin-left: 10px;float: left;" type="primary" @click="searchList" round>搜索</el-button>
  48. <el-button class="filter-item" style="float: left;" round type="success" @click="resetParams()">重置</el-button>
  49. <el-button class="filter-item" style="float: left;" round type="success" @click="exportMyOrder()" :disabled="!listQuery.startTime && !listQuery.endTime">导出</el-button>
  50. </template>
  51. <parentTable ref="table" v-loading="listLoading" :data="pageData.records" slot="table" style="width: 100%;">
  52. <el-table-column label="项目编号" align="center" width="100">
  53. <template slot-scope="{row}">
  54. <span>{{ row.orderId }}</span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="分单类型" align="center" width="80">
  58. <template slot-scope="{row}">
  59. <span>{{ row.allotType }}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="意见书号" align="center" width="250">
  63. <template slot-scope="{row}">
  64. <span>{{ row.statementNo == null ? '-' : row.statementNo }}</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="报告号" align="center" width="250">
  68. <template slot-scope="{row}">
  69. <span>{{ row.reportNo == null ? '-' : row.reportNo }}</span>
  70. </template>
  71. </el-table-column>
  72. <el-table-column label="项目名称" align="center" width="300" show-overflow-tooltip>
  73. <template slot-scope="{row}">
  74. <span>{{ row.name }}</span>
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="产品类型" align="center" width="120" show-overflow-tooltip>
  78. <template slot-scope="{row}">
  79. <span v-if="row.statementNo">意见书</span>
  80. <span v-if="row.statementNo && row.reportType">、</span>
  81. <span v-if="row.reportType == 'REPORT'">评估报告</span>
  82. <span v-if="row.reportType == 'CONSULT'">咨询报告</span>
  83. <span v-if="row.reportType == 'LETTER'">意见函</span>
  84. <span v-if="!row.statementNo && !row.reportType">订单</span>
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="业务类型" align="center" width="100">
  88. <template slot-scope="{row}">
  89. <span>{{ row.assetsBusinessGener }}</span>
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="客户名称" align="center" width="100">
  93. <template slot-scope="{row}">
  94. <span>{{ row.customerName }}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="业务来源" align="center" width="100">
  98. <template slot-scope="{row}">
  99. <span>{{ row.customerSubName }}</span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="委托人" align="center" width="150" show-overflow-tooltip>
  103. <template slot-scope="{row}">
  104. <span>{{ row.bailor == null ? '-' : row.bailor }}</span>
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="委托人电话" align="center" width="120">
  108. <template slot-scope="{row}">
  109. <span>{{ row.bailorContactTel == null ? '-' : row.bailorContactTel }}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="当前节点" align="center" width="100">
  113. <template slot-scope="{row}">
  114. <span>{{ row.currentNodeName }}</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="当前负责人" align="center" width="100">
  118. <template slot-scope="{row}">
  119. <span>{{ row.handlerName }}</span>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="项目负责人" align="center" width="100">
  123. <template slot-scope="{row}">
  124. <span>{{ row.principalName }}</span>
  125. </template>
  126. </el-table-column>
  127. <el-table-column label="客户经理" align="center" width="100">
  128. <template slot-scope="{row}">
  129. <span>{{ row.clientManagerName }}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column label="评估结论对应的评估值(万)" align="center" width="100">
  133. <template slot-scope="{row}">
  134. <span>{{ row.estimatedValue == null ? '-' : row.estimatedValue }}</span>
  135. </template>
  136. </el-table-column>
  137. <el-table-column label="产品应收款(元)" align="center" width="100">
  138. <template slot-scope="{row}">
  139. <span>{{ row.productionShouldAmount == null ? '-' : row.productionShouldAmount }}</span>
  140. </template>
  141. </el-table-column>
  142. <el-table-column label="产品实收款(元)" align="center" width="100">
  143. <template slot-scope="{row}">
  144. <span>{{ row.productionRealAmount == null ? '-' : row.productionRealAmount }}</span>
  145. </template>
  146. </el-table-column>
  147. <el-table-column label="标准收费(元)" align="center" width="100">
  148. <template slot-scope="{row}">
  149. <span>{{ row.standardAmount == null ? '-' : row.standardAmount }}</span>
  150. </template>
  151. </el-table-column>
  152. <el-table-column label="实际开票金额" align="center" width="100">
  153. <template slot-scope="{row}">
  154. <span>{{ row.invoiceRealAmount == null ? '-' : row.invoiceRealAmount }}</span>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="送达状态" align="center" width="100">
  158. <template slot-scope="{row}">
  159. <el-tag v-if="row.reportDelivery" type="success">已送达</el-tag>
  160. <el-tag v-else type="danger">未送达</el-tag>
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="下单时间" align="center" width="170" show-overflow-tooltip>
  164. <template slot-scope="{row}">
  165. <span>{{ row.created }}</span>
  166. </template>
  167. </el-table-column>
  168. <el-table-column label="操作" align="center" width="200" fixed="right">
  169. <template slot-scope="{row}">
  170. <div class="optionDiv" style="white-space: nowrap; display: inline-block">
  171. <div>
  172. <el-button type="text" size="mini" :disabled="!((!row.reportDelivery || row.reportDelivery == null) && row.reportRepertoryState)" @click="markDelivery(row)">送达</el-button>
  173. <el-button type="text" size="mini" @click="orderDetail(row)">查看</el-button>
  174. <el-button type="text" size="mini" @click="editOrder(row)">编辑</el-button>
  175. </div>
  176. <!-- <div>
  177. <el-button type="text" size="mini" @click="openShouldAmountDialog(row)">
  178. 订单应收款
  179. </el-button>
  180. </div>-->
  181. <div>
  182. <el-button :disabled="!(row.reportNo !== null)" type="text" size="mini" @click="openProShouldAmountDialog(row)">应收款</el-button>
  183. <el-button :disabled="!(row.currentNodeCode === 'REPORT_OUT_APPLY')" type="text" size="mini" @click="openRepertoryOutWarehouse(row)">出库</el-button>
  184. <el-button :disabled="!(row.realAmount > 0)" type="text" size="mini" @click="openAllotProductionDialog(row)">实收款分配</el-button>
  185. </div>
  186. <div>
  187. <el-button type="text" size="mini" @click="openFinanceInvoiceDialog(row.orderFundId, row.productionFundId, row.realAmount, row.customerName, row.customerSubName)">开票</el-button>
  188. <el-button type="text" size="mini" @click="openProductionReturnDialog(row)">产品退回</el-button>
  189. <el-button type="text" size="mini" @click="openComplaintDialog(row)">项目投诉</el-button>
  190. </div>
  191. <!-- <el-button v-if="row.currentNodeCode === 'REPORT_OUT_APPLY'" type="text"
  192. @click="canceladdRepertoryOutWarehouse(row)">
  193. 撤销出库申请
  194. </el-button>-->
  195. </div>
  196. </template>
  197. </el-table-column>
  198. </parentTable>
  199. </y-page-list-layout>
  200. <el-dialog :visible.sync="shouldAmountDialog" width="35%" center top="35vh" custom-class="doWarehouseClass" @closed="cleanData">
  201. <el-form ref="fund" :model="fund" style="margin-left:40px">
  202. <el-row>
  203. <el-col :xs="24" :sm="12" :lg="24" :span="12">
  204. <el-form-item label="应收款金额(元):" prop="shouldAmount" label-width="160px" class="postInfo-container-item" :rules="{ required: true, message: '应收款金额不能为空', trigger: 'blur' }">
  205. <el-input-number :precision="2" :min="null" :value-on-clear="0" v-model.number="fund.shouldAmount" type="number" style="width:300px" class="filter-item" />
  206. </el-form-item>
  207. </el-col>
  208. </el-row>
  209. <el-row>
  210. <el-col :xs="24" :sm="12" :lg="24" :span="12">
  211. <el-form-item label="备注:" prop="remark" label-width="160px" class="postInfo-container-item">
  212. <el-input style="width:300px" type="textarea" v-model="fund.remark"></el-input>
  213. </el-form-item>
  214. </el-col>
  215. </el-row>
  216. </el-form>
  217. <span slot="footer" class="dialog-footer">
  218. <el-button @click="shouldAmountDialog = false">取 消</el-button>
  219. <el-button type="primary" @click="saveShouldAmount()">确 定</el-button>
  220. </span>
  221. </el-dialog>
  222. <el-dialog :visible.sync="proShouldAmountDialog" width="35%" center top="35vh" custom-class="doWarehouseClass" @closed="cleanData">
  223. <el-form ref="productionFundFrom" :model="productionFundFrom" style="margin-left:40px">
  224. <el-row>
  225. <el-col :xs="24" :sm="12" :lg="24" :span="12">
  226. <el-form-item label="产品应收款金额(元):" prop="productionShouldAmount" label-width="180px" class="postInfo-container-item" :rules="{ required: true, message: '应收款金额不能为空', trigger: 'blur' }">
  227. <el-input-number :precision="2" :min="null" :value-on-clear="0" v-model.number="productionFundFrom.productionShouldAmount" type="number" style="width:300px" class="filter-item" />
  228. </el-form-item>
  229. </el-col>
  230. </el-row>
  231. <el-row>
  232. <el-col :xs="24" :sm="12" :lg="24" :span="12">
  233. <el-form-item label="备注:" prop="remark" label-width="180px" class="postInfo-container-item">
  234. <el-input style="width:300px" type="textarea" v-model="productionFundFrom.remark"></el-input>
  235. </el-form-item>
  236. </el-col>
  237. </el-row>
  238. </el-form>
  239. <span slot="footer" class="dialog-footer">
  240. <el-button @click="proShouldAmountDialog = false">取 消</el-button>
  241. <el-button type="primary" @click="saveProShouldAmount()">确 定</el-button>
  242. </span>
  243. </el-dialog>
  244. <el-dialog :visible.sync="repertoryOutWarehouseVisible">
  245. <el-form ref="outWarehouse" :model="outWarehouse" style="margin-left:40px; margin-right: 200px;">
  246. <el-row>
  247. <el-col>
  248. <el-form-item label="报告号:" prop="remark" label-width="160px" class="postInfo-container-item">
  249. <el-input type="input" placeholder="请输入申请提前出库原因" v-model="outWarehouse.reportNo" disabled></el-input>
  250. </el-form-item>
  251. <el-form-item label="出库原因:" prop="remark" label-width="160px" class="postInfo-container-item">
  252. <el-input type="textarea" placeholder="请输入申请提前出库原因" v-model="outWarehouse.remark"></el-input>
  253. </el-form-item>
  254. </el-col>
  255. </el-row>
  256. </el-form>
  257. <span slot="footer" class="dialog-footer">
  258. <el-button @click="repertoryOutWarehouseVisible = false">取 消</el-button>
  259. <el-button type="primary" @click="addRepertoryOutWarehouse()">确 定</el-button>
  260. </span>
  261. </el-dialog>
  262. <!-- 分配资产订单实收款到产品 -->
  263. <el-dialog :visible.sync="allotAmountDialog" width="65%" center custom-class="doWarehouseClass">
  264. <el-form v-model="orderProduction" ref="orderProduction">
  265. <el-row>
  266. <el-col :xs="24" :sm="12" :lg="24" :span="6">
  267. <el-button style="float:right" type="success" @click="allotOrderRealAmountToProduction()">确认分配</el-button>
  268. </el-col>
  269. </el-row>
  270. <el-card style="margin-top:20px" shadow="hover">
  271. <div slot="header" class="clearfix">
  272. <el-row>
  273. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  274. <el-form-item label="订单名称:" prop="orderName" label-width="140px" class="postInfo-container-item">
  275. <el-input :value="orderProduction.orderName" type="text" class="filter-item" disabled readonly />
  276. </el-form-item>
  277. </el-col>
  278. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  279. <el-form-item label="订单号:" prop="orderId" label-width="140px" class="postInfo-container-item">
  280. <el-input :value="orderProduction.orderId" type="text" class="filter-item" disabled readonly />
  281. </el-form-item>
  282. </el-col>
  283. </el-row>
  284. <el-row>
  285. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  286. <el-form-item label="订单已认领金额:" prop="realAmount" label-width="160px" :class="['postInfo-container-item', 'real-amount']">
  287. <el-input :value="orderProduction.realAmount" type="text" class="filter-item" disabled readonly>
  288. <template slot="append">元</template>
  289. </el-input>
  290. </el-form-item>
  291. </el-col>
  292. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  293. <el-form-item label="未分配金额:" prop="notAllotAmount" label-width="160px" :class="['postInfo-container-item', 'real-amount']">
  294. <el-input :value="notAllotAmount" type="text" class="filter-item" disabled readonly>
  295. <template slot="append">元</template>
  296. </el-input>
  297. </el-form-item>
  298. </el-col>
  299. </el-row>
  300. </div>
  301. <el-row>
  302. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  303. <el-form-item label="产品列表:" prop="orderName" label-width="140px" class="postInfo-container-item" />
  304. </el-col>
  305. </el-row>
  306. <div v-if="orderProduction.reports != null && orderProduction.reports.length > 0">
  307. <el-row v-for="(r, index) in orderProduction.reports">
  308. <div>
  309. <el-col :xs="24" :sm="12" :lg="5" :span="6">
  310. <el-form-item :label="productionLabel + (index + 1) + ':'" prop="productionType" label-width="90px" class="postInfo-container-item">
  311. <el-input :value="r.productionType" type="text" class="filter-item" disabled readonly />
  312. </el-form-item>
  313. </el-col>
  314. <el-col :xs="24" :sm="12" :lg="7" :span="6">
  315. <el-form-item label="报告号:" prop="businessSubId" label-width="90px" class="postInfo-container-item">
  316. <el-input :value="r.businessSubId" type="text" class="filter-item" disabled readonly />
  317. </el-form-item>
  318. </el-col>
  319. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  320. <el-form-item label="已分配金额:" prop="claimedAmount" label-width="120px" class="postInfo-container-item">
  321. <el-input-number :precision="2" :min="0" :value-on-clear="0" v-model.number="r.claimedAmount" type="number" style="width:100%" class="filter-item" readonly disabled />
  322. </el-form-item>
  323. </el-col>
  324. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  325. <el-form-item label="本次分配:" prop="thisTimeAmount" label-width="100px" class="postInfo-container-item">
  326. <el-input-number :precision="2" :min="0" :value-on-clear="0" v-model.number="r.thisTimeAmount" type="number" style="width:100%" class="filter-item" />
  327. </el-form-item>
  328. </el-col>
  329. </div>
  330. </el-row>
  331. </div>
  332. <span v-else style="margin-left:140px;color:RGB(153,153,153)">暂无产品</span>
  333. </el-card>
  334. </el-form>
  335. </el-dialog>
  336. <el-dialog :visible.sync="makeInvoiceListDialog" width="90%" center custom-class="doWarehouseClass">
  337. <el-button type="danger" round @click="openNewInvoiceDialog()">新增开票</el-button>
  338. <div style="margin-top:30px;">
  339. <el-table :data="invoiceData" stripe :header-row-style="{ color: '#333333', 'font-size': '14px' }" border style="width: 100%; margin-top:20px;font-size: 14px;">
  340. <el-table-column align="center" prop="title" label="发票抬头" width="180"></el-table-column>
  341. <el-table-column align="center" prop="taxNo" label="税号" width="180"></el-table-column>
  342. <el-table-column align="center" prop="type" label="发票类型"></el-table-column>
  343. <el-table-column align="center" prop="state" label="开票状态">
  344. <template slot-scope="{row}">
  345. <span :style="stateStyle(row.state)">{{ row.state }}</span>
  346. </template>
  347. </el-table-column>
  348. <el-table-column align="center" prop="planAmount" label="计划开票金额"></el-table-column>
  349. <el-table-column align="center" prop="planMakeDate" label="计划开票日期"></el-table-column>
  350. <el-table-column align="center" prop="realAmount" label="实际开票金额"></el-table-column>
  351. <el-table-column align="center" prop="realMakeDate" label="实际开票日期"></el-table-column>
  352. <el-table-column align="center" prop="reason" label="驳回/作废原因"></el-table-column>
  353. <el-table-column align="center" prop="remark" label="备注"></el-table-column>
  354. <el-table-column fixed="right" label="操作" width="200" align="center">
  355. <template slot-scope="{row}">
  356. <!-- <el-button :disabled="row.state != '审核中'" @click="invoiceDetail(row.id)" type="text" size="small">修改</el-button> -->
  357. <el-button :disabled="row.state != '已开票'" @click="cancellation(row.id)" type="text" size="small">申请作废</el-button>
  358. <el-button @click="copyInvoice(row)" type="text" size="small">复制</el-button>
  359. </template>
  360. </el-table-column>
  361. </el-table>
  362. </div>
  363. </el-dialog>
  364. <el-dialog :visible.sync="newInvoiceDialog" width="55%" top="10vh" center custom-class="doWarehouseClass" @closed="cleanFinanceInvoiceForm">
  365. <el-form ref="invoice" :model="invoice">
  366. <el-divider content-position="left">开票信息</el-divider>
  367. <el-row>
  368. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  369. <el-form-item label="发票抬头:" :rules="{ required: true, message: '发票抬头不能为空', trigger: 'blur' }" prop="title" label-width="140px" class="postInfo-container-item">
  370. <el-input v-model.trim="invoice.title" class="filter-item" />
  371. </el-form-item>
  372. </el-col>
  373. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  374. <el-form-item label="发票类型:" :rules="{ required: true, message: '发票类型不能为空', trigger: 'blur' }" prop="type" label-width="140px" class="postInfo-container-item">
  375. <el-select v-model="invoice.type" style="width:100%">
  376. <el-option label="普票" value="普票"></el-option>
  377. <el-option label="专票" value="专票"></el-option>
  378. </el-select>
  379. </el-form-item>
  380. </el-col>
  381. </el-row>
  382. <el-row>
  383. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  384. <el-form-item label="税号:" :rules="{ required: true, message: '税号不能为空', trigger: 'blur' }" prop="taxNo" label-width="140px" class="postInfo-container-item">
  385. <el-input v-model.trim="invoice.taxNo" class="filter-item" />
  386. </el-form-item>
  387. </el-col>
  388. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  389. <el-form-item label="计划开票日期:" prop="planMakeDate" :rules="{ required: true, message: '计划开票日期不能为空', trigger: 'blur' }" label-width="140px" class="postInfo-container-item">
  390. <el-date-picker v-model="invoice.planMakeDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" style="width:100%"></el-date-picker>
  391. </el-form-item>
  392. </el-col>
  393. </el-row>
  394. <el-row>
  395. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  396. <el-form-item label="待开金额(元):" prop="planAmount" :rules="{ required: true, message: '使用权面积不能为空', trigger: 'blur' }" label-width="140px" class="postInfo-container-item">
  397. <el-input-number :precision="2" :min="0" :value-on-clear="0" v-model.number="invoice.planAmount" type="number" style="width:100%" class="filter-item" />
  398. </el-form-item>
  399. </el-col>
  400. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  401. <el-form-item label="是否收款:" label-width="140px" class="postInfo-container-item">
  402. <el-radio-group :value="invoice.realPayAmount ? '已收款' : '未收款'">
  403. <el-radio label="已收款"></el-radio>
  404. <el-radio label="未收款"></el-radio>
  405. </el-radio-group>
  406. </el-form-item>
  407. </el-col>
  408. </el-row>
  409. <el-row>
  410. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  411. <el-form-item label="开票项目:" prop="makeItem" label-width="140px" class="postInfo-container-item">
  412. <el-input v-model.trim="invoice.makeItem" class="filter-item" />
  413. </el-form-item>
  414. </el-col>
  415. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  416. <el-form-item label="项目数量:" prop="itemQuantity" label-width="140px" class="postInfo-container-item">
  417. <el-input v-model.trim="invoice.itemQuantity" class="filter-item" />
  418. </el-form-item>
  419. </el-col>
  420. </el-row>
  421. <el-row>
  422. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  423. <el-form-item label="计量单位:" prop="itemUnit" label-width="140px" class="postInfo-container-item">
  424. <el-input v-model.trim="invoice.itemUnit" class="filter-item" placeholder="个/套/箱/次/斤/公斤/..." />
  425. </el-form-item>
  426. </el-col>
  427. </el-row>
  428. <el-row>
  429. <el-col :xs="24" :sm="12" :lg="24" :span="6">
  430. <el-form-item label="备注:" prop="remark" label-width="140px" class="postInfo-container-item">
  431. <el-input v-model.trim="invoice.remark" type="textarea" :autosize="{ minRows: 5, maxRows: 8 }" class="filter-item" />
  432. </el-form-item>
  433. </el-col>
  434. </el-row>
  435. </el-form>
  436. <span slot="footer" class="dialog-footer">
  437. <el-button @click="newInvoiceDialog = false">取 消</el-button>
  438. <el-button type="primary" @click="saveInvoice()">确 定</el-button>
  439. </span>
  440. </el-dialog>
  441. <el-dialog :visible.sync="productionReturnDialog" width="55%" center @closed="resetProductionReturnForm()">
  442. <el-form ref="productionReturnForm" :model="productionReturnForm" :rules="productionReturnFormRules">
  443. <el-divider content-position="left">申请产品退回</el-divider>
  444. <el-row>
  445. <el-col :xs="24" :sm="24" :lg="24" :span="6">
  446. <el-form-item label="项目名称:" prop="name" label-width="140px" class="postInfo-container-item">
  447. <el-input v-model.trim="productionReturnForm.name" class="filter-item" disabled />
  448. </el-form-item>
  449. </el-col>
  450. </el-row>
  451. <el-row>
  452. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  453. <el-form-item label="项目编号:" prop="orderId" label-width="140px" class="postInfo-container-item">
  454. <el-input v-model.trim="productionReturnForm.orderId" class="filter-item" disabled />
  455. </el-form-item>
  456. </el-col>
  457. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  458. <el-form-item label="产品编号:" prop="productionNo" label-width="140px" class="postInfo-container-item">
  459. <el-input v-model.trim="productionReturnForm.productionNo" class="filter-item" disabled />
  460. </el-form-item>
  461. </el-col>
  462. </el-row>
  463. <el-row>
  464. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  465. <el-form-item label="客户名称:" prop="clientName" label-width="140px" class="postInfo-container-item">
  466. <el-input v-model.trim="productionReturnForm.clientName" class="filter-item" disabled />
  467. </el-form-item>
  468. </el-col>
  469. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  470. <el-form-item label="业务来源:" prop="clientSubName" label-width="140px" class="postInfo-container-item">
  471. <el-input v-model.trim="productionReturnForm.clientSubName" class="filter-item" disabled />
  472. </el-form-item>
  473. </el-col>
  474. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  475. <el-form-item label="委托人:" prop="bailor" label-width="140px" class="postInfo-container-item">
  476. <el-input v-model.trim="productionReturnForm.bailor" class="filter-item" disabled />
  477. </el-form-item>
  478. </el-col>
  479. </el-row>
  480. <el-row>
  481. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  482. <el-form-item label="退产品原因:" prop="returnReason" label-width="140px" class="postInfo-container-item">
  483. <el-input v-model.trim="productionReturnForm.returnReason" class="filter-item" />
  484. </el-form-item>
  485. </el-col>
  486. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  487. <el-form-item label="是否退发票:" prop="returnInvoice" label-width="140px" class="postInfo-container-item">
  488. <el-select v-model="productionReturnForm.returnInvoice" style="width: 100%">
  489. <el-option label="不退发票" value="0"></el-option>
  490. <el-option label="退发票" value="1"></el-option>
  491. <el-option label="未开发票" value="2"></el-option>
  492. </el-select>
  493. </el-form-item>
  494. </el-col>
  495. </el-row>
  496. </el-form>
  497. <span slot="footer" class="dialog-footer">
  498. <el-button @click="productionReturnDialog = false">取 消</el-button>
  499. <el-button type="primary" @click="saveProductionreturn()">确 定</el-button>
  500. </span>
  501. </el-dialog>
  502. <el-dialog :visible.sync="complaintDataDialog" width="55%" center custom-class="doWarehouseClass">
  503. <el-button type="danger" round @click="openComplaintFormDialog()">新增投诉</el-button>
  504. <div style="margin-top:30px;">
  505. <el-table :data="complaintData" stripe :header-row-style="{ color: '#333333', 'font-size': '14px' }" border style="width: 100%; margin-top:20px;font-size: 14px;">
  506. <el-table-column align="center" prop="complainantType" label="投诉类型" min-width="12.5%">
  507. <template slot-scope="{row}">
  508. <span v-if="row.complainantType == 'INTERNAL'">内部投诉</span>
  509. <span v-if="row.complainantType == 'EXTERNAL'">外部投诉</span>
  510. </template>
  511. </el-table-column>
  512. <el-table-column align="center" prop="complainantName" label="投诉人" min-width="12.5%"></el-table-column>
  513. <el-table-column align="center" prop="respondentName" label="项目负责人" min-width="12.5%"></el-table-column>
  514. <el-table-column align="center" prop="orderId" label="项目编号" min-width="12.5%"></el-table-column>
  515. <el-table-column align="center" prop="reason" label="投诉原因" min-width="25%"></el-table-column>
  516. <el-table-column align="center" prop="state" label="投诉状态" min-width="12.5%">
  517. <template slot-scope="{row}">
  518. <span v-if="row.state == 'PENDING'" style="color:#E6A23C">待确认</span>
  519. <span v-if="row.state == 'CONFIRM'" style="color:red">已确认</span>
  520. <span v-if="row.state == 'CANCEL'" style="color:gray">撤销</span>
  521. </template>
  522. </el-table-column>
  523. <el-table-column align="center" prop="created" label="投诉时间" min-width="15%"></el-table-column>
  524. <el-table-column align="center" prop="checkerName" label="审核人" min-width="12.5%">
  525. <template slot-scope="{row}">
  526. <span>{{ row.checkerName ? row.checkerName : '-' }}</span>
  527. </template>
  528. </el-table-column>
  529. <el-table-column align="center" prop="checkDate" label="审核时间" min-width="15%">
  530. <template slot-scope="{row}">
  531. <span>{{ row.checkDate ? row.checkDate : '-' }}</span>
  532. </template>
  533. </el-table-column>
  534. </el-table>
  535. </div>
  536. </el-dialog>
  537. <el-dialog title="新增投诉" :visible.sync="complaintFormDialog">
  538. <el-form :model="complaintForm" :rules="complaintFormRules" ref="complaintForm">
  539. <el-row>
  540. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  541. <el-form-item label="投诉类型:" prop="complainantType" label-width="140px">
  542. <el-select v-model="complaintForm.complainantType" style="width:100%">
  543. <el-option label="内部投诉" value="INTERNAL"></el-option>
  544. <el-option label="外部投诉" value="EXTERNAL"></el-option>
  545. </el-select>
  546. </el-form-item>
  547. </el-col>
  548. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  549. <el-form-item label="项目编号:" prop="orderId" label-width="140px">
  550. <el-input v-model="complaintForm.orderId" disabled style="width:100%"></el-input>
  551. </el-form-item>
  552. </el-col>
  553. </el-row>
  554. <el-row>
  555. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  556. <el-form-item label="投诉人:" prop="complainantId" label-width="140px">
  557. <el-select v-model="complaintForm.complainantId" filterable placeholder="可搜索" style="width:100%" disabled>
  558. <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id"></el-option>
  559. </el-select>
  560. </el-form-item>
  561. </el-col>
  562. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  563. <el-form-item label="被投诉项目负责人:" prop="respondentId" label-width="140px">
  564. <el-select v-model="complaintForm.respondentId" filterable placeholder="可搜索" style="width:100%" disabled>
  565. <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id"></el-option>
  566. </el-select>
  567. </el-form-item>
  568. </el-col>
  569. </el-row>
  570. <el-row>
  571. <el-col>
  572. <el-form-item label="投诉原因:" prop="reason" label-width="140px">
  573. <el-input type="textarea" v-model="complaintForm.reason" :autosize="{ minRows: 4, maxRows: 4 }"></el-input>
  574. </el-form-item>
  575. </el-col>
  576. </el-row>
  577. </el-form>
  578. <div slot="footer" class="dialog-footer">
  579. <el-button @click="complaintFormDialog = false">取 消</el-button>
  580. <el-button type="primary" @click="saveComplaint()">确 定</el-button>
  581. </div>
  582. </el-dialog>
  583. </div>
  584. </template>
  585. <script>
  586. import YPageListLayout from '@/components/YPageListLayout';
  587. import Breadcrumb from '@/components/Breadcrumb';
  588. import PermissionButton from '@/components/PermissionButton/PermissionButton';
  589. import { getOperatorWidth } from '@/utils/tableUtil.js';
  590. import testVue from '../error-page/test.vue';
  591. export default {
  592. name: 'AssetsMyOrderList',
  593. components: {
  594. Breadcrumb,
  595. YPageListLayout,
  596. PermissionButton,
  597. },
  598. data() {
  599. return {
  600. // dynamicWidth: 0,
  601. pageData: { records: [] },
  602. listLoading: false,
  603. listQuery: {
  604. page: 1,
  605. size: 10,
  606. current: 1,
  607. // 节点code
  608. nodeCode: null,
  609. // 客户经理id
  610. clientManagerId: this.$store.getters.userInfo.id,
  611. // 项目负责人id
  612. principalId: null,
  613. // 业务类型
  614. assetsBusinessGener: null,
  615. // 关键字
  616. keyWord: null,
  617. // 送达状态
  618. delivery: null,
  619. departmentId: null,
  620. // 开始时间
  621. startTime: null,
  622. // 结束时间
  623. endTime: null,
  624. },
  625. // 接单部门
  626. allotDepartment: [],
  627. // 用户下拉列表
  628. allUsers: [],
  629. // 送达状态下拉列表
  630. deliverys: [
  631. {
  632. value: '1',
  633. label: '已送达',
  634. },
  635. {
  636. value: '0',
  637. label: '未送达',
  638. },
  639. ],
  640. shouldAmountDialog: false,
  641. proShouldAmountDialog: false,
  642. fund: {
  643. id: null,
  644. businessType: null,
  645. orderName: null,
  646. orderId: null,
  647. shouldAmount: null,
  648. remark: null,
  649. businessType: null,
  650. businessId: null,
  651. businessSubId: null,
  652. productionFundId: null,
  653. evaluateAmount: null,
  654. },
  655. repertoryOutWarehouseVisible: false,
  656. outWarehouse: {
  657. id: null,
  658. productionFundId: null,
  659. reportNo: null,
  660. statementNo: null,
  661. remark: null,
  662. realAmount: null,
  663. },
  664. businessId: null,
  665. businessSubId: null,
  666. businessMinId: null,
  667. recordId: null,
  668. currentNodeId: null,
  669. // 产品收款信息
  670. productionFundFrom: {
  671. id: null,
  672. businessType: null,
  673. businessId: null,
  674. productionNo: null,
  675. productionType: null,
  676. orderFundId: null,
  677. productionShouldAmount: null,
  678. remark: null,
  679. },
  680. allotAmountDialog: false,
  681. notAllotAmount: null,
  682. productionLabel: '产品',
  683. orderProduction: {
  684. reports: [],
  685. orderName: null,
  686. orderId: null,
  687. realAmount: null,
  688. id: null,
  689. },
  690. invoiceData: [],
  691. invoice: {
  692. id: null,
  693. orderFundId: null,
  694. productionFundId: null,
  695. title: null,
  696. type: null,
  697. taxNo: null,
  698. planAmount: null,
  699. planMakeDate: null,
  700. bankName: null,
  701. bankAccount: null,
  702. bankAddress: null,
  703. bankTel: null,
  704. makeItem: null,
  705. itemQuantity: null,
  706. itemUnit: null,
  707. taxRate: null,
  708. taxAmount: null,
  709. remark: null,
  710. realPayAmount: null,
  711. realAmount: null,
  712. realMakeDate: null,
  713. },
  714. makeInvoiceListDialog: false,
  715. newInvoiceDialog: false,
  716. pickerOptions: {
  717. shortcuts: [
  718. {
  719. text: '最近一周',
  720. onClick(picker) {
  721. const end = new Date();
  722. const start = new Date();
  723. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  724. picker.$emit('pick', [start, end]);
  725. },
  726. },
  727. {
  728. text: '最近一个月',
  729. onClick(picker) {
  730. const end = new Date();
  731. const start = new Date();
  732. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  733. picker.$emit('pick', [start, end]);
  734. },
  735. },
  736. {
  737. text: '最近三个月',
  738. onClick(picker) {
  739. const end = new Date();
  740. const start = new Date();
  741. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  742. picker.$emit('pick', [start, end]);
  743. },
  744. },
  745. ],
  746. },
  747. selectDate: '',
  748. productionReturnDialog: false,
  749. productionReturnForm: {},
  750. productionReturnFormRules: {
  751. returnReason: [{ required: true, message: '退产品原因不能为空', trigger: 'blur' }],
  752. returnInvoice: [{ required: true, message: '请选择是否退发票', trigger: 'change' }],
  753. },
  754. // 投诉dialog
  755. complaintDataDialog: false,
  756. complaintData: [],
  757. complaintQuery: {},
  758. complaintInfo: {},
  759. complaintForm: {},
  760. complaintFormDialog: false,
  761. complaintFormRules: {
  762. complainantType: [{ required: true, message: '请选择投诉类型', trigger: 'change' }],
  763. complainantId: [{ required: true, message: '投诉人不可为空', trigger: 'blur' }],
  764. respondentId: [{ required: true, message: '被投诉项目负责人不可为空', trigger: 'blur' }],
  765. orderId: [{ required: true, message: '项目编号不可为空', trigger: 'blur' }],
  766. reason: [{ required: true, message: '投诉原因不可为空', trigger: 'blur' }],
  767. },
  768. };
  769. },
  770. created() {
  771. // 获取用户下拉列表
  772. this.getAllUser();
  773. // 获取分单部门
  774. this.getAllotDepartment();
  775. // 获取我的资产业务订单
  776. this.selectMyOrderPage();
  777. if (this.$route.query.repertoryOutWarehouseVisible === 'true') {
  778. this.openRepertoryOutWarehouse(JSON.parse(this.$route.query.row));
  779. }
  780. },
  781. methods: {
  782. // 无条件分页查询
  783. selectMyOrderPage() {
  784. this.listLoading = true;
  785. if (this.selectDate) {
  786. this.listQuery.startTime = this.selectDate[0] + ' 00:00:00';
  787. this.listQuery.endTime = this.selectDate[1] + ' 23:59:59';
  788. }
  789. this.$api.assets.selectMyOrderPage(this.listQuery).then((res) => {
  790. if (res.code === 200) {
  791. this.pageData = res.data;
  792. }
  793. this.listLoading = false;
  794. });
  795. },
  796. // 条件查询
  797. searchList() {
  798. // 重置分页
  799. this.listQuery.page = 1;
  800. this.listQuery.size = 10;
  801. this.listQuery.current = 1;
  802. this.selectMyOrderPage();
  803. },
  804. // 重置搜索条件
  805. resetParams() {
  806. this.$router.push({ query: {} });
  807. this.selectDate = '';
  808. this.listQuery = {
  809. page: 1,
  810. size: 10,
  811. current: 1,
  812. // 节点code
  813. nodeCode: null,
  814. // 客户经理id
  815. clientManagerId: this.$store.getters.userInfo.id,
  816. // 项目负责人id
  817. principalId: null,
  818. // 业务类型
  819. assetsBusinessGener: null,
  820. // 关键字
  821. keyWord: null,
  822. // 送达状态
  823. delivery: null,
  824. };
  825. this.selectMyOrderPage();
  826. },
  827. // 获取所有用户下拉列表
  828. getAllUser() {
  829. this.$api.user.simpleAll().then((res) => {
  830. if (res.code === 200) {
  831. this.allUsers = res.data;
  832. }
  833. });
  834. },
  835. orderDetail(row) {
  836. const newRow = {
  837. assetsId: row.assetsId,
  838. statementNo: row.statementNo,
  839. reportNo: row.reportNo,
  840. };
  841. this.$router.push({
  842. path: '/assets/orderDetail',
  843. query: {
  844. row: JSON.stringify(newRow),
  845. back: '/assets/myOrderList',
  846. couldEdit: false,
  847. couldBack: false,
  848. disabledStatus: true,
  849. },
  850. });
  851. },
  852. openShouldAmountDialog(row) {
  853. this.shouldAmountDialog = true;
  854. this.fund.id = row.orderFundId;
  855. this.fund.businessType = 'ASSET_BUSINESS';
  856. this.fund.businessId = row.assetsId;
  857. this.fund.orderFundId = row.orderFundId;
  858. this.fund.shouldAmount = row.shouldAmount;
  859. this.fund.remark = row.remark;
  860. this.fund.orderId = row.orderId;
  861. this.fund.orderName = row.name;
  862. },
  863. stateStyle(state) {
  864. if (state === '已开票') {
  865. return 'color:green';
  866. } else {
  867. return 'color:red';
  868. }
  869. },
  870. openProShouldAmountDialog(row) {
  871. if (row.orderFundId !== null) {
  872. this.proShouldAmountDialog = true;
  873. this.productionFundFrom.id = row.productionFundId;
  874. this.productionFundFrom.businessType = 'ASSET_BUSINESS';
  875. this.productionFundFrom.businessId = row.assetsId;
  876. this.productionFundFrom.orderFundId = row.orderFundId;
  877. this.productionFundFrom.productionNo = row.reportNo;
  878. this.productionFundFrom.productionShouldAmount = row.productionShouldAmount;
  879. if (row.reportNo.includes('川友评报字')) {
  880. this.productionFundFrom.productionType = 'REPORT';
  881. } else if (row.reportNo.includes('川友咨报字')) {
  882. this.productionFundFrom.productionType = 'CONSULT';
  883. } else if (row.reportNo.includes('川友字')) {
  884. this.productionFundFrom.productionType = 'LETTER';
  885. } else {
  886. this.productionFundFrom.productionType = 'STATEMENT';
  887. }
  888. this.productionFundFrom.productionShouldAmount = row.productionShouldAmount;
  889. this.productionFundFrom.remark = row.remark;
  890. } else {
  891. this.$notify({
  892. title: '警告',
  893. message: '需要先填写订单应收款',
  894. type: 'error',
  895. duration: 3000,
  896. });
  897. }
  898. },
  899. saveShouldAmount() {
  900. this.$refs.fund.validate((valid) => {
  901. if (valid) {
  902. if (this.fund.orderFundId) {
  903. this.$api.orderFund.edit(this.fund).then((res) => {
  904. if (res.code === 200 && res.data) {
  905. this.$notify({
  906. title: '成功',
  907. message: '订单应收款保存成功',
  908. type: 'success',
  909. duration: 1000,
  910. });
  911. this.selectMyOrderPage();
  912. this.shouldAmountDialog = false;
  913. } else {
  914. this.$notify({
  915. title: '失败',
  916. message: '订单应收款保存错误',
  917. type: 'error',
  918. duration: 1000,
  919. });
  920. }
  921. });
  922. } else {
  923. this.$api.orderFund.add(this.fund).then((res) => {
  924. if (res.code === 200 && res.data) {
  925. this.$notify({
  926. title: '成功',
  927. message: '订单应收款保存成功',
  928. type: 'success',
  929. duration: 1000,
  930. });
  931. this.selectMyOrderPage();
  932. this.shouldAmountDialog = false;
  933. } else {
  934. this.$notify({
  935. title: '失败',
  936. message: '订单应收款保存错误',
  937. type: 'error',
  938. duration: 1000,
  939. });
  940. }
  941. });
  942. }
  943. }
  944. });
  945. },
  946. cleanData() {
  947. this.fund.shouldAmount = null;
  948. this.fund.id = null;
  949. this.fund.businessType = null;
  950. this.fund.remark = null;
  951. this.fund.businessType = null;
  952. this.fund.businessId = null;
  953. this.fund.businessSubId = null;
  954. this.fund.productionFundId = null;
  955. this.fund.remark = null;
  956. this.fund.evaluateAmount = null;
  957. },
  958. openRepertoryOutWarehouse(row) {
  959. this.repertoryOutWarehouseVisible = true;
  960. this.outWarehouse.reportNo = row.reportNo;
  961. this.outWarehouse.businessType = 'ASSET_BUSINESS';
  962. this.businessId = row.assetsId;
  963. this.businessSubId = row.statementNo;
  964. this.businessMinId = row.reportNo;
  965. this.recordId = row.recordId;
  966. this.currentNodeId = row.currentNodeId;
  967. },
  968. // 新增出库申请
  969. addRepertoryOutWarehouse() {
  970. if (this.outWarehouse.remark !== null && this.outWarehouse.remark !== '') {
  971. let taskRecordDTO = new Object();
  972. taskRecordDTO.recordId = this.recordId;
  973. taskRecordDTO.taskData = this.outWarehouse;
  974. this.$api.productionOutWarehouse.add(taskRecordDTO).then((res) => {
  975. if (res.code === 200 && res.data) {
  976. this.$notify({
  977. title: '成功',
  978. message: '出库申请已提交',
  979. type: 'success',
  980. duration: 2000,
  981. });
  982. this.commitNode('PASS', this.outWarehouse.remark);
  983. this.repertoryOutWarehouseVisible = false;
  984. this.selectMyOrderPage();
  985. } else {
  986. this.$notify({
  987. title: '失败',
  988. message: '出库申请提交失败',
  989. type: 'error',
  990. duration: 2000,
  991. });
  992. }
  993. });
  994. } else {
  995. this.$notify({
  996. title: '警告',
  997. message: '出库原因是必填项',
  998. type: 'error',
  999. duration: 2000,
  1000. });
  1001. }
  1002. },
  1003. // 撤销出库申请
  1004. canceladdRepertoryOutWarehouse(row) {
  1005. this.$confirm('请确认是否撤销此出库申请?', '提示', {
  1006. confirmButtonText: '确定',
  1007. cancelButtonText: '取消',
  1008. type: 'warning',
  1009. center: true,
  1010. }).then(() => {
  1011. this.$api.productionOutWarehouse.detail(row.warehouseId).then((res) => {
  1012. if (res.departmentCheckState !== '审核中') {
  1013. this.$notify({
  1014. title: '警告',
  1015. message: '出库申请' + res.departmentCheckState + ',无法撤销。',
  1016. type: 'error',
  1017. duration: 2000,
  1018. });
  1019. return;
  1020. }
  1021. });
  1022. if (row.id) {
  1023. this.$api.productionOutWarehouse.cancel(row.id).then((res) => {
  1024. if (res.code === 200 && res.data) {
  1025. this.$notify({
  1026. title: '成功',
  1027. message: '出库申请已撤销',
  1028. type: 'success',
  1029. duration: 2000,
  1030. });
  1031. // 撤销成功退回节点
  1032. this.commitNode('REVERSE');
  1033. }
  1034. });
  1035. }
  1036. });
  1037. },
  1038. // 提交节点
  1039. commitNode(state, remark) {
  1040. let commit = new Object();
  1041. commit.instanceNodeId = this.currentNodeId;
  1042. commit.state = state;
  1043. commit.comments = remark;
  1044. commit.businessMinId = this.businessMinId;
  1045. commit.businessSubId = this.businessSubId;
  1046. this.$api.workflow.commit(commit).then((res) => {
  1047. if (res.code === 200 && res.data) {
  1048. this.$notify({
  1049. title: '成功',
  1050. message: '工作流节点提交成功。',
  1051. type: 'success',
  1052. duration: 2000,
  1053. });
  1054. } else {
  1055. this.$notify({
  1056. title: '失败',
  1057. message: '工作流节点提交失败,请联系管理员。',
  1058. type: 'error',
  1059. duration: 2000,
  1060. });
  1061. }
  1062. });
  1063. },
  1064. // 保存产品应收款
  1065. saveProShouldAmount() {
  1066. this.$refs.productionFundFrom.validate((valid) => {
  1067. if (valid) {
  1068. if (this.productionFundFrom.id) {
  1069. this.$api.productionFund.edit(this.productionFundFrom).then((res) => {
  1070. if (res.code === 200 && res.data) {
  1071. this.$notify({
  1072. title: '成功',
  1073. message: '产品应收款保存成功',
  1074. type: 'success',
  1075. duration: 1000,
  1076. });
  1077. this.selectMyOrderPage();
  1078. this.proShouldAmountDialog = false;
  1079. } else {
  1080. this.$notify({
  1081. title: '失败',
  1082. message: '产品应收款保存错误',
  1083. type: 'error',
  1084. duration: 1000,
  1085. });
  1086. }
  1087. });
  1088. } else {
  1089. this.$api.productionFund.add(this.productionFundFrom).then((res) => {
  1090. if (res.code === 200 && res.data) {
  1091. this.$notify({
  1092. title: '成功',
  1093. message: '产品应收款保存成功',
  1094. type: 'success',
  1095. duration: 1000,
  1096. });
  1097. this.selectMyOrderPage();
  1098. this.proShouldAmountDialog = false;
  1099. } else {
  1100. this.$notify({
  1101. title: '失败',
  1102. message: '产品应收款保存错误',
  1103. type: 'error',
  1104. duration: 1000,
  1105. });
  1106. }
  1107. });
  1108. }
  1109. }
  1110. });
  1111. },
  1112. // 标记产品送达
  1113. markDelivery(row) {
  1114. if (row.productionShouldAmount) {
  1115. this.$api.assets.markDelivery(row.reportNo).then((res) => {
  1116. if (res.code === 200 && res.data) {
  1117. this.$notify({
  1118. title: '成功',
  1119. message: '标记送达成功!',
  1120. type: 'success',
  1121. duration: 1000,
  1122. });
  1123. this.selectMyOrderPage();
  1124. }
  1125. });
  1126. } else {
  1127. this.$notify({
  1128. title: '错误',
  1129. message: '标记送达前需填写产品应收款!',
  1130. type: 'error',
  1131. duration: 1000,
  1132. });
  1133. }
  1134. },
  1135. // 打开分配弹窗
  1136. openAllotProductionDialog(row) {
  1137. if (!row.realAmount) {
  1138. this.$notify({
  1139. title: '提示',
  1140. message: '该订单还没有认领实收款,请先认领实收款后再分配给产品。',
  1141. type: 'info',
  1142. duration: 3000,
  1143. });
  1144. return;
  1145. }
  1146. this.getProductionFundByOrderFundId(row.orderFundId);
  1147. this.orderProduction.orderId = row.orderId;
  1148. this.orderProduction.orderName = row.name;
  1149. this.orderProduction.realAmount = row.realAmount;
  1150. this.orderProduction.orderFundId = row.orderFundId;
  1151. this.allotAmountDialog = true;
  1152. },
  1153. getProductionFundByOrderFundId(orderFundId) {
  1154. if (orderFundId) {
  1155. this.$api.assetsProduction.getProductionFundByOrderFundId(orderFundId).then((res) => {
  1156. if (res.code === 200) {
  1157. this.orderProduction.reports = res.data;
  1158. let allotAmount = res.data
  1159. .map((item) => item.claimedAmount)
  1160. .reduce(function (prev, cur) {
  1161. return prev + cur;
  1162. }, 0);
  1163. this.notAllotAmount = this.orderProduction.realAmount - allotAmount;
  1164. this.allotAmountDialog = true;
  1165. }
  1166. });
  1167. }
  1168. },
  1169. allotOrderRealAmountToProduction() {
  1170. this.$api.assetsProduction.allotOrderRealAmountToProduction(this.orderProduction).then((res) => {
  1171. if (res.code === 200 && res.data) {
  1172. this.$notify({
  1173. title: '成功',
  1174. message: '实收款分配成功',
  1175. type: 'success',
  1176. duration: 2000,
  1177. });
  1178. this.allotAmountDialog = false;
  1179. this.selectMyOrderPage();
  1180. } else {
  1181. this.$notify({
  1182. title: '失败',
  1183. message: '实收款分配失败',
  1184. type: 'error',
  1185. duration: 2000,
  1186. });
  1187. }
  1188. });
  1189. },
  1190. editOrder(row) {
  1191. this.$router.push({
  1192. path: '/assets/editOrder',
  1193. query: {
  1194. row: JSON.stringify(row),
  1195. back: '/assets/myOrderList',
  1196. couldEdit: true,
  1197. couldBack: true,
  1198. disabledStatus: false,
  1199. },
  1200. });
  1201. },
  1202. openFinanceInvoiceDialog(orderFundId, productionFundId, realAmount, clientName, clientSubName) {
  1203. if (!orderFundId) {
  1204. this.$notify({
  1205. title: '提示',
  1206. message: '请先完善应收款,再操作。',
  1207. type: 'info',
  1208. duration: 2000,
  1209. });
  1210. return;
  1211. }
  1212. this.makeInvoiceListDialog = true;
  1213. if (orderFundId) {
  1214. this.invoice.orderFundId = orderFundId;
  1215. this.invoice.productionFundId = productionFundId;
  1216. this.invoice.realPayAmount = realAmount;
  1217. this.invoice.title = clientName + clientSubName;
  1218. this.getFinanceInvoiceList();
  1219. }
  1220. },
  1221. getFinanceInvoiceList() {
  1222. this.$api.financeInvoice.getList(this.invoice.orderFundId, this.invoice.productionFundId).then((res) => {
  1223. if (res.code === 200) {
  1224. this.invoiceData = res.data;
  1225. }
  1226. });
  1227. },
  1228. openNewInvoiceDialog() {
  1229. this.invoice.id = null;
  1230. if (!this.invoice.orderFundId) {
  1231. this.$notify({
  1232. title: '提示',
  1233. message: '申请开票前,请先完善应收款金额。',
  1234. type: 'info',
  1235. duration: 2000,
  1236. });
  1237. return;
  1238. } else {
  1239. this.newInvoiceDialog = true;
  1240. }
  1241. },
  1242. saveInvoice() {
  1243. this.$refs.invoice.validate((valid) => {
  1244. if (valid) {
  1245. if (this.invoice.id) {
  1246. this.$api.financeInvoice.edit(this.invoice).then((res) => {
  1247. if (res.code === 200 && res.data) {
  1248. this.$notify({
  1249. title: '成功',
  1250. message: '开票申请修改成功',
  1251. type: 'success',
  1252. duration: 2000,
  1253. });
  1254. this.getFinanceInvoiceList();
  1255. this.newInvoiceDialog = false;
  1256. } else {
  1257. this.$notify({
  1258. title: '失败',
  1259. message: '开票申请修改失败',
  1260. type: 'error',
  1261. duration: 2000,
  1262. });
  1263. }
  1264. });
  1265. } else {
  1266. this.$api.financeInvoice.add(this.invoice).then((res) => {
  1267. if (res.code === 200 && res.data) {
  1268. this.$notify({
  1269. title: '成功',
  1270. message: '开票申请提交成功',
  1271. type: 'success',
  1272. duration: 2000,
  1273. });
  1274. this.getFinanceInvoiceList();
  1275. this.newInvoiceDialog = false;
  1276. } else {
  1277. this.$notify({
  1278. title: '失败',
  1279. message: '开票申请提交失败',
  1280. type: 'error',
  1281. duration: 2000,
  1282. });
  1283. }
  1284. });
  1285. }
  1286. }
  1287. });
  1288. },
  1289. invoiceDetail(id) {
  1290. this.$api.financeInvoice.detail(id).then((res) => {
  1291. if (res.code === 200) {
  1292. this.invoice = res.data;
  1293. }
  1294. });
  1295. this.newInvoiceDialog = true;
  1296. },
  1297. cancellation(id) {
  1298. this.$prompt('作废原因:', '已开发票作废', {
  1299. confirmButtonText: '确认',
  1300. cancelButtonText: '取消',
  1301. type: 'warning',
  1302. }).then(({ value }) => {
  1303. this.invoice.reason = value;
  1304. this.invoice.id = id;
  1305. this.$api.financeInvoice.cancellation(this.invoice).then((res) => {
  1306. if (res.code === 200 && res.data) {
  1307. this.$notify({
  1308. title: '成功',
  1309. message: '作废申请已提交',
  1310. type: 'success',
  1311. duration: 2000,
  1312. });
  1313. this.getFinanceInvoiceList();
  1314. } else {
  1315. this.$notify({
  1316. title: '失败',
  1317. message: '作废提交失败',
  1318. type: 'error',
  1319. duration: 2000,
  1320. });
  1321. }
  1322. });
  1323. });
  1324. },
  1325. cleanFinanceInvoiceForm() {
  1326. this.$refs.invoice.resetFields();
  1327. this.invoice = {
  1328. id: null,
  1329. orderFundId: this.invoice.orderFundId,
  1330. productionFundId: this.invoice.productionFundId,
  1331. title: null,
  1332. type: null,
  1333. taxNo: null,
  1334. planAmount: null,
  1335. planMakeDate: null,
  1336. bankName: null,
  1337. bankAccount: null,
  1338. bankAddress: null,
  1339. bankTel: null,
  1340. makeItem: null,
  1341. itemQuantity: null,
  1342. itemUnit: null,
  1343. taxRate: null,
  1344. taxAmount: null,
  1345. remark: null,
  1346. };
  1347. },
  1348. // 获取部门下拉列表
  1349. getAllotDepartment() {
  1350. this.$api.department.allot('ASSET_BUSINESS').then((res) => {
  1351. if (res.code === 200) {
  1352. this.allotDepartment = res.data;
  1353. }
  1354. });
  1355. },
  1356. copyInvoice(row) {
  1357. this.invoice = row;
  1358. this.invoice.id = null;
  1359. this.invoice.state = null;
  1360. this.invoice.reason = null;
  1361. this.invoice.created = null;
  1362. this.invoice.modified = null;
  1363. this.invoice.ticketNo = null;
  1364. this.invoice.realAmount = null;
  1365. this.invoice.realMakeDate = null;
  1366. this.newInvoiceDialog = true;
  1367. },
  1368. // 资产我的订单导出
  1369. exportMyOrder() {
  1370. this.$utils.exportUtil('/assets/exportMyOrder', this.listQuery, '导出');
  1371. },
  1372. openProductionReturnDialog(row) {
  1373. // 判断产品是否已经出库了
  1374. if (row.reportDelivery) {
  1375. // 赋值基础信息
  1376. this.productionReturnForm.businessType = 'ASSET_BUSINESS';
  1377. this.productionReturnForm.businessId = row.assetsId;
  1378. this.productionReturnForm.productionId = row.reportId;
  1379. this.productionReturnForm.name = row.name;
  1380. this.productionReturnForm.orderId = row.orderId;
  1381. this.productionReturnForm.productionNo = row.reportNo;
  1382. this.productionReturnForm.productionType = row.reportType;
  1383. this.productionReturnForm.clientName = row.customerName;
  1384. this.productionReturnForm.clientSubName = row.customerSubName;
  1385. this.productionReturnForm.bailor = row.bailor;
  1386. // 打开dialog
  1387. this.productionReturnDialog = true;
  1388. } else {
  1389. this.$notify({
  1390. title: '警告',
  1391. message: '产品未标记送达,无法发起产品退回流程!',
  1392. type: 'warning',
  1393. duration: 2000,
  1394. });
  1395. }
  1396. },
  1397. // 发起产品退回流程
  1398. saveProductionreturn() {
  1399. this.$refs.productionReturnForm.validate((valid) => {
  1400. if (valid) {
  1401. this.$api.productionReturn.save(this.productionReturnForm).then((res) => {
  1402. if (res.code === 200) {
  1403. this.$notify({
  1404. title: '成功',
  1405. message: '产品退回申请流程已发起!',
  1406. type: 'success',
  1407. duration: 2000,
  1408. });
  1409. this.productionReturnDialog = false;
  1410. }
  1411. });
  1412. }
  1413. });
  1414. },
  1415. // 重置表单
  1416. resetProductionReturnForm() {
  1417. this.$refs.productionReturnForm.resetFields();
  1418. },
  1419. // 打开订单投诉
  1420. openComplaintDialog(row) {
  1421. this.complaintDataDialog = true;
  1422. this.complaintInfo = row;
  1423. this.complaintQuery.businessId = row.assetsId;
  1424. this.complaintQuery.orderId = row.orderId;
  1425. this.$api.assetsComplaint.list(this.complaintQuery).then((res) => {
  1426. this.complaintData = res.data;
  1427. });
  1428. },
  1429. // 打开新增投诉dialog
  1430. openComplaintFormDialog() {
  1431. this.complaintFormDialog = true;
  1432. this.complaintForm.businessId = this.complaintInfo.assetsId;
  1433. this.complaintForm.orderId = this.complaintInfo.orderId;
  1434. this.complaintForm.respondentId = this.complaintInfo.principalId;
  1435. this.complaintForm.complainantId = this.complaintInfo.clientManagerId;
  1436. },
  1437. saveComplaint() {
  1438. this.$refs.complaintForm.validate((valid) => {
  1439. if (valid) {
  1440. this.$api.assetsComplaint.add(this.complaintForm).then((res) => {
  1441. if (res.code === 200 && res.data) {
  1442. this.$notify({
  1443. title: '成功',
  1444. message: '投诉成功,待领导确认。',
  1445. type: 'success',
  1446. duration: 2000,
  1447. });
  1448. this.complaintFormDialog = false;
  1449. this.$api.assetsComplaint.list(this.complaintQuery).then((res) => {
  1450. this.complaintData = res.data;
  1451. });
  1452. } else {
  1453. this.$notify({
  1454. title: '失败',
  1455. message: '提交失败,请联系管理员。',
  1456. type: 'error',
  1457. duration: 2000,
  1458. });
  1459. }
  1460. });
  1461. }
  1462. });
  1463. },
  1464. },
  1465. };
  1466. </script>
  1467. <style lang="scss" scoped></style>