myOrder.vue 59 KB

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