salesContract.vue 40 KB

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