myOrder.vue 53 KB

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