myOrder.vue 55 KB

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