myOrder.vue 67 KB

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