purchaseContract.vue 31 KB

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