myOrder.vue 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238
  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="getPage">
  7. <template slot="left">
  8. <el-col :xs="24" :sm="12" :lg="2" :span="6">
  9. <PermissionButton menu-code="_views_personal_order" class-name="filter-item" type="danger" icon="el-icon-circle-plus-outline"
  10. :page-jump="true" round style="position: absolute;right: 30px;z-index:9" :page-query="{'couldEdit':true,'saveOrderBtn':'保存订单','showBtn':true ,'couldBack':true}" />
  11. </el-col>
  12. <MoreSearchBar business="PERSONAL_BUSINESS" @fliterSearch="fliterSearch" @resetParams="resetParams" :listQuery="listQuery"
  13. :nodeCode="false" :clientManager="false" :outwardStaffName="false" :inwardStaffName="false" :pricingStaffName="false" :handlerName="false">
  14. <template v-slot:otherButton>
  15. <el-button class="filter-item" round type="success" @click="exportMyOrder()" :disabled="!listQuery.startDate && !listQuery.endDate">导出
  16. </el-button>
  17. <el-button class="filter-item" round @click="showAllLabel()">显示全部列</el-button>
  18. </template>
  19. </MoreSearchBar>
  20. </template>
  21. <parentTable ref="table" v-loading="listLoading" @headerClick="switchHeader" :data="pageData.records" slot="table" style="width: 100%;" >
  22. <el-table-column label="坐落" align="center" width="300" show-overflow-tooltip
  23. v-if="!hiddenLabels.includes('orderName')" prop="orderName" >
  24. <template slot-scope="{row}">
  25. <span>{{ row.orderName }}</span>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="项目编号" align="center" width="130"
  29. v-if="!hiddenLabels.includes('orderId')" prop="orderId" >
  30. <template slot-scope="{row}">
  31. <span>{{ row.orderId }}</span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="面积" align="center" width="130"
  35. v-if="!hiddenLabels.includes('acreage')" prop="acreage" >
  36. <template slot-scope="{row}">
  37. <span>{{ row.acreage?row.acreage:'-' }}</span>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="单价" align="center" width="130"
  41. v-if="!hiddenLabels.includes('price')" prop="price" >
  42. <template slot-scope="{row}">
  43. <span>{{ row.price?row.price:'-' }}</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="总价" align="center" width="130"
  47. v-if="!hiddenLabels.includes('amount')" prop="amount" >
  48. <template slot-scope="{row}">
  49. <span>{{ row.amount?row.amount:'-' }}</span>
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="客户名称" align="center" width="130"
  53. v-if="!hiddenLabels.includes('clientName')" prop="clientName" >
  54. <template slot-scope="{row}">
  55. <span>{{ row.clientName==null?'-': row.clientName }}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="业务来源" align="center" width="130"
  59. v-if="!hiddenLabels.includes('clientSubName')" prop="clientSubName" >
  60. <template slot-scope="{row}">
  61. <span>{{ row.clientSubName }}</span>
  62. </template>
  63. </el-table-column>
  64. <el-table-column label="中介" align="center" width="130"
  65. v-if="!hiddenLabels.includes('agent')" prop="agent" >
  66. <template slot-scope="{row}">
  67. <span>{{ row.agent==null?'-': row.agent }}</span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column label="联系人" align="center" width="130"
  71. v-if="!hiddenLabels.includes('contactName')" prop="contactName" >
  72. <template slot-scope="{row}">
  73. <span>{{ row.contactName}}</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="联系人电话" align="center" width="130"
  77. v-if="!hiddenLabels.includes('contactTel')" prop="contactTel" >
  78. <template slot-scope="{row}">
  79. <span>{{ row.contactTel }}</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="委托人" align="center"
  83. v-if="!hiddenLabels.includes('bailorA')" prop="bailorA" >
  84. <template slot-scope="{row}">
  85. <span>{{ row.bailorA}} {{ row.bailorB}}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="实收款(元)" align="center" width='120'
  89. v-if="!hiddenLabels.includes('realAmount')" prop="realAmount" >
  90. <template slot-scope="{row}">
  91. <span style="color:red;font-weight:bold">{{ row.realAmount }}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column label="应收款(元)" align="center" width='120'
  95. v-if="!hiddenLabels.includes('shouldAmount')" prop="shouldAmount" >
  96. <template slot-scope="{row}">
  97. <span>{{ row.shouldAmount }}</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="开票金额(元)" align="center" width='120'
  101. v-if="!hiddenLabels.includes('invoiceAmount')" prop="invoiceAmount" >
  102. <template slot-scope="{row}">
  103. <span>{{ row.invoiceAmount }}</span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="下单时间" align="center" width="110"
  107. v-if="!hiddenLabels.includes('created')" prop="created" >
  108. <template slot-scope="{row}">
  109. {{ row.created }}
  110. </template>
  111. </el-table-column>
  112. <el-table-column fixed="right" label="操作" width="200" align="center">
  113. <template slot-scope="{row}">
  114. <el-button type="text" size="small" @click="orderDetail(row)">详情</el-button>
  115. <el-button type="text" size="small" @click="openShouldAmountDialog(row)">应收款</el-button>
  116. <el-button type="text" size="small" @click="openFinanceInvoiceDialog(row.orderFundId,row.realAmount,row.clientName,row.clientSubName)">申请开票</el-button>
  117. <el-button type="text" size="small" @click="productionList(row.id)">产品包</el-button>
  118. <el-button type="text" size="mini" @click="openProductionReturnDialog(row)">申请产品退回</el-button>
  119. </template>
  120. </el-table-column>
  121. </parentTable>
  122. </y-page-list-layout>
  123. <el-dialog :visible.sync="productionListDialog" width="60%" center custom-class="doWarehouseClass" @closed="cleanProductionListDialog()">
  124. <el-collapse v-model="activeName" accordion v-if="bag.productions.length>0">
  125. <el-collapse-item v-for="(r,index) in bag.productions" :name="index">
  126. <template slot="title">
  127. <i class="el-icon-document"></i>
  128. <span style="font-weight:bold;margin-left:10px;margin-right:10px">{{ aliasProductionType(r.production) }}</span>
  129. {{r.productionNo}}
  130. </template>
  131. <el-card style="margin-top:20px" shadow="hover">
  132. <div slot="header" class="clearfix" >
  133. <el-button v-if="(r.production!='STATEMENT' && r.repertoryState !=null && !r.repertoryState)"
  134. style="float: right; padding: 3px 0;margin-left:10px" type="text" @click="openApplyOutWarehouseList(bag.businessId)">出库申请记录</el-button>
  135. <el-button v-if="(taskId && r.production!='STATEMENT' && r.repertoryState !=null && !r.repertoryState)"
  136. style="float: right; padding: 3px 0;margin-left:10px" type="text" @click="openOutApply(bag.businessId)">出库申请</el-button>
  137. </div>
  138. <el-form :model="r">
  139. <el-row>
  140. <el-col :xs="24" :sm="12" :lg="24" :span="12">
  141. <el-form-item label="项目名称:" prop="name" label-width="140px" class="postInfo-container-item">
  142. <el-input :value="r.name" type="text" class="filter-item" disabled readonly/>
  143. </el-form-item >
  144. </el-col>
  145. </el-row>
  146. <el-row>
  147. <el-col :xs="24" :sm="12" :lg="8" :span="12">
  148. <el-form-item label="出具报告日期:" prop="createDate" label-width="140px" class="postInfo-container-item">
  149. <el-input :value="r.createDate" type="text" class="filter-item" disabled readonly />
  150. </el-form-item >
  151. </el-col>
  152. <el-col :xs="24" :sm="12" :lg="8" :span="12">
  153. <el-form-item label="实勘日期:" prop="sceneDate" label-width="140px" class="postInfo-container-item">
  154. <el-input :value="r.sceneDate" type="text" class="filter-item" disabled readonly />
  155. </el-form-item >
  156. </el-col>
  157. <el-col :xs="24" :sm="12" :lg="8" :span="12">
  158. <el-form-item label="报告使用期限:" prop="repertoryOutTime" label-width="140px" class="postInfo-container-item">
  159. <el-input :value="r.limitDate" type="text" class="filter-item" disabled readonly />
  160. </el-form-item >
  161. </el-col>
  162. </el-row>
  163. <el-row>
  164. <el-col :xs="24" :sm="12" :lg="8" :span="12">
  165. <el-form-item label="评估总价:" prop="evaluateAmount" label-width="140px" class="postInfo-container-item">
  166. <el-input :value="r.evaluateAmount/10000" type="text" class="filter-item" disabled readonly>
  167. <template slot="append">万元</template>
  168. </el-input>
  169. </el-form-item >
  170. </el-col>
  171. <el-col :xs="24" :sm="12" :lg="8" :span="12">
  172. <el-form-item label="评估面积:" prop="evaluateAcreage" label-width="140px" class="postInfo-container-item">
  173. <el-input :value="r.evaluateAcreage" type="text" class="filter-item" disabled readonly>
  174. <template slot="append">平方</template>
  175. </el-input>
  176. </el-form-item >
  177. </el-col>
  178. <el-col :xs="24" :sm="12" :lg="8" :span="12">
  179. <el-form-item label="评估单价:" prop="evaluatePrice" label-width="140px" class="postInfo-container-item">
  180. <el-input :value="r.evaluatePrice/10000" type="text" class="filter-item" disabled readonly>
  181. <template slot="append">万元</template>
  182. </el-input>
  183. </el-form-item >
  184. </el-col>
  185. </el-row>
  186. <el-row>
  187. <el-col :xs="24" :sm="12" :lg="8" :span="12">
  188. <el-form-item label="库存状态:" prop="repertoryState" label-width="140px" class="postInfo-container-item">
  189. <el-input :value="r.repertoryState==null?'未入库':(r.repertoryState?'已出库':'已入库')" type="text" class="filter-item" disabled readonly />
  190. </el-form-item >
  191. </el-col>
  192. <el-col :xs="24" :sm="12" :lg="8" :span="12">
  193. <el-form-item label="入库时间:" prop="repertoryInTime" label-width="140px" class="postInfo-container-item">
  194. <el-input :value="r.repertoryInTime" type="text" class="filter-item" disabled readonly />
  195. </el-form-item >
  196. </el-col>
  197. <el-col :xs="24" :sm="12" :lg="8" :span="12">
  198. <el-form-item label="出库时间:" prop="repertoryOutTime" label-width="140px" class="postInfo-container-item">
  199. <el-input :value="r.repertoryOutTime" type="text" class="filter-item" disabled readonly />
  200. </el-form-item >
  201. </el-col>
  202. </el-row>
  203. <el-row>
  204. <el-col :xs="24" :sm="12" :lg="8" :span="12">
  205. <el-form-item label="归档状态:" prop="ifSaveFile" label-width="140px" class="postInfo-container-item">
  206. <el-input :value="r.ifSaveFile?'已归档':'未归档'" type="text" class="filter-item" disabled readonly />
  207. </el-form-item >
  208. </el-col>
  209. <el-col :xs="24" :sm="12" :lg="8" :span="12">
  210. <el-form-item label="归档时间:" prop="saveFileDate" label-width="140px" class="postInfo-container-item">
  211. <el-input :value="r.saveFileDate" type="text" class="filter-item" disabled readonly />
  212. </el-form-item >
  213. </el-col>
  214. </el-row>
  215. </el-form>
  216. </el-card>
  217. </el-collapse-item>
  218. </el-collapse>
  219. <el-empty v-else description="暂无产品"></el-empty>
  220. </el-dialog>
  221. <el-dialog :visible.sync="outWarehouseListDialog" width="70%" center custom-class="doWarehouseClass" >
  222. <div style="margin-top:30px;">
  223. <el-table
  224. :data="outApllyList"
  225. stripe
  226. style="width: 100%">
  227. <el-table-column
  228. align = "center"
  229. prop="realAmount"
  230. label="申请时实收款金额(元)"
  231. width="180">
  232. <template slot-scope="{row}">
  233. <span style="color:red;font-weight: bold;">{{ row.realAmount==null?'未收款': row.realAmount}}</span>
  234. </template>
  235. </el-table-column>
  236. <el-table-column
  237. align = "center"
  238. prop="applyName"
  239. label="申请人">
  240. <template slot-scope="{row}">
  241. <span>{{ row.applyName }}</span>
  242. </template>
  243. </el-table-column>
  244. <el-table-column
  245. align = "center"
  246. prop="remark"
  247. label="申请原因" show-overflow-tooltip>
  248. <template slot-scope="{row}">
  249. <span>{{ row.remark==null?'-':row.remark }}</span>
  250. </template>
  251. </el-table-column>
  252. <el-table-column
  253. align = "center"
  254. prop="created"
  255. label="申请日期" width="150">
  256. <template slot-scope="{row}">
  257. <span>{{ row.created }}</span>
  258. </template>
  259. </el-table-column>
  260. <el-table-column
  261. align = "center"
  262. prop="departmentCheckState"
  263. label="部门审核状态">
  264. <template slot-scope="{row}">
  265. <span>{{ row.departmentCheckState==null?'-':row.departmentCheckState }}</span>
  266. </template>
  267. </el-table-column>
  268. <el-table-column
  269. align = "center"
  270. prop="departmentChecker"
  271. label="部门审核人">
  272. <template slot-scope="{row}">
  273. <span>{{ row.departmentChecker==null?'-':row.departmentChecker }}</span>
  274. </template>
  275. </el-table-column>
  276. <el-table-column
  277. align = "center"
  278. prop="departmentCheckTime"
  279. label="部门审核时间" width="150">
  280. <template slot-scope="{row}">
  281. <span>{{ row.departmentCheckTime==null?'-': row.departmentCheckTime}}</span>
  282. </template>
  283. </el-table-column>
  284. <el-table-column
  285. align = "center"
  286. prop="departmentReply"
  287. label="部门审核回复" show-overflow-tooltip>
  288. <template slot-scope="{row}">
  289. <span>{{ row.departmentReply==null?'-':row.departmentReply }}</span>
  290. </template>
  291. </el-table-column>
  292. <!-- <el-table-column
  293. align = "center"
  294. prop="financeCheckState"
  295. label="财务审核状态">
  296. <template slot-scope="{row}">
  297. <span>{{ row.financeCheckState==null?'-':row.financeCheckState }}</span>
  298. </template>
  299. </el-table-column>
  300. <el-table-column
  301. align = "center"
  302. prop="financeChecker"
  303. label="财务审核人">
  304. <template slot-scope="{row}">
  305. <span>{{ row.financeChecker==null?'-':row.financeChecker }}</span>
  306. </template>
  307. </el-table-column>
  308. <el-table-column
  309. align = "center"
  310. prop="financeCheckTime"
  311. label="财务审核时间" width="150">
  312. <template slot-scope="{row}">
  313. <span>{{ row.financeCheckTime==null?'-':row.financeCheckTime }}</span>
  314. </template>
  315. </el-table-column>
  316. <el-table-column
  317. align = "center"
  318. prop="financeReply"
  319. label="财务审核回复" show-overflow-tooltip>
  320. <template slot-scope="{row}">
  321. <span>{{ row.financeReply==null?'-':row.financeReply }}</span>
  322. </template>
  323. </el-table-column> -->
  324. <!-- <el-table-column fixed="right" label="操作" width="100" align = "center">
  325. <template slot-scope="{row}">
  326. <el-button @click="outApplyCancel(row.id,row.productionId,row.financeCheckState)" type="text" size="small">撤销</el-button>
  327. </template>
  328. </el-table-column> -->
  329. </el-table>
  330. </div>
  331. </el-dialog>
  332. <el-dialog :visible.sync="outWarehouseDialog" width="35%" center top="35vh" custom-class="doWarehouseClass" >
  333. <el-form ref="outWarehouse" :model="outWarehouse" style="margin-left:40px" :rules="rules">
  334. <el-row>
  335. <el-col :xs="24" :sm="12" :lg="24" :span="12">
  336. <el-form-item label="应收款金额:" prop="shouldAmount" label-width="160px" class="postInfo-container-item">
  337. <el-input style="width:300px" v-model="outWarehouse.shouldAmount" type="text" class="filter-item" />
  338. </el-form-item >
  339. </el-col>
  340. </el-row>
  341. <el-row>
  342. <el-col :xs="24" :sm="12" :lg="24" :span="12">
  343. <el-form-item label="出库原因:" prop="remark" label-width="160px" class="postInfo-container-item">
  344. <el-input style="width:300px" type="textarea" v-model="outWarehouse.remark"></el-input>
  345. </el-form-item>
  346. </el-col>
  347. </el-row>
  348. </el-form>
  349. <span slot="footer" class="dialog-footer">
  350. <el-button @click="outWarehouseDialog = false">取 消</el-button>
  351. <el-button type="primary" @click="doApplyOut()">确 定</el-button>
  352. </span>
  353. </el-dialog>
  354. <el-dialog :visible.sync="shouldAmountDialog" width="35%" center top="35vh" custom-class="doWarehouseClass"
  355. @closed="cleanData">
  356. <el-form ref="fund" :model="fund" style="margin-left:40px">
  357. <el-row>
  358. <el-col :xs="24" :sm="12" :lg="24" :span="12">
  359. <el-form-item label="应收款金额(元):" prop="shouldAmount" label-width="160px" class="postInfo-container-item"
  360. :rules="{ required: true, message: '应收款金额不能为空', trigger: 'blur' }">
  361. <el-input-number :precision="2" :min="null" :value-on-clear="0" v-model.number="fund.shouldAmount"
  362. type="number" style="width:300px" class="filter-item" />
  363. </el-form-item>
  364. </el-col>
  365. </el-row>
  366. <el-row>
  367. <el-col :xs="24" :sm="12" :lg="24" :span="12">
  368. <el-form-item label="备注:" prop="remark" label-width="160px" class="postInfo-container-item">
  369. <el-input style="width:300px" type="textarea" v-model="fund.remark"></el-input>
  370. </el-form-item>
  371. </el-col>
  372. </el-row>
  373. </el-form>
  374. <span slot="footer" class="dialog-footer">
  375. <el-button @click="shouldAmountDialog = false">取 消</el-button>
  376. <el-button type="primary" @click="saveShouldAmount()">确 定</el-button>
  377. </span>
  378. </el-dialog>
  379. <el-dialog :visible.sync="makeInvoiceListDialog" width="90%" center custom-class="doWarehouseClass">
  380. <el-button type="danger" round @click="openNewInvoiceDialog">申请开票</el-button>
  381. <div style="margin-top:30px;">
  382. <el-table :data="invoiceData" stripe :header-row-style="{ color: '#333333', 'font-size': '14px' }" border
  383. style="width: 100%; margin-top:20px;font-size: 14px;">
  384. <el-table-column align="center" prop="title" label="发票抬头" width="180">
  385. </el-table-column>
  386. <el-table-column align="center" prop="taxNo" label="税号" width="180">
  387. </el-table-column>
  388. <el-table-column align="center" prop="type" label="发票类型">
  389. </el-table-column>
  390. <el-table-column align="center" prop="state" label="开票状态">
  391. <template slot-scope="{row}">
  392. <span :style="stateStyle(row.state)">{{ row.state }}</span>
  393. </template>
  394. </el-table-column>
  395. <el-table-column align="center" prop="planAmount" label="计划开票金额">
  396. </el-table-column>
  397. <el-table-column align="center" prop="planMakeDate" label="计划开票日期">
  398. </el-table-column>
  399. <el-table-column align="center" prop="realAmount" label="实际开票金额">
  400. </el-table-column>
  401. <el-table-column align="center" prop="realMakeDate" label="实际开票日期">
  402. </el-table-column>
  403. <el-table-column align="center" prop="reason" label="驳回/作废原因">
  404. </el-table-column>
  405. <el-table-column align="center" prop="remark" label="备注">
  406. </el-table-column>
  407. <el-table-column fixed="right" label="操作" width="200" align="center">
  408. <template slot-scope="{row}">
  409. <el-button :disabled="row.state != '审核中'" @click="invoiceDetail(row.id)" type="text" size="small">修改</el-button>
  410. <el-button :disabled="row.state != '已开票'" @click="cancellation(row.id)" type="text" size="small">申请作废</el-button>
  411. <el-button @click="copyInvoice(row)" type="text" size="small">复制</el-button>
  412. </template>
  413. </el-table-column>
  414. </el-table>
  415. </div>
  416. </el-dialog>
  417. <el-dialog :visible.sync="newInvoiceDialog" width="55%" top="10vh" center custom-class="doWarehouseClass"
  418. @closed="cleanFinanceInvoiceForm">
  419. <el-form ref="invoice" :model="invoice">
  420. <el-divider content-position="left">开票信息</el-divider>
  421. <el-row>
  422. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  423. <el-form-item label="发票抬头:" :rules="{ required: true, message: '发票抬头不能为空', trigger: 'blur' }" prop="title"
  424. label-width="140px" class="postInfo-container-item">
  425. <el-input v-model.trim="invoice.title" class="filter-item" />
  426. </el-form-item>
  427. </el-col>
  428. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  429. <el-form-item label="发票类型:" :rules="{ required: true, message: '发票类型不能为空', trigger: 'blur' }" prop="type"
  430. label-width="140px" class="postInfo-container-item">
  431. <el-select v-model="invoice.type" style="width:100%">
  432. <el-option label="普票" value="普票"></el-option>
  433. <el-option label="专票" value="专票"></el-option>
  434. </el-select>
  435. </el-form-item>
  436. </el-col>
  437. </el-row>
  438. <el-row>
  439. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  440. <el-form-item label="税号:" :rules="{ required: true, message: '税号不能为空', trigger: 'blur' }" prop="taxNo"
  441. label-width="140px" class="postInfo-container-item">
  442. <el-input v-model.trim="invoice.taxNo" class="filter-item" />
  443. </el-form-item>
  444. </el-col>
  445. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  446. <el-form-item label="计划开票日期:" prop="planMakeDate"
  447. :rules="{ required: true, message: '计划开票日期不能为空', trigger: 'blur' }" label-width="140px"
  448. class="postInfo-container-item">
  449. <el-date-picker v-model="invoice.planMakeDate" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" style="width:100%">
  450. </el-date-picker>
  451. </el-form-item>
  452. </el-col>
  453. </el-row>
  454. <el-row>
  455. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  456. <el-form-item label="待开金额(元):" prop="planAmount"
  457. :rules="{ required: true, message: '待开金额不能为空', trigger: 'blur' }" label-width="140px"
  458. class="postInfo-container-item">
  459. <el-input-number :precision="2" :min="0" :value-on-clear="0" v-model.number="invoice.planAmount"
  460. type="number" style="width:100%" class="filter-item" />
  461. </el-form-item>
  462. </el-col>
  463. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  464. <el-form-item label="是否收款:" label-width="140px"
  465. class="postInfo-container-item">
  466. <el-radio-group :value="invoice.realPayAmount?'已收款':'未收款'">
  467. <el-radio label="已收款"></el-radio>
  468. <el-radio label="未收款"></el-radio>
  469. </el-radio-group>
  470. </el-form-item>
  471. </el-col>
  472. </el-row>
  473. <el-row>
  474. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  475. <el-form-item label="开票项目:" prop="makeItem" label-width="140px" class="postInfo-container-item">
  476. <el-input v-model.trim="invoice.makeItem" class="filter-item" />
  477. </el-form-item>
  478. </el-col>
  479. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  480. <el-form-item label="项目数量:" prop="itemQuantity" label-width="140px" class="postInfo-container-item">
  481. <el-input v-model.trim="invoice.itemQuantity" class="filter-item" />
  482. </el-form-item>
  483. </el-col>
  484. </el-row>
  485. <el-row>
  486. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  487. <el-form-item label="计量单位:" prop="itemUnit" label-width="140px" class="postInfo-container-item">
  488. <el-input v-model.trim="invoice.itemUnit" class="filter-item" placeholder="个/套/箱/次/斤/公斤/..." />
  489. </el-form-item>
  490. </el-col>
  491. </el-row>
  492. <el-row>
  493. <el-col :xs="24" :sm="12" :lg="24" :span="6">
  494. <el-form-item label="备注:" prop="remark" label-width="140px" class="postInfo-container-item">
  495. <el-input v-model.trim="invoice.remark" type="textarea" :autosize="{ minRows: 5, maxRows: 8}" class="filter-item" />
  496. </el-form-item>
  497. </el-col>
  498. </el-row>
  499. <!-- <el-divider content-position="left">银行信息</el-divider>
  500. <el-row>
  501. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  502. <el-form-item label="开户行:" prop="bankName" label-width="140px" class="postInfo-container-item">
  503. <el-input v-model.trim="invoice.bankName" class="filter-item" />
  504. </el-form-item>
  505. </el-col>
  506. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  507. <el-form-item label="银行账号:" prop="bankAccount" label-width="140px" class="postInfo-container-item">
  508. <el-input v-model.trim="invoice.bankAccount" class="filter-item" />
  509. </el-form-item>
  510. </el-col>
  511. </el-row>
  512. <el-row>
  513. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  514. <el-form-item label="地址:" prop="bankAddress" label-width="140px" class="postInfo-container-item">
  515. <el-input v-model.trim="invoice.bankAddress" class="filter-item" />
  516. </el-form-item>
  517. </el-col>
  518. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  519. <el-form-item label="电话:" prop="bankTel" label-width="140px" class="postInfo-container-item">
  520. <el-input v-model.trim="invoice.bankTel" class="filter-item" />
  521. </el-form-item>
  522. </el-col>
  523. </el-row> -->
  524. <!-- <el-divider content-position="left">发票信息</el-divider>
  525. <el-row>
  526. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  527. <el-form-item label="发票号码:" prop="ticketNo" label-width="140px" class="postInfo-container-item">
  528. <el-input :value="invoice.ticketNo" class="filter-item" readonly disabled/>
  529. </el-form-item>
  530. </el-col>
  531. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  532. <el-form-item label="实开金额(元):" prop="realAmount" label-width="140px" class="postInfo-container-item">
  533. <el-input :value="invoice.realAmount" class="filter-item" readonly disabled/>
  534. </el-form-item>
  535. </el-col>
  536. </el-row>
  537. <el-row>
  538. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  539. <el-form-item label="申请日期:" prop="created" label-width="140px" class="postInfo-container-item">
  540. <el-input :value="invoice.created" class="filter-item" readonly disabled/>
  541. </el-form-item>
  542. </el-col>
  543. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  544. <el-form-item label="实开日期:" prop="realMakeDate" label-width="140px" class="postInfo-container-item">
  545. <el-input :value="invoice.realMakeDate" class="filter-item" readonly disabled/>
  546. </el-form-item>
  547. </el-col>
  548. </el-row>
  549. <el-row>
  550. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  551. <el-form-item label="订单类型:" prop="businessType" label-width="140px" class="postInfo-container-item">
  552. <el-input :value="invoice.businessType" class="filter-item" readonly disabled/>
  553. </el-form-item>
  554. </el-col>
  555. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  556. <el-form-item label="开票人:" prop="applyName" label-width="140px" class="postInfo-container-item">
  557. <el-input :value="invoice.applyName" class="filter-item" readonly disabled/>
  558. </el-form-item>
  559. </el-col>
  560. </el-row>
  561. <el-row>
  562. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  563. <el-form-item label="订单编号:" prop="orderId" label-width="140px" class="postInfo-container-item">
  564. <el-input :value="invoice.orderId" class="filter-item" readonly disabled/>
  565. </el-form-item>
  566. </el-col>
  567. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  568. <el-form-item label="产品号:" prop="productionNo" label-width="140px" class="postInfo-container-item">
  569. <el-input :value="invoice.productionNo" class="filter-item" readonly disabled/>
  570. </el-form-item>
  571. </el-col>
  572. </el-row> -->
  573. <!-- <el-row>
  574. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  575. <el-form-item label="税点:" prop="taxRate" label-width="140px" class="postInfo-container-item">
  576. <el-input-number :precision="2" :min="0" :value-on-clear="0" v-model.number="invoice.taxRate" type="number"
  577. style="width:206px" class="filter-item" />
  578. </el-form-item>
  579. </el-col>
  580. <el-col :xs="24" :sm="12" :lg="6" :span="6">
  581. <el-form-item label="税额:" prop="taxAmount" label-width="140px" class="postInfo-container-item">
  582. <el-input-number :precision="2" :min="0" :value-on-clear="0" v-model.number="invoice.taxAmount"
  583. type="number" style="width:206px" class="filter-item" />
  584. </el-form-item>
  585. </el-col>
  586. </el-row> -->
  587. </el-form>
  588. <span slot="footer" class="dialog-footer">
  589. <el-button @click="newInvoiceDialog = false">取 消</el-button>
  590. <el-button type="primary" @click="saveInvoice()">确 定</el-button>
  591. </span>
  592. </el-dialog>
  593. <el-dialog :visible.sync="productionReturnDialog" width="55%" center @closed="resetProductionReturnForm()">
  594. <el-form ref="productionReturnForm" :model="productionReturnForm" :rules="productionReturnFormRules">
  595. <el-divider content-position="left">申请产品退回</el-divider>
  596. <el-row>
  597. <el-col :xs="24" :sm="24" :lg="24" :span="6">
  598. <el-form-item label="项目名称:" prop="name" label-width="140px" class="postInfo-container-item">
  599. <el-input v-model.trim="productionReturnForm.name" class="filter-item" disabled />
  600. </el-form-item>
  601. </el-col>
  602. </el-row>
  603. <el-row>
  604. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  605. <el-form-item label="项目编号:" prop="orderId" label-width="140px" class="postInfo-container-item">
  606. <el-input v-model.trim="productionReturnForm.orderId" class="filter-item" disabled />
  607. </el-form-item>
  608. </el-col>
  609. </el-row>
  610. <el-row>
  611. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  612. <el-form-item label="客户名称:" prop="clientName" label-width="140px" class="postInfo-container-item">
  613. <el-input v-model.trim="productionReturnForm.clientName" class="filter-item" disabled />
  614. </el-form-item>
  615. </el-col>
  616. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  617. <el-form-item label="业务来源:" prop="clientSubName" label-width="140px" class="postInfo-container-item">
  618. <el-input v-model.trim="productionReturnForm.clientSubName" class="filter-item" disabled />
  619. </el-form-item>
  620. </el-col>
  621. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  622. <el-form-item label="委托人:" prop="bailor" label-width="140px" class="postInfo-container-item">
  623. <el-input v-model.trim="productionReturnForm.bailor" class="filter-item" disabled />
  624. </el-form-item>
  625. </el-col>
  626. </el-row>
  627. <el-row>
  628. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  629. <el-form-item label="退产品原因:" prop="returnReason" label-width="140px" class="postInfo-container-item">
  630. <el-input v-model.trim="productionReturnForm.returnReason" class="filter-item" />
  631. </el-form-item>
  632. </el-col>
  633. <el-col :xs="24" :sm="12" :lg="12" :span="6">
  634. <el-form-item label="是否退发票:" prop="returnInvoice" label-width="140px" class="postInfo-container-item">
  635. <el-select v-model="productionReturnForm.returnInvoice" style="width: 100%">
  636. <el-option label="退发票" value="true"></el-option>
  637. <el-option label="不退发票" value="false"></el-option>
  638. </el-select>
  639. </el-form-item>
  640. </el-col>
  641. </el-row>
  642. </el-form>
  643. <span slot="footer" class="dialog-footer">
  644. <el-button @click="productionReturnDialog = false">取 消</el-button>
  645. <el-button type="primary" @click="saveProductionreturn()">确 定</el-button>
  646. </span>
  647. </el-dialog>
  648. </div>
  649. </template>
  650. <script>
  651. import YPageListLayout from '@/components/YPageListLayout'
  652. import Breadcrumb from '@/components/Breadcrumb'
  653. import PermissionButton from '@/components/PermissionButton/PermissionButton'
  654. import {isNumber} from '@/utils/validate'
  655. import MoreSearchBar from '@/components/MoreSearchBar'
  656. import { getCookie, setCookie, removeCookie } from '@/utils/auth'
  657. export default {
  658. name: 'PersonalMyOrder',
  659. components: {
  660. Breadcrumb,
  661. YPageListLayout,
  662. PermissionButton,
  663. MoreSearchBar
  664. },
  665. data() {
  666. return {
  667. rules:{
  668. shouldAmount:[{required:true,message:"应收款金额必填",trigger:'blur'},{validator:isNumber,trigger:'blur'}],
  669. },
  670. pageData: { records: [] },
  671. listLoading: false,
  672. listQuery: {
  673. page: 1,
  674. size: 20,
  675. current: 1,
  676. descs: null,
  677. ascs:null,
  678. keyword:null,
  679. startDate:null,
  680. endDate:null
  681. },
  682. productionListDialog:false,
  683. bag:{
  684. businessId:null,
  685. businessType:null,
  686. productions:[]
  687. },
  688. activeName: '0',
  689. outWarehouseListDialog:false,
  690. outWarehouseDialog:false,
  691. outWarehouse:{
  692. id:null,
  693. orderFundId:null,
  694. remark:null,
  695. realAmount:null
  696. },
  697. fund: {
  698. id: null,
  699. businessType: null,
  700. orderName: null,
  701. orderId: null,
  702. shouldAmount: null,
  703. remark: null,
  704. businessType: null,
  705. businessId: null,
  706. businessSubId: null,
  707. productionFundId: null,
  708. evaluateAmount: null
  709. },
  710. outApllyList:[],
  711. shouldAmountDialog:false,
  712. makeInvoiceListDialog:false,
  713. invoice: {
  714. id: null,
  715. orderFundId: null,
  716. productionFundId: null,
  717. title: null,
  718. type: null,
  719. taxNo: null,
  720. planAmount: null,
  721. planMakeDate: null,
  722. bankName: null,
  723. bankAccount: null,
  724. bankAddress: null,
  725. bankTel: null,
  726. makeItem: null,
  727. itemQuantity: null,
  728. itemUnit: null,
  729. taxRate: null,
  730. taxAmount: null,
  731. remark: null,
  732. realPayAmount:null,
  733. realAmount:null,
  734. realMakeDate:null
  735. },
  736. newInvoiceDialog:false,
  737. invoiceData: [],
  738. hiddenLabels: [],
  739. productionReturnDialog: false,
  740. productionReturnForm: {},
  741. productionReturnFormRules: {
  742. returnReason: [{ required: true, message: '退产品原因不能为空', trigger: 'blur' }],
  743. returnInvoice: [{ required: true, message: '请选择是否退发票', trigger: 'change' }],
  744. },
  745. }
  746. },
  747. created() {
  748. if (getCookie("PersonalMineList-hiddenLabels") != undefined) {
  749. this.hiddenLabels = JSON.parse(getCookie("PersonalMineList-hiddenLabels"))
  750. }
  751. this.getPage();
  752. this.todoBusinessId = this.$route.query.todoBusinessId;
  753. this.taskId = this.$route.query.tId;
  754. this.currentNodeId = this.$route.query.cId;
  755. this.orderId = this.$route.query.orderId;
  756. if(this.todoBusinessId){
  757. this.productionListDialog = true;
  758. this.productionList(this.todoBusinessId)
  759. }
  760. },
  761. methods: {
  762. getPage() {
  763. this.$api.personal.myOrder(this.listQuery).then(res=>{
  764. if (res.code ===200){
  765. this.pageData = res.data;
  766. }
  767. })
  768. },
  769. fliterSearch(params){
  770. this.$api.personal.myOrder(params).then(res=>{
  771. if (res.code ===200){
  772. this.pageData = res.data;
  773. }
  774. })
  775. },
  776. searchList() {
  777. // 重置分页
  778. this.listQuery.page = 1
  779. this.listQuery.size = 20
  780. this.getPage()
  781. },
  782. resetParams(){
  783. this.$router.push({ query: {} });
  784. this.listQuery = {
  785. current: 1,
  786. size: 20,
  787. descs: 'created',
  788. }
  789. this.getPage();
  790. },
  791. orderDetail(row){
  792. this.$router.push(`/personal/order?id=${row.id}&couldEdit=true&recall=true&couldBack=true&back=${'/personal/my/order'}`)
  793. },
  794. productionList(id){
  795. this.productionListDialog = true;
  796. if (id){
  797. this.$api.businessProduction.personalBag(id).then(res=>{
  798. if (res.code === 200 && res.data!=null){
  799. let prods = res.data.productions
  800. if (prods){
  801. let prodType = prods.map(item=>item.production)
  802. if (prodType.includes("TECHNIC") && prodType.includes("FINAL")){
  803. prods = prods.filter(item=>item.production!='TECHNIC')
  804. for (let i in prods){
  805. if (prods[i].production==='FINAL'){
  806. prods[i].production = 'TECHNIC+FINAL'
  807. }
  808. }
  809. this.bag = res.data;
  810. this.bag.productions = prods;
  811. }
  812. }
  813. this.bag = res.data;
  814. }
  815. })
  816. }
  817. },
  818. aliasProductionType(code){
  819. if (code === 'STATEMENT'){
  820. return '房地产意见书';
  821. }
  822. if (code === 'LETTER'){
  823. return '复评函';
  824. }
  825. if (code === 'TECHNIC'){
  826. return '报告(技术报告)';
  827. }
  828. if (code === 'FINAL'){
  829. return '报告(结果报告)';
  830. }
  831. return '报告(技术报告、结果报告)'
  832. },
  833. openApplyOutWarehouseList(businessId){
  834. this.getListByBizTypeProductionId(businessId);
  835. this.outWarehouseListDialog = true;
  836. },
  837. getListByBizTypeProductionId(businessId){
  838. this.$api.productionOutWarehouse.getPersonalByOrderId(businessId).then(res=>{
  839. if (res.code === 200){
  840. this.outApllyList = res.data;
  841. }
  842. })
  843. },
  844. doApplyOut(){
  845. this.$refs.outWarehouse.validate(valid=>{
  846. if (valid){
  847. let taskRecordDTO = new Object();
  848. taskRecordDTO.recordId = this.taskId;
  849. taskRecordDTO.taskData = this.outWarehouse;
  850. this.$api.productionOutWarehouse.add(taskRecordDTO).then(res=>{
  851. if (res.code === 200 && res.data){
  852. this.$notify({
  853. title: '成功',
  854. message: '出库申请已提交',
  855. type: 'success',
  856. duration: 2000
  857. });
  858. this.commitNode();
  859. this.outWarehouseDialog = false;
  860. this.outWarehouseListDialog = false;
  861. this.productionListDialog = false;
  862. }else {
  863. this.$notify({
  864. title: '失败',
  865. message: '出库申请提交失败',
  866. type: 'error',
  867. duration: 2000
  868. });
  869. }
  870. })
  871. }
  872. })
  873. },
  874. commitNode(){
  875. let commit = new Object;
  876. commit.instanceNodeId = this.currentNodeId;
  877. commit.state = 'PASS';
  878. commit.comments = this.outWarehouse.remark;
  879. commit.businessSubId = this.orderId;
  880. this.$api.workflow.commit(commit).then(res=>{
  881. if (res.code === 200 && res.data){
  882. this.$notify({
  883. title: '成功',
  884. message: '工作流节点提交成功。',
  885. type: 'success',
  886. duration: 2000
  887. });
  888. }else{
  889. this.$notify({
  890. title: '失败',
  891. message: '工作流节点提交失败,请联系管理员。',
  892. type: 'error',
  893. duration: 2000
  894. });
  895. }
  896. })
  897. },
  898. cleanProductionListDialog(){
  899. this.bag.productions = [];
  900. this.bag.businessId=null;
  901. this.bag.property = null;
  902. },
  903. openOutApply(businessId){
  904. const applys = this.outApllyList;
  905. if (applys.length===0){
  906. this.getListByBizTypeProductionId(businessId);
  907. }
  908. for (let i in applys){
  909. if (applys[i].departmentCheckState==null){
  910. this.$notify({
  911. title: '提示',
  912. message: '已有申请待审核,请勿重复申请。',
  913. type: 'info',
  914. duration: 2000
  915. });
  916. return;
  917. }
  918. }
  919. this.outWarehouse.businessType = 'PERSONAL_BUSINESS';
  920. this.outWarehouse.businessId = businessId;
  921. this.outWarehouseDialog = true;
  922. },
  923. openFinanceInvoiceDialog(orderFundId,realAmount,clientName,clientSubName) {
  924. if (!orderFundId) {
  925. this.$notify({
  926. title: '提示',
  927. message: '请先完善应收款,再操作。',
  928. type: 'info',
  929. duration: 2000
  930. });
  931. return;
  932. }
  933. this.makeInvoiceListDialog = true;
  934. if (orderFundId) {
  935. this.invoice.orderFundId = orderFundId;
  936. this.invoice.realPayAmount = realAmount;
  937. this.invoice.title = clientName+clientSubName;
  938. this.getFinanceInvoiceList();
  939. }
  940. },
  941. openShouldAmountDialog(row) {
  942. this.shouldAmountDialog = true;
  943. this.fund.id = row.orderFundId;
  944. this.fund.businessType = 'PERSONAL_BUSINESS';
  945. this.fund.businessId = row.id;
  946. this.fund.shouldAmount = row.shouldAmount;
  947. this.fund.remark = row.remark;
  948. this.fund.orderId = row.orderId;
  949. this.fund.orderName = row.orderName;
  950. },
  951. cleanData() {
  952. this.fund.shouldAmount = null;
  953. this.fund.id = null;
  954. this.fund.businessType = null;
  955. this.fund.remark = null;
  956. this.fund.businessType = null;
  957. this.fund.businessId = null;
  958. this.fund.businessSubId = null;
  959. this.fund.productionFundId = null;
  960. this.fund.remark = null;
  961. this.fund.evaluateAmount = null
  962. },
  963. saveShouldAmount() {
  964. this.$refs.fund.validate(valid => {
  965. if (valid) {
  966. if (this.fund.id) {
  967. this.$api.orderFund.edit(this.fund).then(res => {
  968. if (res.code === 200 && res.data) {
  969. this.$notify({
  970. title: '成功',
  971. message: '订单应收款已完善',
  972. type: 'success',
  973. duration: 1000
  974. });
  975. this.getPage();
  976. this.shouldAmountDialog = false;
  977. } else {
  978. this.$notify({
  979. title: '失败',
  980. message: '订单应收款保存错误',
  981. type: 'error',
  982. duration: 1000
  983. });
  984. }
  985. })
  986. } else {
  987. this.$api.orderFund.add(this.fund).then(res => {
  988. if (res.code === 200 && res.data) {
  989. this.$notify({
  990. title: '成功',
  991. message: '订单应收款已完善',
  992. type: 'success',
  993. duration: 1000
  994. });
  995. this.getPage();
  996. this.shouldAmountDialog = false;
  997. } else {
  998. this.$notify({
  999. title: '失败',
  1000. message: '订单应收款保存错误',
  1001. type: 'error',
  1002. duration: 1000
  1003. });
  1004. }
  1005. })
  1006. }
  1007. }
  1008. })
  1009. },
  1010. openNewInvoiceDialog() {
  1011. if (!this.invoice.orderFundId) {
  1012. this.$notify({
  1013. title: '提示',
  1014. message: '申请开票前,请先完善应收款金额。',
  1015. type: 'info',
  1016. duration: 2000
  1017. });
  1018. return;
  1019. } else {
  1020. this.newInvoiceDialog = true;
  1021. }
  1022. },
  1023. getFinanceInvoiceList() {
  1024. this.$api.financeInvoice.getList(this.invoice.orderFundId,this.invoice.productionFundId).then(res => {
  1025. if (res.code === 200) {
  1026. this.invoiceData = res.data
  1027. }
  1028. })
  1029. },
  1030. cleanFinanceInvoiceForm() {
  1031. // this.$refs.invoice.resetFields();
  1032. this.invoice = {
  1033. id: null,
  1034. orderFundId: this.invoice.orderFundId,
  1035. productionFundId: this.invoice.productionFundId,
  1036. title: null,
  1037. type: null,
  1038. taxNo: null,
  1039. planAmount: null,
  1040. planMakeDate: null,
  1041. bankName: null,
  1042. bankAccount: null,
  1043. bankAddress: null,
  1044. bankTel: null,
  1045. makeItem: null,
  1046. itemQuantity: null,
  1047. itemUnit: null,
  1048. taxRate: null,
  1049. taxAmount: null,
  1050. remark: null
  1051. }
  1052. },
  1053. saveInvoice() {
  1054. this.$refs.invoice.validate(valid => {
  1055. if (valid) {
  1056. if (this.invoice.id) {
  1057. this.$api.financeInvoice.edit(this.invoice).then(res => {
  1058. if (res.code === 200 && res.data) {
  1059. this.$notify({
  1060. title: '成功',
  1061. message: '开票申请修改成功',
  1062. type: 'success',
  1063. duration: 2000
  1064. });
  1065. this.getFinanceInvoiceList();
  1066. this.newInvoiceDialog = false;
  1067. } else {
  1068. this.$notify({
  1069. title: '失败',
  1070. message: '开票申请修改失败',
  1071. type: 'error',
  1072. duration: 2000
  1073. });
  1074. }
  1075. })
  1076. } else {
  1077. this.$api.financeInvoice.add(this.invoice).then(res => {
  1078. if (res.code === 200 && res.data) {
  1079. this.$notify({
  1080. title: '成功',
  1081. message: '开票申请提交成功',
  1082. type: 'success',
  1083. duration: 2000
  1084. });
  1085. this.getFinanceInvoiceList();
  1086. this.newInvoiceDialog = false;
  1087. } else {
  1088. this.$notify({
  1089. title: '失败',
  1090. message: '开票申请提交失败',
  1091. type: 'error',
  1092. duration: 2000
  1093. });
  1094. }
  1095. })
  1096. }
  1097. }
  1098. })
  1099. },
  1100. stateStyle(state){
  1101. if (state==='已开票'){
  1102. return 'color:green'
  1103. }else{
  1104. return 'color:red'
  1105. }
  1106. },
  1107. invoiceDetail(id) {
  1108. this.$api.financeInvoice.detail(id).then(res => {
  1109. if (res.code === 200) {
  1110. this.invoice = res.data;
  1111. }
  1112. })
  1113. this.newInvoiceDialog = true;
  1114. },
  1115. cancellation(id) {
  1116. this.$prompt('作废原因:','已开发票作废',{
  1117. confirmButtonText: '确认',
  1118. cancelButtonText: '取消',
  1119. type: 'warning',
  1120. }).then(({value}) => {
  1121. this.invoice.reason = value;
  1122. this.invoice.id = id;
  1123. this.$api.financeInvoice.cancellation(this.invoice).then(res => {
  1124. if (res.code === 200 && res.data) {
  1125. this.$notify({
  1126. title: '成功',
  1127. message: '作废申请已提交',
  1128. type: 'success',
  1129. duration: 2000
  1130. });
  1131. this.getFinanceInvoiceList();
  1132. } else {
  1133. this.$notify({
  1134. title: '失败',
  1135. message: '作废提交失败',
  1136. type: 'error',
  1137. duration: 2000
  1138. });
  1139. }
  1140. })
  1141. })
  1142. },
  1143. copyInvoice(row){
  1144. this.invoice = row;
  1145. this.invoice.id = null;
  1146. this.invoice.state = null;
  1147. this.invoice.reason = null;
  1148. this.invoice.created = null;
  1149. this.invoice.modified = null;
  1150. this.newInvoiceDialog = true;
  1151. },
  1152. // 个贷我的订单导出
  1153. exportMyOrder() {
  1154. this.$utils.exportUtil(
  1155. "/personal/exportMyOrder", this.listQuery,
  1156. "导出"
  1157. );
  1158. },
  1159. switchHeader(data) {
  1160. this.hiddenLabels.push(data);
  1161. setCookie("PersonalMineList-hiddenLabels", this.hiddenLabels);
  1162. },
  1163. showAllLabel() {
  1164. removeCookie("PersonalMineList-hiddenLabels");
  1165. location.reload();
  1166. },
  1167. openProductionReturnDialog(row) {
  1168. // 判断产品是否已经出库了
  1169. if (row.repertoryState) {
  1170. // 赋值基础信息
  1171. this.productionReturnForm.businessType = 'PERSONAL_BUSINESS';
  1172. this.productionReturnForm.businessId = row.id;
  1173. this.productionReturnForm.name = row.orderName;
  1174. this.productionReturnForm.orderId = row.orderId;
  1175. this.productionReturnForm.productionType = 'FINAL'
  1176. this.productionReturnForm.clientName = row.clientName;
  1177. this.productionReturnForm.clientSubName = row.clientSubName;
  1178. this.productionReturnForm.bailor = row.bailorA;
  1179. if (row.bailorB) {
  1180. this.productionReturnForm.bailor = row.bailorA + '、' + row.bailorB;
  1181. }
  1182. // 打开dialog
  1183. this.productionReturnDialog = true;
  1184. } else {
  1185. this.$notify({
  1186. title: '警告',
  1187. message: '产品未出库,无需发起产品退回流程!',
  1188. type: 'warning',
  1189. duration: 2000,
  1190. });
  1191. }
  1192. },
  1193. // 发起产品退回流程
  1194. saveProductionreturn() {
  1195. this.$refs.productionReturnForm.validate((valid) => {
  1196. if (valid) {
  1197. this.$api.productionReturn.save(this.productionReturnForm).then((res) => {
  1198. if (res.code === 200) {
  1199. this.$notify({
  1200. title: '成功',
  1201. message: '产品退回申请流程已发起!',
  1202. type: 'success',
  1203. duration: 2000,
  1204. });
  1205. this.productionReturnDialog = false;
  1206. }
  1207. });
  1208. }
  1209. });
  1210. },
  1211. // 重置表单
  1212. resetProductionReturnForm() {
  1213. this.$refs.productionReturnForm.resetFields();
  1214. },
  1215. },
  1216. }
  1217. </script>
  1218. <style lang="scss" scoped>
  1219. /deep/.doWarehouseClass {
  1220. border-radius: 10px;
  1221. }
  1222. </style>