salesContract.vue 35 KB

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