myOrderList.vue 72 KB

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