acquisitionContract.vue 36 KB

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