purchaseContract.vue 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313
  1. <!--现货采购合同-->
  2. <!--2019年5月30日 20:25:16 by jlx-->
  3. <template>
  4. <div>
  5. <BaseHeaderLayout :leftSpan="4">
  6. <template slot="left">
  7. <ws-button type="primary" @click="handleAdd()"
  8. v-hasPermission="`contractManagement.buyContract.buyContractInfo.add`">添加</ws-button>
  9. <ws-button @click="exportlist()" v-hasPermission="
  10. `contractManagement.buyContract.buyContractInfo.view`
  11. ">导出</ws-button>
  12. </template>
  13. <template slot="right">
  14. <span style="width: 205px; display: inline-block; color: #8890b1">创建人:</span>
  15. <ws-select v-model="createPersion" placeholder="可按创建人筛选" class="typeselect" @change="getList"
  16. :value="searchType">
  17. <ws-option key="全部内勤" label="全部内勤" value="" style="color: #8890b1" />
  18. <ws-option v-for="item in persionList" :key="item.staffName" :label="item.staffName" :value="item.staffName"
  19. style="color: #8890b1" />
  20. </ws-select>
  21. <span style="width: 150px; display: inline-block; color: #8890b1;margin-left: 5px;">状态:</span>
  22. <ws-select v-model="searchTypeText" placeholder="" class="typeselect" @change="selecttaskType"
  23. :value="searchType">
  24. <ws-option v-for="item in taskTypeList" :key="item.value" :label="item.value" :value="item.value"
  25. style="color: #8890b1" />
  26. </ws-select>
  27. <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels range-separator="至"
  28. start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions">
  29. </el-date-picker>
  30. <el-input v-model="searchKeyWord" placeholder="可按照合同编号、买方名称、卖方名称进行查找" clearable maxlength="500" type="input"
  31. class="findValue" @keyup.enter.native="find()"></el-input>
  32. <ws-button class="find" type="primary" @click="find()"><img width="16" height="16" style="
  33. vertical-align: text-top;
  34. position: relative;
  35. top: 0px;
  36. left: -8px;
  37. " src="../../../public/img/sousuo.png" alt="" /></ws-button>
  38. </template>
  39. </BaseHeaderLayout>
  40. <el-table class="wenzi" :data="contractList.records" style="width: 100%; margin-top: 10px"
  41. height="calc(100% - 105px)">
  42. <el-table-column type="index" label="序号">
  43. <template scope="scope">
  44. <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
  45. <span v-else>{{ scope.$index + 1 }}</span>
  46. </template>
  47. </el-table-column>
  48. <el-table-column prop="contractNo" label="合同编号" width="150">
  49. </el-table-column>
  50. <el-table-column prop="creator" label="创建人" width="90">
  51. </el-table-column>
  52. <el-table-column prop="goodsName" label="货名" width="80">
  53. </el-table-column>
  54. <!-- <el-table-column prop="grade" label="品级" width="80">
  55. <template slot-scope="scope">
  56. <span v-if="scope.row.grade == '一等品'" class="top-grade">{{
  57. scope.row.grade
  58. }}</span>
  59. <span v-if="scope.row.grade == '二等品'" class="second-class">{{
  60. scope.row.grade
  61. }}</span>
  62. <span v-if="scope.row.grade == '三等品'" class="third-class">{{
  63. scope.row.grade
  64. }}</span>
  65. <span v-if="scope.row.grade == '等外'" class="substandard">{{
  66. scope.row.grade
  67. }}</span>
  68. </template>
  69. </el-table-column> -->
  70. <el-table-column prop="weight" label="重量(吨)"> </el-table-column>
  71. <el-table-column width='130' prop="unitContractPrice" label="合同单价(元)">
  72. </el-table-column>
  73. <!-- <el-table-column prop="packingMethod" label="包装方式"> </el-table-column> -->
  74. <el-table-column prop="buyer" label="买方"> </el-table-column>
  75. <el-table-column prop="seller" label="卖方"> </el-table-column>
  76. <el-table-column width='120' prop="completedQuantity" label="已完成(吨)">
  77. <template slot-scope="scope">
  78. <span style="color: #5473e8; font-weight: 600">{{
  79. scope.row.completedQuantity
  80. }}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column width='150' prop="status" label="状态">
  84. <template slot-scope="scope">
  85. <div v-if="scope.row.status != '执行中' && scope.row.status != '发运结束'">
  86. <!-- <span v-if="scope.row.approveStatus">{{
  87. scope.row.approveStatus
  88. }}</span> -->
  89. <el-select v-if="scope.row.approveStatus" v-model="scope.row.approveStatus" placeholder=""
  90. class="statusselect" @change='selectstatuschange($event, scope.row)' disabled
  91. :value="scope.row.approveStatus">
  92. <el-option label="待决策人审核" value="待决策人审核" style="color: #8890b1" />
  93. </el-select>
  94. <el-select v-else v-model="scope.row.status" placeholder="" class="statusselect"
  95. :disabled="scope.row.status == '已完成' || scope.row.status == '已结算' || scope.row.status == '已驳回'"
  96. @change='selectstatuschange($event, scope.row)' :value="scope.row.status">
  97. <el-option label="待执行" value="待执行" style="color: #8890b1" />
  98. <el-option label="执行中" value="执行中" style="color: #8890b1" />
  99. </el-select>
  100. <!-- <el-popover v-else placement="left" :width="285" trigger="click" visible-arrow="false"
  101. @show="history(scope.row)">
  102. <template>
  103. <span slot="reference">
  104. <span v-if="scope.row.status == '待执行'" class="executory"></span>
  105. <span v-if="scope.row.status == '执行中'" class="inExecution"></span>
  106. <span v-if="scope.row.status == '已完成'" class="done"></span>{{ scope.row.status }}
  107. </span>
  108. </template>
  109. <div>
  110. <p style="margin-top: 0; padding-left: 10px">操作历史</p>
  111. <div v-for="(item, index) in historyList" class="flex">
  112. <div class="vertical-text vertical-text-left">
  113. {{ item.updateDate }}
  114. </div>
  115. <div>
  116. <div class="vertical-circle"></div>
  117. <div v-if="index != historyList.length - 1" class="vertical-line"></div>
  118. </div>
  119. <div class="vertical-text">
  120. {{ item.operateUser }}<br />{{ item.dealMsg }}
  121. </div>
  122. </div>
  123. </div>
  124. </el-popover>
  125. <img v-if="!scope.row.approveStatus" width="17" height="18"
  126. style="vertical-align: text-top; position: relative; top: -1px;" src="../../../public/img/edit.png"
  127. @click="editClick(scope.row)" alt="" /> -->
  128. </div>
  129. <div v-else>
  130. <!-- {{scope.row.status}} -->
  131. <el-select v-model="scope.row.status" placeholder="" class="statusselect"
  132. @change='selectstatuschange($event, scope.row)' :value="scope.row.status">
  133. <el-option v-for="item in statusList" :key="item.value" :label="item.value" :value="item.value"
  134. style="color: #8890b1" />
  135. </el-select>
  136. </div>
  137. </template>
  138. </el-table-column>
  139. <el-table-column width='120' prop="signingDate" label="签订日期"> </el-table-column>
  140. <el-table-column width='120' prop="contractExpenditure" label="粮款支出"> </el-table-column>
  141. <el-table-column width='120' prop="expenses" label="费用支出"> </el-table-column>
  142. <!-- <el-table-column width='130' prop="mildewGrain" label="已付款(元)"> -->
  143. </el-table-column>
  144. <el-table-column prop="amountEdPayable" label="已付运费"> </el-table-column>
  145. <el-table-column prop="statementUrl" label="结算单">
  146. <template slot-scope="scope">
  147. <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
  148. src="../../../public/img/fujian.png" @click="settlement(scope.row)" alt="" />
  149. <span v-if="scope.row.statementUrl != null">
  150. {{ scope.row.statementUrl? scope.row.statementUrl.split(",").length : "" }}
  151. </span>
  152. </template>
  153. </el-table-column>
  154. <el-table-column width='130' prop="goodsNames" label="已开发票 (元)">
  155. <template slot-scope="scope">
  156. <div v-if="!scope.row.editgoodsNames" style="display:inline-block;">
  157. <span @dblclick="scope.row.editgoodsNames=true">{{ scope.row.invoiced?scope.row.invoiced:0 }}</span>
  158. <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
  159. src="../../../public/img/fujian.png" @click="invoiceUploade(scope.row)" alt="" />
  160. <span v-if="scope.row.invoiceUrl != null">
  161. {{ scope.row.invoiceUrl ? scope.row.invoiceUrl.split(",").length : "" }}
  162. </span>
  163. </div>
  164. <div v-if="scope.row.editgoodsNames">
  165. <el-input class="goodsnamesinput" v-model="scope.row.invoiced" placeholder="输入累计开票金额" ></el-input>
  166. <i @click="submitgoodsNames(scope.row)" class="el-icon-check"></i>
  167. </div>
  168. </template>
  169. </el-table-column>
  170. <el-table-column prop="addressUrl" label="附件">
  171. <template slot-scope="scope">
  172. <img width="18" height="20" style="vertical-align: text-top; position: relative; top: -1px"
  173. src="../../../public/img/fujian.png" @click="fujian(scope.row)" alt="" />
  174. <span v-if="scope.row.addressUrlArray != null">
  175. {{
  176. scope.row.addressUrlArray.length == 0
  177. ? ''
  178. : scope.row.addressUrlArray.length
  179. }}
  180. </span>
  181. </template>
  182. </el-table-column>
  183. <el-table-column prop="address" label="操作" width="150">
  184. <template slot-scope="scope">
  185. <!-- <img width="16" height="17" style="
  186. vertical-align: text-top;
  187. position: relative;
  188. top: -1px;
  189. margin: 0 6px;
  190. " src="../../../public/img/daichu.png"
  191. v-hasPermission="
  192. `contractManagement.nonContract.nonContractInfo.view`"
  193. @click="handlecost(scope.row)" alt="" /> -->
  194. <el-link v-hasPermission="
  195. `contractManagement.buyContract.buyContractInfo.view`
  196. " target="_blank" type="primary" :underline="false" @click="handleExamine(scope.row)"
  197. >查看</el-link>
  198. <el-divider direction="vertical"></el-divider>
  199. <el-link v-hasPermission="
  200. `contractManagement.buyContract.buyContractInfo.edit`
  201. " target="_blank" type="primary" :underline="false" @click="handleEdit(scope.row)"
  202. :disabled="(scope.row.approveStatus!=null)">编辑</el-link>
  203. <el-dropdown>
  204. <span class="btn_css">•••</span>
  205. <el-dropdown-menu slot="dropdown">
  206. <el-dropdown-item v-hasPermission="
  207. `contractManagement.buyContract.buyContractInfo.delete`
  208. "><el-link target="_blank" type="primary" :underline="false" @click="handleDelete(scope.row)"
  209. :disabled="(scope.row.approveStatus!=null)">删除</el-link>
  210. </el-dropdown-item>
  211. <el-dropdown-item v-hasPermission="
  212. `contractManagement.buyContract.buyContractInfo.edit`
  213. ">
  214. <el-link target="_blank" type="primary" :underline="false" @click="withdraw(scope.row)"
  215. :disabled="scope.row.approveStatus && scope.row.approveStatus=='发起人撤回'">撤回</el-link>
  216. </el-dropdown-item>
  217. <el-dropdown-item v-hasPermission="
  218. `contractManagement.buyContract.buyContractInfo.view`
  219. ">
  220. <el-link target="_blank" type="primary" :underline="false" @click="handleaudit(scope.row)"
  221. :disabled="!scope.row.taskId">审核</el-link>
  222. </el-dropdown-item>
  223. <el-dropdown-item v-hasPermission="`contractManagement.buyContract.buyContractInfo.view`">
  224. <el-link target="_blank" type="primary" :underline="false" @click="handlecost(scope.row)">费用详情</el-link>
  225. </el-dropdown-item>
  226. <el-dropdown-item v-hasPermission="`contractManagement.buyContract.buyContractInfo.view`">
  227. <el-link target="_blank" type="primary" :underline="false" @click="handleprofit(scope.row)">利润详情</el-link>
  228. </el-dropdown-item>
  229. <el-dropdown-item v-hasPermission="`contractManagement.buyContract.buyContractInfo.view`">
  230. <el-link :disabled="scope.row.amountEdPayable=='他运'" target="_blank" type="primary" :underline="false" @click="handletransport(scope.row)">运输详情</el-link>
  231. </el-dropdown-item>
  232. </el-dropdown-menu>
  233. </el-dropdown>
  234. <!-- <ws-button v-if="scope.row.approveStatus && scope.row.approveStatus!='发起人撤回'" type="primary" @click="withdraw(scope.row)" >撤回</ws-button> -->
  235. </template>
  236. </el-table-column>
  237. </el-table>
  238. <el-pagination :page-sizes="[10, 30, 50, 100, 500, 1000, 9999]" @size-change="handleSizeChange"
  239. @current-change="handleCurrentChange" :current-page="currentPage" :page-size="deptCircularPage.pageSize"
  240. layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
  241. </el-pagination>
  242. <!-- 附件 -->
  243. <WinseaContentModal v-model="accessoryTFs" :title="$t('system.noticeCircular.information')"
  244. @on-cancel="handleClose">
  245. <div v-if="applstatus">
  246. <ws-upload ref="upload" :size-limit="size" @onChange="onChange" :comp-id="compId" :appendix-ids="appendixIdss"
  247. accept=".jpg, .jpeg, .png, .pdf, .doc, .docx, .zip, .rar"
  248. v-hasPermission="`contractManagement.buyContract.buyContractInfo.appl`" />
  249. </div>
  250. <ws-upload v-else ref="upload" :comp-id="compId" :appendix-ids="appendixIdss" :editable="false"
  251. accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
  252. </WinseaContentModal>
  253. <!-- 结算单 -->
  254. <!-- <WinseaContentModal v-model="countMoney" title="结算单信息"
  255. @on-cancel="handleClose">
  256. <div v-if="jiesuanstatus">
  257. <ws-upload ref="upload" :size-limit="size" @onChange="onChange1" :comp-id="compId" :appendix-ids="appendixIdss"
  258. accept=".jpg, .jpeg, .png, .pdf, .doc, .docx, .zip, .rar"
  259. v-hasPermission="`contractManagement.buyContract.buyContractInfo.jiedan`" />
  260. </div>
  261. <ws-upload v-else ref="upload" :comp-id="compId" :appendix-ids="appendixIdss" :editable="false"
  262. accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
  263. </WinseaContentModal> -->
  264. <!-- 上传已开发票 -->
  265. <WinseaContentModal v-model="invoiceSwitch" title="发票信息"
  266. @on-cancel="handleClose">
  267. <div v-if="fapiaostatus">
  268. <ws-upload ref="upload" :size-limit="size" @onChange="onChange2" :comp-id="compId" :appendix-ids="appendixIdss"
  269. accept=".jpg, .jpeg, .png, .pdf, .doc, .docx, .zip, .rar"
  270. v-hasPermission="`contractManagement.buyContract.buyContractInfo.fapiao`" />
  271. </div>
  272. <ws-upload v-else ref="upload" :comp-id="compId" :appendix-ids="appendixIdss" :editable="false"
  273. accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
  274. </WinseaContentModal>
  275. </div>
  276. </template>
  277. <script>
  278. import {
  279. getList,
  280. export1,
  281. editstatus,
  282. billoperatehis,
  283. deletecontract,
  284. editInfo,
  285. getsettlementprice,
  286. getstafffind,
  287. sponsorWithdraw
  288. } from '@/model/contarct/index'
  289. import {
  290. downloadFile
  291. } from '@/utils/batchDown'
  292. import {
  293. gettask,
  294. } from '@/model/outboundManagement/index'
  295. import { allRoles } from '@/utils/util'
  296. import { hasPermission } from '../../utils/getHasPermission'
  297. import Pagination from '@/components/Pagination'
  298. import WsUpload from '@/components/WsUpload'
  299. import {
  300. dayjs,
  301. EventBus
  302. } from 'base-core-lib'
  303. export default {
  304. name: 'viewSpareMoney',
  305. components: {
  306. WsUpload,
  307. Pagination,
  308. },
  309. watch: {
  310. vesselId(val) {
  311. this.getList()
  312. },
  313. isShow(val) {
  314. this.showType = val
  315. },
  316. },
  317. data() {
  318. return {
  319. id: '',
  320. //弹出框
  321. dialogViewSpareMoney: false,
  322. dialogApproveFormVisible: false,
  323. // 船舶类型
  324. monetaryKey: null,
  325. // 表格显示数据
  326. tableDate: [],
  327. size: 10,
  328. statusList: [{
  329. value: '已完成',
  330. }, { value: '发运结束', }],
  331. // 是否显示
  332. showType: true,
  333. // 年
  334. year: '',
  335. deliver_type: 1,
  336. deptBudgetTotal: 0,
  337. currentPage: 1,
  338. pageSize: 20,
  339. appendixIdsAdd: '',
  340. searchType: 1,
  341. searchTypeText: '未完成',
  342. searchKeyWord: '',
  343. contractType: 2,
  344. goodsType: 1,
  345. startDate: null,
  346. endDate: null,
  347. showFlag:false,
  348. addressUrls: [],
  349. accesscard: false,
  350. // 提交类型
  351. submitType: true,
  352. deptCircularPage: {},
  353. date: {
  354. year: dayjs().format('YYYY'),
  355. month: dayjs().format('MM'),
  356. },
  357. contractList: [],
  358. deptBudgetList: {},
  359. historyList: [],
  360. appendixIdss: [],
  361. fileList: [],
  362. compId: localStorage.getItem('ws-pf_compId'),
  363. pickerBeginDateBefore: {
  364. disabledDate: (time) => {
  365. return time.getTime() > Date.now()
  366. },
  367. },
  368. accessoryTFs: false,//附件
  369. countMoney:false,//结算单
  370. invoiceSwitch:false,//发票上传
  371. taskTypeList: [{
  372. value: '未完成',
  373. type: 1,
  374. },
  375. {
  376. value: '已完成',
  377. type: 2,
  378. },
  379. {
  380. value: '审批中',
  381. type: 4,
  382. },
  383. {
  384. value: '全部合同',
  385. type: '',
  386. },
  387. ],
  388. pickerOptions: {
  389. shortcuts: [{
  390. text: '本周',
  391. onClick(picker) {
  392. const end = new Date()
  393. const start = new Date()
  394. var thisDay = start.getDay()
  395. var thisDate = start.getDate()
  396. if (thisDay != 0) {
  397. start.setDate(thisDate - thisDay)
  398. }
  399. picker.$emit('pick', [start, end])
  400. },
  401. },
  402. {
  403. text: '本月',
  404. onClick(picker) {
  405. const end = new Date()
  406. const start = new Date()
  407. start.setDate(1)
  408. picker.$emit('pick', [start, end])
  409. },
  410. },
  411. {
  412. text: '本季度',
  413. onClick(picker) {
  414. var oDate = new Date()
  415. var thisYear = oDate.getFullYear()
  416. var thisMonth = oDate.getMonth() + 1
  417. var n = Math.ceil(thisMonth / 3) // 季度
  418. var Month = n * 3 - 1
  419. var start = new Date(thisYear, Month - 2, 1)
  420. var end = new Date()
  421. picker.$emit('pick', [start, end])
  422. },
  423. },
  424. ],
  425. },
  426. applstatus: false,
  427. jiesuanstatus:false,
  428. fapiaostatus:false,
  429. value1: '',
  430. value2: '',
  431. createPersion: '',//创建人
  432. persionList: [],
  433. }
  434. },
  435. activated() {
  436. console.log(allRoles())
  437. this.applstatus = hasPermission('contractManagement.buyContract.buyContractInfo.appl')
  438. this.jiesuanstatus = hasPermission('contractManagement.buyContract.buyContractInfo.jiedan')
  439. this.fapiaostatus = hasPermission('contractManagement.buyContract.buyContractInfo.fapiao')
  440. console.log(this.applstatus)
  441. //cg.viewBudget
  442. //cg.viewSpareMoney
  443. // this.getVesselData();
  444. this.getList()
  445. this.showType = this.isShow
  446. this.persionXiaLa()
  447. },
  448. methods: {
  449. submitgoodsNames(row){
  450. console.log(row)
  451. if(row.invoiced<0){
  452. this.$notify.warning({
  453. title: '警告',
  454. message: '发票金额输入错误',
  455. })
  456. }
  457. var dataobj={}
  458. dataobj.id=row.id
  459. dataobj.flag=3
  460. dataobj.invoiced=row.invoiced
  461. editInfo(dataobj)
  462. .toPromise()
  463. .then((response) => {
  464. this.$message.success('修改成功')
  465. this.getList()
  466. })
  467. },
  468. persionXiaLa() {
  469. getstafffind({
  470. roles: 'b96299bb5dcf461e916b72b64c6943b0'
  471. })
  472. .toPromise()
  473. .then((response) => {
  474. this.persionList = response
  475. })
  476. },
  477. withdraw(row) {
  478. this.$confirm(`撤回成功后,可再次提交,确定撤回该合同吗?`, {
  479. cancelButtonText: '取消',
  480. confirmButtonText: '确定',
  481. type: 'warning',
  482. }).then(() => {
  483. sponsorWithdraw({
  484. workflowId: row.workflowId,
  485. businessKey: row.id,
  486. }).toPromise()
  487. .then((response) => {
  488. this.$message.success('撤回成功')
  489. this.getList()
  490. })
  491. })
  492. },
  493. // handlecost(row) {
  494. // this.$router.push({
  495. // name: 'buyContractcost',
  496. // query: {
  497. // id: row.id,
  498. // contractNo: row.contractNo,
  499. // status: row.status,
  500. // seller: row.seller
  501. // },
  502. // })
  503. // },
  504. onChange() {
  505. this.$refs.upload
  506. .handleSaveBill()
  507. .then(async (response) => {
  508. this.deptBudgetList.addressUrl = response
  509. this.deptBudgetList.id = this.id
  510. this.deptBudgetList.flag = 1
  511. editInfo(this.deptBudgetList)
  512. .toPromise()
  513. .then((response) => {
  514. this.accessoryTFs = false
  515. this.$message.success('上传成功')
  516. this.getList()
  517. })
  518. })
  519. .catch((res) => {
  520. EventBus.$emit('error', (JSON.parse(res) || {}).message)
  521. this.$refs.upload.clearFiles()
  522. })
  523. },
  524. onChange1() {
  525. this.$refs.upload
  526. .handleSaveBill()
  527. .then(async (response) => {
  528. this.deptBudgetList.statementUrl = response
  529. this.deptBudgetList.id = this.id
  530. this.deptBudgetList.flag = 1
  531. editInfo(this.deptBudgetList)
  532. .toPromise()
  533. .then((response) => {
  534. this.countMoney = false
  535. this.$message.success('上传成功')
  536. this.getList()
  537. })
  538. })
  539. .catch((res) => {
  540. EventBus.$emit('error', (JSON.parse(res) || {}).message)
  541. this.$refs.upload.clearFiles()
  542. })
  543. },
  544. onChange2() {
  545. this.$refs.upload
  546. .handleSaveBill()
  547. .then(async (response) => {
  548. this.deptBudgetList.invoiceUrl = response
  549. this.deptBudgetList.id = this.id
  550. this.deptBudgetList.flag = 1
  551. editInfo(this.deptBudgetList)
  552. .toPromise()
  553. .then((response) => {
  554. this.invoiceSwitch = false
  555. this.$message.success('上传成功')
  556. this.getList()
  557. })
  558. })
  559. .catch((res) => {
  560. EventBus.$emit('error', (JSON.parse(res) || {}).message)
  561. this.$refs.upload.clearFiles()
  562. })
  563. },
  564. dateFormat(fmt, date) {
  565. let ret
  566. const opt = {
  567. 'Y+': date.getFullYear().toString(), // 年
  568. 'm+': (date.getMonth() + 1).toString(), // 月
  569. 'd+': date.getDate().toString(), // 日
  570. 'H+': date.getHours().toString(), // 时
  571. // "M+": date.getMinutes().toString(), // 分
  572. // "S+": date.getSeconds().toString() // 秒
  573. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  574. }
  575. for (let k in opt) {
  576. ret = new RegExp('(' + k + ')').exec(fmt)
  577. if (ret) {
  578. fmt = fmt.replace(
  579. ret[1],
  580. ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
  581. )
  582. }
  583. }
  584. return fmt
  585. },
  586. handleClose() {
  587. this.dialogViewSpareMoney = false
  588. this.countMoney = false
  589. this.invoiceSwitch = false
  590. },
  591. async selectstatuschange(e, row) {
  592. var data = {}
  593. var text = `是否将状态改为${e}`
  594. // if(e!='已完成'){
  595. // this.$confirm(text, {
  596. // confirmButtonText: '确定',
  597. // cancelButtonText: '取消',
  598. // type: 'warning',
  599. // })
  600. // .then(() => {
  601. // editstatus(data)
  602. // .toPromise()
  603. // .then((response) => {
  604. // this.$notify.success({
  605. // title: '成功',
  606. // message: '状态修改成功',
  607. // })
  608. // this.getList()
  609. // })
  610. // .catch((response) => {
  611. // row.status = row.currectstatus
  612. // // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  613. // })
  614. // })
  615. // .catch(() => {
  616. // row.status = row.currectstatus
  617. // return false
  618. // })
  619. // }else{
  620. if (e == '发运结束') {
  621. data = { id: row.id, endFlag: 1 }
  622. } else if (e == '已完成') {
  623. var response=await getsettlementprice({ contractNo: row.contractNo }).toPromise().catch(()=>{
  624. row.status = row.currectstatus
  625. return
  626. })
  627. if(row.status=='执行中'){
  628. return
  629. }
  630. data = { id: row.id, settlementPrice: response}
  631. text = `合同单价${response}元/吨,确定合同已完成?`
  632. } else {
  633. data = { id: row.id }
  634. }
  635. this.$confirm(text, {
  636. confirmButtonText: '确定',
  637. cancelButtonText: '取消',
  638. type: 'warning',
  639. })
  640. .then(() => {
  641. editstatus(data)
  642. .toPromise()
  643. .then((response) => {
  644. this.$notify.success({
  645. title: '成功',
  646. message: '状态修改成功',
  647. })
  648. this.getList()
  649. })
  650. .catch((response) => {
  651. row.status = row.currectstatus
  652. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  653. })
  654. })
  655. .catch(() => {
  656. row.status = row.currectstatus
  657. return false
  658. })
  659. // }
  660. },
  661. handleSizeChange(val) {
  662. console.log(`每页 ${val} 条`)
  663. this.pageSize = val
  664. this.getList()
  665. },
  666. handleCurrentChange(val) {
  667. this.currentPage = val
  668. console.log(`当前页: ${val}`)
  669. this.getList()
  670. },
  671. getList() {
  672. getList({
  673. compId: localStorage.getItem('ws-pf_compId'),
  674. contractType: this.contractType,
  675. goodsType: this.goodsType,
  676. currentPage: this.currentPage,
  677. pageSize: this.pageSize,
  678. searchType: this.searchType,
  679. searchKeyWord: this.searchKeyWord,
  680. startDate: this.startDate,
  681. endDate: this.endDate,
  682. contrPage: this.contrPage,
  683. creator:this.createPersion
  684. })
  685. .toPromise()
  686. .then((response) => {
  687. for (var i = 0; i < response.records.length; i++) {
  688. if (response.records[i].status) {
  689. response.records[i].currectstatus = response.records[i].status
  690. }
  691. if (response.records[i].completedQuantity) {
  692. response.records[i].completedQuantity = response.records[i].completedQuantity.toFixed(3)
  693. }
  694. if (response.records[i].addressUrl != null) {
  695. if (response.records[i].addressUrl) {
  696. response.records[i].addressUrlArray =
  697. response.records[i].addressUrl.split(',')
  698. }
  699. } else {
  700. response.records[i].addressUrlArray = []
  701. }
  702. if (response.records[i].creator == localStorage.getItem('ws-pf_staffName')) {
  703. response.records[i].showFlag = true
  704. }
  705. }
  706. this.deptCircularPage.currentPage = response.current
  707. this.deptCircularPage.pageSize = response.size
  708. this.deptBudgetTotal = response.total
  709. this.contractList = response
  710. for (var i = 0; i < response.records.length; i++) {
  711. var arr = new Array()
  712. this.addressUrls[i] = new Array()
  713. if (this.contractList.records[i].addressUrl != null) {
  714. arr = this.contractList.records[i].addressUrl.split(',')
  715. this.addressUrls[i] = arr
  716. }
  717. }
  718. })
  719. },
  720. // 上传附件
  721. uploadSuccess(data, files, url) {
  722. console.log(data, files, url)
  723. // this.deptBudgetList.
  724. // this.formData.append('files', files)
  725. // this.feedbackObj.uploadNameAttachment = data.appendixName
  726. // this.feedbackObj.pathUploadAttachment = data.appendixPath
  727. // // this.newAppendixs = files
  728. // this.onChangeFlag = true
  729. },
  730. editClick(row) {
  731. var status = ''
  732. if (row.status == '待执行' || row.status == '已完成') {
  733. status = '执行中'
  734. } else if (row.status == '执行中' || row.status == '发运结束') {
  735. status = '已完成'
  736. }
  737. this.$confirm(`是否将状态改为${status}`, '提示', {
  738. confirmButtonText: '确定',
  739. cancelButtonText: '取消',
  740. type: 'warning',
  741. })
  742. .then(() => {
  743. editstatus({
  744. id: row.id,
  745. })
  746. .toPromise()
  747. .then((response) => {
  748. this.$notify.success({
  749. title: '成功',
  750. message: '状态修改成功',
  751. })
  752. this.getList()
  753. })
  754. .catch((response) => {
  755. // EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  756. })
  757. })
  758. .catch(() => {
  759. return false
  760. })
  761. },
  762. selecttaskType(e) {
  763. for (var i = 0; i < this.taskTypeList.length; i++) {
  764. if (this.taskTypeList[i].value == e) {
  765. this.searchType = this.taskTypeList[i].type
  766. this.find()
  767. }
  768. }
  769. },
  770. fujian(row) {
  771. this.id = row.id
  772. this.accessoryTFs = true
  773. this.appendixIdss = row.addressUrl
  774. console.log(this.appendixIdss)
  775. },
  776. settlement(row){
  777. this.id = row.id
  778. this.countMoney = true
  779. this.appendixIdss = row.statementUrl
  780. },
  781. invoiceUploade(row){
  782. this.id = row.id
  783. this.invoiceSwitch = true
  784. this.appendixIdss = row.invoiceUrl
  785. },
  786. handleExamine(row) {
  787. console.log(row)
  788. this.$router.push({
  789. name: 'purchaseContractExamine',
  790. query: {
  791. id: row.id,
  792. status: row.status,
  793. },
  794. })
  795. },
  796. handleAdd() {
  797. this.$router.push({
  798. path: 'purchaseContractAdd',
  799. })
  800. },
  801. handleEdit(row) {
  802. this.$router.push({
  803. name: 'purchaseContractEdit',
  804. query: {
  805. id: row.id,
  806. },
  807. })
  808. },
  809. handleaudit(row) {
  810. this.$router.push({
  811. name: 'purchaseContractAudit',
  812. query: {
  813. id: row.id,
  814. status: row.status,
  815. },
  816. })
  817. },
  818. handlecost(row) {
  819. this.$router.push({
  820. name: 'expensemanagementdetails',
  821. query: {
  822. contractNo: row.contractNo,
  823. },
  824. })
  825. },
  826. handleprofit(row) {
  827. this.$router.push({
  828. name: 'contractprofits',
  829. query: {
  830. contractNo: row.contractNo,
  831. },
  832. })
  833. },
  834. async handletransport(row) {
  835. gettask({contractNo:row.contractNo,compId:localStorage.getItem('ws-pf_compId')}).toPromise().then((response) => {
  836. console.log(response,111111111111)
  837. if(!response||response==0){
  838. this.$message({
  839. message: '联系内勤创建运输任务',
  840. type: 'warning',
  841. });
  842. }else{
  843. this.$router.push({
  844. name: 'autoSettlementList',
  845. query: {
  846. contractNo: row.contractNo,
  847. },
  848. })
  849. }
  850. })
  851. },
  852. // 关闭 dialog时 处理文件url 初始化upload组件
  853. history(row) {
  854. console.log(row)
  855. billoperatehis({
  856. id: row.id,
  857. })
  858. .toPromise()
  859. .then((response) => {
  860. this.historyList = response
  861. })
  862. },
  863. find() {
  864. if (this.value2) {
  865. this.startDate = this.dateFormat('YYYY-mm-dd', this.value2[0])
  866. this.endDate = this.dateFormat('YYYY-mm-dd', this.value2[1])
  867. } else {
  868. this.startDate = ''
  869. this.endDate = ''
  870. }
  871. this.currentPage = 1
  872. this.getList()
  873. },
  874. async exportlist() {
  875. const {
  876. data
  877. } = await export1({
  878. compId: localStorage.getItem('ws-pf_compId'),
  879. contractType: this.contractType,
  880. goodsType: this.goodsType,
  881. currentPage: this.currentPage,
  882. pageSize: this.pageSize,
  883. searchType: this.searchType,
  884. searchKeyWord: this.searchKeyWord,
  885. startDate: this.startDate,
  886. endDate: this.endDate,
  887. }, {}, {
  888. responseType: 'blob',
  889. }).toPromise()
  890. downloadFile({
  891. res: data,
  892. fileName: `${this.date.year + (this.date.month ? `-${this.date.month}` : '')
  893. }_采购合同`,
  894. type: 'xls',
  895. })
  896. },
  897. // deletecontract(){},
  898. //删除
  899. handleDelete(row) {
  900. var text = ''
  901. if (row.deliverType == 1) {
  902. text =
  903. '删除该合同将同时永久删除合同对应的临时仓库相关数据,是否确定删除?'
  904. } else {
  905. text = '合同删除后不可恢复,是否继续删除?'
  906. }
  907. this.$confirm(text, '提示', {
  908. confirmButtonText: '确定',
  909. cancelButtonText: '取消',
  910. type: 'warning',
  911. })
  912. .then(() => {
  913. deletecontract({
  914. id: row.id,
  915. })
  916. .toPromise()
  917. .then((response) => {
  918. this.$notify.success({
  919. title: '成功',
  920. message: '删除成功',
  921. })
  922. this.getList()
  923. })
  924. .catch((response) => { })
  925. })
  926. .catch(() => {
  927. return false
  928. })
  929. },
  930. },
  931. }
  932. </script>
  933. <style lang="scss" scoped>
  934. .vertical-text-left {
  935. width: 62px;
  936. text-align: right;
  937. }
  938. .flex {
  939. display: flex;
  940. }
  941. .el-range-editor.el-input__inner {
  942. margin-left: 10px;
  943. }
  944. /deep/.base_header_layout .grid-content.right .find.el-button--primary {
  945. width: 30px;
  946. margin-left: -10px;
  947. border-top-left-radius: 0px;
  948. border-bottom-left-radius: 0px;
  949. }
  950. .el-button--primary {
  951. background-color: #5878e8;
  952. border-color: #5878e8;
  953. }
  954. .el-button--default {
  955. border: 1px solid #5473e8;
  956. color: #5473e8;
  957. }
  958. // .warning {
  959. // width: 100%;
  960. // height: 2px;
  961. // background: red;
  962. // }
  963. .executory,
  964. .inExecution,
  965. .done {
  966. width: 6px;
  967. height: 6px;
  968. display: inline-block;
  969. border-radius: 50%;
  970. position: relative;
  971. top: -1px;
  972. }
  973. .executory {
  974. background: #ff9f24;
  975. }
  976. .inExecution {
  977. background: #5878e8;
  978. }
  979. .done {
  980. background: #50cad4;
  981. }
  982. // .top-grade {
  983. // background: linear-gradient(90deg, #5678e9, #7993f6);
  984. // color: #fff;
  985. // padding: 3px;
  986. // border-radius: 2px;
  987. // }
  988. // .second-class {
  989. // background: linear-gradient(90deg, #50cdd9, #82e2ea);
  990. // color: #fff;
  991. // padding: 3px;
  992. // border-radius: 2px;
  993. // }
  994. // .third-class {
  995. // background: linear-gradient(90deg, #ffa735, #ffbf70);
  996. // color: #fff;
  997. // padding: 3px;
  998. // border-radius: 2px;
  999. // }
  1000. // .substandard {
  1001. // background: linear-gradient(90deg, #b2b4bb, #ced0d5);
  1002. // color: #fff;
  1003. // padding: 3px;
  1004. // border-radius: 2px;
  1005. // }
  1006. .wrap {
  1007. width: 400px;
  1008. position: absolute;
  1009. top: 131px;
  1010. left: 794px;
  1011. transform-origin: right center;
  1012. z-index: 2005;
  1013. }
  1014. .vertical-line {
  1015. height: 64px;
  1016. border-left: 2px solid #e9ecf7;
  1017. margin-left: 4px;
  1018. padding: 0 3px;
  1019. // border-image: -webkit-linear-gradient(#00eba7, #08b8e6) 30 30;
  1020. // border-image: -moz-linear-gradient(#00eba7, #08b8e6) 30 30;
  1021. // border-image: linear-gradient(#00eba7, #08b8e6) 30 30;
  1022. }
  1023. .el-pagination {
  1024. padding: 10px 15px;
  1025. margin-bottom: 0;
  1026. text-align: center;
  1027. }
  1028. /deep/.el-pager li.active {
  1029. color: #5878e8;
  1030. cursor: default;
  1031. }
  1032. /deep/.el-pager li:hover {
  1033. color: #5878e8;
  1034. cursor: default;
  1035. }
  1036. .vertical-circle {
  1037. width: 10px;
  1038. height: 10px;
  1039. border: 2px solid #5878e8;
  1040. background-color: #ffffff;
  1041. -webkit-border-radius: 100px;
  1042. }
  1043. .vertical-circle:first-child {
  1044. color: red;
  1045. }
  1046. .vertical-text {
  1047. margin: 0 10px;
  1048. color: #8890b1;
  1049. font-size: 12px;
  1050. margin-top: -4px;
  1051. }
  1052. /deep/.el-table .el-table__header .cell,
  1053. /deep/.el-table .el-table__body .cell {
  1054. text-align: center;
  1055. }
  1056. .typeselect {
  1057. width: 500px;
  1058. }
  1059. .padding-xs {
  1060. padding: 15px;
  1061. text-align: right;
  1062. }
  1063. .clearfix:after {
  1064. content: '';
  1065. display: block;
  1066. clear: both;
  1067. }
  1068. .el-table {
  1069. font-size: 16px;
  1070. }
  1071. .taskType {
  1072. width: 100%;
  1073. background-color: #fff;
  1074. margin-top: 2px;
  1075. margin-bottom: 10px;
  1076. list-style: none;
  1077. // padding-bottom: 20px;
  1078. li {
  1079. float: left;
  1080. border: 1px solid #6ea0f3;
  1081. border-radius: 5px;
  1082. max-width: 190px;
  1083. padding: 0 5px;
  1084. text-align: center;
  1085. margin: 10px 20px;
  1086. cursor: pointer;
  1087. font-size: 14px;
  1088. p {
  1089. margin: 8px 0px;
  1090. span {
  1091. color: #e74c3c;
  1092. }
  1093. }
  1094. }
  1095. li:hover {
  1096. background-color: #e4eeff;
  1097. color: #1d6ced;
  1098. }
  1099. }
  1100. .el-date-editor--date {
  1101. margin: 0 10px;
  1102. }
  1103. .findValue {
  1104. margin: 0 10px;
  1105. }
  1106. /deep/.findValue .el-input__inner {
  1107. border-top-right-radius: 0px;
  1108. border-bottom-right-radius: 0px;
  1109. }
  1110. // .button-container {
  1111. // display: flex;
  1112. // flex-wrap: nowrap;
  1113. // justify-content: space-between;
  1114. // align-items: center;
  1115. // background-color: #fff;
  1116. // width: 100%;
  1117. // height: 50px;
  1118. // padding: 0 10px;
  1119. // &>div {
  1120. // margin-left: 10px;
  1121. // display: flex;
  1122. // flex-wrap: nowrap;
  1123. // flex-direction: row;
  1124. // &>span {
  1125. // line-height: 50px;
  1126. // }
  1127. // }
  1128. // /deep/.auditFlow-box {
  1129. // position: unset;
  1130. // margin-left: 10px;
  1131. // &/deep/.auditFlow-icon {
  1132. // width: auto;
  1133. // padding-right: 30px;
  1134. // }
  1135. // &/deep/.auditFlow-main {
  1136. // position: absolute;
  1137. // }
  1138. // }
  1139. // }
  1140. // .box-app {
  1141. // display: inline-block;
  1142. // float: left;
  1143. // margin-left: 30px;
  1144. // line-height: 50px;
  1145. // }
  1146. /deep/.el-dialog {
  1147. .el-form-item {
  1148. margin-bottom: 0 !important;
  1149. .el-input--medium {
  1150. textarea {
  1151. min-height: 100px !important;
  1152. }
  1153. }
  1154. }
  1155. }
  1156. .collapse-bottom {
  1157. margin-bottom: 20px;
  1158. }
  1159. .input-main .textarea .el-textarea__inner {
  1160. width: 100%;
  1161. z-index: 1;
  1162. }
  1163. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  1164. /* height: 82px;*/
  1165. /*}*/
  1166. // 控制select为只读的时候显示样式
  1167. // .hide-sel {
  1168. // .el-input__inner {
  1169. // border: 0px;
  1170. // }
  1171. // .el-icon-arrow-up {
  1172. // display: none;
  1173. // }
  1174. // .el-textarea__inner {
  1175. // background-color: #fff !important;
  1176. // border: 0;
  1177. // }
  1178. // .el-date-editor {
  1179. // i {
  1180. // display: none;
  1181. // }
  1182. // }
  1183. // .is-disabled {
  1184. // .el-input__inner:hover {
  1185. // background-color: #fff !important;
  1186. // border: 0;
  1187. // }
  1188. // color: #606266;
  1189. // .el-input__inner {
  1190. // background-color: #fff !important;
  1191. // border: 0;
  1192. // color: #606266;
  1193. // }
  1194. // .el-textarea__inner {
  1195. // background-color: #fff !important;
  1196. // border: 0;
  1197. // color: #606266;
  1198. // }
  1199. // }
  1200. // }
  1201. // 控制select为只读的时候显示样式
  1202. /deep/.ws-class-table-col {
  1203. height: auto;
  1204. padding: 0px 2px;
  1205. /deep/.el-input__inner {
  1206. padding: 0px 2px;
  1207. }
  1208. }
  1209. /deep/.is-disabled {
  1210. .el-input__prefix,
  1211. .el-input__suffix {
  1212. display: none;
  1213. }
  1214. .el-input__inner {
  1215. background-color: #fff;
  1216. border-color: #fff !important;
  1217. color: #000 !important;
  1218. font-size: 14px;
  1219. cursor: text;
  1220. padding: 0 !important;
  1221. }
  1222. }
  1223. /deep/.typeselect .el-input__inner {
  1224. color: #8890b1;
  1225. }
  1226. /deep/.statusselect .el-input__inner {
  1227. color: #8890b1;
  1228. width: 100%;
  1229. }
  1230. .btn_css {
  1231. color: #409eff;
  1232. cursor: pointer;
  1233. position:relative;
  1234. top:2px;
  1235. }
  1236. </style>