myOrder.vue 58 KB

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