salesContract.vue 34 KB

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