myOrderList.vue 66 KB

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