procurementPlanEdit.vue 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217
  1. // 编辑采购计划
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="12">
  6. <h2 class="bg-left title">编辑采购计划</h2>
  7. </el-col>
  8. <el-col :span="12" class="bg-right">
  9. <el-button
  10. class="bg-bottom"
  11. type="primary"
  12. size="small"
  13. @click="returnsales()"
  14. >
  15. <img
  16. width="6"
  17. height="10"
  18. style="vertical-align: bottom; margin-right: 3px"
  19. src="../../../public/img/lujing.png"
  20. alt
  21. />返回
  22. </el-button>
  23. </el-col>
  24. </el-row>
  25. <div class="basicInformation">
  26. <!-- <el-radio-group @change="tasktypechange" v-model="dataList.taskTypeKey"></el-radio-group> -->
  27. <div class="center1">
  28. <div class="small-title">
  29. <h3>基本信息</h3>
  30. </div>
  31. <el-form ref="dataList" :model="dataList" label-width="140px">
  32. <!-- 标题 -->
  33. <ws-form-item label="标题" span="1" prop="title">
  34. <el-input
  35. v-model="dataList.title"
  36. maxlength="16"
  37. placeholder="请输入标题,不超过16个字"
  38. />
  39. </ws-form-item>
  40. <!-- 货名 -->
  41. <ws-form-item label="货名" span="1" prop="goodsName">
  42. <ws-select
  43. disabled
  44. v-model="dataList.goodsName"
  45. placeholder
  46. class="typeselect"
  47. @change="selectgoodsName"
  48. >
  49. <ws-option
  50. v-for="item in goodnameList"
  51. :key="item.constKey"
  52. :label="item.constValue"
  53. :value="item.constValue"
  54. />
  55. </ws-select>
  56. </ws-form-item>
  57. <!-- 计划采购量(吨) -->
  58. <ws-form-item
  59. label="计划采购量(吨)"
  60. span="1"
  61. prop="plannedPurchaseVolume"
  62. >
  63. <el-input
  64. v-model="dataList.plannedPurchaseVolume"
  65. class="typeselect"
  66. placeholder="请输入计划采购量"
  67. />
  68. </ws-form-item>
  69. <!-- 最小成交量 -->
  70. <ws-form-item label="最小成交量(吨)" span="1" prop="minimumVolume">
  71. <el-input
  72. v-model="dataList.minimumVolume"
  73. placeholder="请输入最小成交量"
  74. />
  75. </ws-form-item>
  76. <!--类型-->
  77. <ws-form-item label="类型" span="1" prop="procurementPlanType">
  78. <ws-select
  79. disabled
  80. v-model="dataList.procurementPlanType"
  81. placeholder
  82. class="typeselect"
  83. @change="selectprocurementPlanType"
  84. >
  85. <ws-option
  86. v-for="item in procurementPlanTypeList"
  87. :key="item.constKey"
  88. :label="item.constValue"
  89. :value="item.constValue"
  90. />
  91. </ws-select>
  92. </ws-form-item>
  93. <!-- 价格类型 -->
  94. <ws-form-item label="价格类型" span="1" prop="priceType">
  95. <el-input v-model="dataList.priceType" disabled />
  96. </ws-form-item>
  97. <!-- 基差 -->
  98. <ws-form-item
  99. v-show="dataList.procurementPlanType == '期货'"
  100. label="基差(元/吨)"
  101. span="1"
  102. prop="basisPrice"
  103. >
  104. <el-input v-model="dataList.basisPrice" placeholder="请输入基差" />
  105. </ws-form-item>
  106. <!--采购价格(元)-->
  107. <ws-form-item
  108. v-show="dataList.procurementPlanType == '现货'"
  109. label="采购价格(元)"
  110. span="1"
  111. prop="procurementPrice"
  112. >
  113. <el-input
  114. v-model="dataList.procurementPrice"
  115. maxlength="120"
  116. size="small"
  117. placeholder="请输入采购价格"
  118. />
  119. </ws-form-item>
  120. <!--收货库-->
  121. <ws-form-item label="收货库" span="1" prop="receiveWarehouse">
  122. <el-select
  123. disabled
  124. v-model="dataList.receiveWarehouse"
  125. maxlength="120"
  126. size="small"
  127. />
  128. <el-option
  129. v-for="item in warehouseList1"
  130. :key="item.constKey"
  131. :label="item.warehouseName"
  132. :value="item.warehouseName"
  133. ></el-option>
  134. </ws-form-item>
  135. <!--收货库所在地区-->
  136. <ws-form-item label="收货库所在地区" span="1" prop="receiveArea">
  137. <el-cascader
  138. :options="options_"
  139. v-model="selectedOptions"
  140. clearable
  141. size="large"
  142. placeholder="请选择收货库所在地区"
  143. @change="handleChange"
  144. style="width: 200%"
  145. />
  146. </ws-form-item>
  147. <!--运费承担方-->
  148. <ws-form-item label="运费承担方" span="1" prop="freightPayer">
  149. <ws-select
  150. v-model="dataList.freightPayer"
  151. placeholder
  152. class="typeselect"
  153. @change="selectfreightPayer"
  154. >
  155. <ws-option
  156. v-for="item in freightPayerList"
  157. :key="item.constKey"
  158. :label="item.constValue"
  159. :value="item.constValue"
  160. />
  161. </ws-select>
  162. </ws-form-item>
  163. <!--包装方式-->
  164. <ws-form-item label="包装方式" span="1" prop="packingType">
  165. <ws-select
  166. v-model="dataList.packingType"
  167. placeholder
  168. class="typeselect"
  169. @change="selectpackingType"
  170. >
  171. <ws-option
  172. v-for="item in packingTypeList"
  173. :key="item.constKey"
  174. :label="item.constValue"
  175. :value="item.constValue"
  176. />
  177. </ws-select>
  178. </ws-form-item>
  179. <!--装袋备注=-->
  180. <el-form-item
  181. v-if="dataList.packingType != '散装'"
  182. label="装袋备注"
  183. span="1"
  184. prop="baggingNotes"
  185. >
  186. <el-input
  187. v-model="dataList.baggingNotes"
  188. size="small"
  189. placeholder="请输入装袋要求如:98斤,王中王彩袋"
  190. />
  191. </el-form-item>
  192. <!-- 买方 -->
  193. <ws-form-item label="买方" span="1" prop="buyer">
  194. <el-input
  195. v-model="dataList.buyer"
  196. maxlength="120"
  197. size="small"
  198. placeholder="请输入买方名称"
  199. />
  200. </ws-form-item>
  201. <!-- 买方电话 -->
  202. <el-form-item label="买方电话" span="1" prop="buyerPhone">
  203. <el-input
  204. v-model="dataList.buyerPhone"
  205. filterable
  206. :filter-method="dataFilter"
  207. placeholder="请输入买方电话"
  208. ></el-input>
  209. </el-form-item>
  210. <div class="small-title"></div>
  211. </el-form>
  212. </div>
  213. <div class="center1">
  214. <div class="small-title">
  215. <h3>货物要求</h3>
  216. </div>
  217. <el-form ref="dataList" :model="dataList" label-width="140px">
  218. <el-form-item label="水分(%)<=" span="1" prop="waterContent">
  219. <el-input
  220. v-model="dataList.waterContent"
  221. class="typeselect"
  222. placeholder="请输入水分占比"
  223. />
  224. </el-form-item>
  225. <!-- 容重 -->
  226. <el-form-item label="容重(g/l)>=" span="1" prop="bulkDensity">
  227. <el-input
  228. v-model="dataList.bulkDensity"
  229. class="typeselect"
  230. placeholder="请输入容重"
  231. />
  232. </el-form-item>
  233. <!-- 热损伤 -->
  234. <el-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
  235. <el-input
  236. v-model="dataList.jiaorenli"
  237. class="typeselect"
  238. placeholder="请输入热损伤占比"
  239. />
  240. </el-form-item>
  241. <!-- 杂质 -->
  242. <el-form-item label="杂质(%)<=" span="1" prop="impurity">
  243. <el-input
  244. v-model="dataList.impurity"
  245. class="typeselect"
  246. placeholder="请输入杂质占比"
  247. />
  248. </el-form-item>
  249. <!-- 霉变粒 -->
  250. <el-form-item label="霉变粒(%)<=" span="1" prop="mildewGrain">
  251. <el-input
  252. v-model="dataList.mildewGrain"
  253. placeholder="请输入霉变粒占比"
  254. />
  255. </el-form-item>
  256. <!--不完善粒(%)<=-->
  257. <el-form-item label="不完善粒(%)<=" span="1" prop="imperfectGrain">
  258. <el-input
  259. v-model="dataList.imperfectGrain"
  260. maxlength="120"
  261. placeholder="请输入不完善粒占比"
  262. />
  263. </el-form-item>
  264. <!-- 蛋白(%)<= -->
  265. <el-form-item label="蛋白(%)>=" span="1" prop="protein">
  266. <el-input
  267. v-model="dataList.protein"
  268. class="typeselect"
  269. placeholder="请输入蛋白占比"
  270. />
  271. </el-form-item>
  272. <!--粒型-->
  273. <ws-form-item label="粒型" span="1" prop="grain">
  274. <ws-select
  275. v-model="dataList.grain"
  276. placeholder
  277. class="typeselect"
  278. @change="selectgrain"
  279. >
  280. <ws-option
  281. v-for="item in grainList"
  282. :key="item.constKey"
  283. :label="item.constValue"
  284. :value="item.constValue"
  285. />
  286. </ws-select>
  287. </ws-form-item>
  288. <!--品级-->
  289. <ws-form-item label="品级" span="1" prop="grade">
  290. <ws-select
  291. v-model="dataList.grade"
  292. placeholder
  293. class="typeselect"
  294. @change="selectgrade"
  295. >
  296. <ws-option
  297. v-for="item in gradeList"
  298. :key="item.constKey"
  299. :label="item.constValue"
  300. :value="item.constValue"
  301. />
  302. </ws-select>
  303. </ws-form-item>
  304. <!--产地-->
  305. <ws-form-item label="产地" span="1" prop="unitPrice">
  306. <el-cascader
  307. :options="options1_"
  308. v-model="selectedOptions1"
  309. clearable
  310. size="large"
  311. placeholder="请选择产地"
  312. @change="handleChange1"
  313. style="width: 200%"
  314. />
  315. </ws-form-item>
  316. <!--产出年份-->
  317. <el-form-item label="产出年份" span="1" prop="outputYear">
  318. <el-date-picker
  319. v-model="dataList.outputYear"
  320. type="year"
  321. align="right"
  322. unlink-panels
  323. range-separator="至"
  324. placeholder="产出年份"
  325. ></el-date-picker>
  326. </el-form-item>
  327. </el-form>
  328. </div>
  329. </div>
  330. <!-- 提交 -->
  331. <div style="text-align: right; padding: 10px" class="center">
  332. <el-button class="bg-bottom" type="primary" size="small" @click="submit()"
  333. >提交</el-button
  334. >
  335. </div>
  336. </div>
  337. </template>
  338. <script>
  339. import {
  340. procurementLook,
  341. procurementEdit,
  342. } from '@/model/purchasingManagement/index'
  343. import {
  344. regionData,
  345. CodeToText,
  346. TextToCode,
  347. provinceAndCityData,
  348. } from 'element-china-area-data'
  349. import { packList } from '@/model/contarct/index'
  350. import Pagination from '@/components/Pagination'
  351. import { mapActions, mapGetters, mapState } from 'vuex'
  352. import WsUpload from '@/components/WsUpload'
  353. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  354. import { dayjs, EventBus } from 'base-core-lib'
  355. export default {
  356. name: 'viewSpareMoney',
  357. components: {
  358. WsUpload,
  359. Pagination,
  360. },
  361. watch: {
  362. // vesselId(val) {
  363. // this.getList()
  364. // },
  365. isShow(val) {
  366. this.showType = val
  367. },
  368. },
  369. computed: {
  370. ...mapGetters(['dataList']),
  371. },
  372. data() {
  373. return {
  374. //弹出框
  375. dialogViewSpareMoney: false,
  376. dialogApproveFormVisible: false,
  377. // 船舶类型
  378. monetaryKey: null,
  379. // 表格显示数据
  380. tableDate: [],
  381. // 是否显示
  382. showType: true,
  383. // 年
  384. year: '',
  385. options1_: provinceAndCityData,
  386. options_: regionData,
  387. packingTypeList: '',
  388. procurementPlanTypeList: '',
  389. freightPayerList: '',
  390. searchTypeText: '',
  391. selectedOptions: [],
  392. selectedOptions1: [],
  393. contractNoList: [],
  394. deptBudgetTotal: 0,
  395. readonly: true,
  396. currentPage: 1,
  397. pageSize: 10,
  398. searchType: 1,
  399. warehouseList1: [],
  400. searchKeyWord: '',
  401. radio: '1',
  402. contractType: 2,
  403. startDate: null,
  404. endDate: null,
  405. goodnameList: {},
  406. grainList: [],
  407. checked: true,
  408. form: {},
  409. pcFlag: 1,
  410. staffList: [],
  411. options: [],
  412. storageType: [],
  413. storageType1: [],
  414. outContractNo: [],
  415. // 提交类型
  416. submitType: true,
  417. status: [],
  418. unitPricechange: [],
  419. warehouseNameList: [],
  420. warehouseNameList1: [],
  421. waterContentchange: [],
  422. appendixIdsAdd: '',
  423. uploadSuccess: {},
  424. warehouseInOutDetail: {},
  425. onChange: {},
  426. deptBudgetList1: [],
  427. gradeList: [],
  428. rules: {
  429. netWeight: [
  430. {
  431. required: true,
  432. type: 'number',
  433. message: '请输入活动名称',
  434. trigger: 'blur',
  435. },
  436. ],
  437. },
  438. outputYear: [],
  439. size: 10,
  440. compId: sessionStorage.getItem('ws-pf_compId'),
  441. deptCircularPage: {},
  442. packtypeList: {},
  443. date: {
  444. year: dayjs().format('YYYY'),
  445. month: dayjs().format('MM'),
  446. },
  447. contractList: [],
  448. inOutTaskNo: '',
  449. dataList: { taskTypeKey: '1' },
  450. dataList1: { taskTypeKey: '1' },
  451. historyList: [],
  452. pickerBeginDateBefore: {
  453. disabledDate: (time) => {
  454. return time.getTime() > Date.now()
  455. },
  456. },
  457. accessoryTFs: false,
  458. }
  459. },
  460. activated() {
  461. this.loaddata()
  462. this.showType = this.isShow
  463. },
  464. mounted() {},
  465. methods: {
  466. //返回按钮
  467. revert() {
  468. this.$router.go(-1)
  469. },
  470. returnsales() {
  471. this.dataList = {}
  472. // this.selectedOptions = ''
  473. this.$router.go(-1)
  474. },
  475. // 获取当前年月日
  476. getdate() {
  477. var date = new Date()
  478. var year = date.getFullYear() //获取完整的年份(4位)
  479. var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  480. var datetime = date.getDate() //获取当前日(1-31)
  481. if (mouth < 10) {
  482. mouth = '0' + mouth
  483. }
  484. if (datetime < 10) {
  485. datetime = '0' + datetime
  486. }
  487. return year + mouth + datetime
  488. },
  489. // 随机验证码
  490. verifyinit() {
  491. var arr = []
  492. for (var i = 48; i < 123; i++) {
  493. if (i > 57 && i < 65) continue
  494. if (i > 90 && i < 97) continue
  495. arr.push(String.fromCharCode(i))
  496. }
  497. arr.sort(function () {
  498. return Math.random() - 0.5
  499. })
  500. arr.length = 4
  501. return arr.join('')
  502. },
  503. dataFilter(val) {
  504. // console.log(val,"名")
  505. this.deptBudgetList.staffList = val
  506. if (val) {
  507. //val存在
  508. this.options = this.staffList.filter((item) => {
  509. if (
  510. !!~item.staffName.indexOf(val) ||
  511. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  512. ) {
  513. return true
  514. }
  515. })
  516. } else {
  517. //val为空时,还原数组
  518. this.options = this.staffList
  519. }
  520. },
  521. selecttaskType(e) {
  522. for (var i = 0; i < this.taskTypeList.length; i++) {
  523. if (this.taskTypeList[i].value == e) {
  524. this.searchType = this.taskTypeList[i].type
  525. }
  526. }
  527. },
  528. selectstaff(e) {
  529. for (var i = 0; i < this.staffList.length; i++) {
  530. if (this.staffList[i].staffName == e) {
  531. this.dataList.agentKey = this.staffList[i].staffId
  532. }
  533. }
  534. },
  535. selectstaff1(e) {
  536. for (var i = 0; i < this.staffList.length; i++) {
  537. if (this.staffList[i].staffName == e) {
  538. this.dataList1.agentKey = this.staffList[i].staffId
  539. }
  540. }
  541. },
  542. selectgrain(e) {
  543. for (var i = 0; i < this.grainList.length; i++) {
  544. if (this.grainList[i].constValue == e) {
  545. this.dataList.grainKey = this.grainList[i].constKey
  546. }
  547. }
  548. },
  549. selectpackingType(e) {
  550. for (var i = 0; i < this.packingTypeList.length; i++) {
  551. if (this.packingTypeList[i].constValue == e) {
  552. this.dataList.packingTypeKey = this.packingTypeList[i].constKey
  553. }
  554. }
  555. },
  556. selectfreightPayer(e) {
  557. for (var i = 0; i < this.freightPayerList.length; i++) {
  558. if (this.freightPayerList[i].constValue == e) {
  559. this.dataList.freightPayerKey = this.freightPayerList[i].constKey
  560. }
  561. }
  562. },
  563. selectgrade(e) {
  564. for (var i = 0; i < this.gradeList.length; i++) {
  565. if (this.gradeList[i].constValue == e) {
  566. this.dataList.gradeKey = this.gradeList[i].constKey
  567. }
  568. }
  569. },
  570. selectprocurementPlanType(e) {
  571. for (var i = 0; i < this.procurementPlanTypeList.length; i++) {
  572. if (this.procurementPlanTypeList[i].constValue == e) {
  573. this.dataList.procurementPlanTypekey =
  574. this.procurementPlanTypeList[i].constKey
  575. }
  576. }
  577. },
  578. handleChange(value) {
  579. this.selectedOptions = value
  580. this.dataList.receivePrivate = CodeToText[value[0]]
  581. this.dataList.receiveCity = CodeToText[value[1]]
  582. this.dataList.receiveArea = CodeToText[value[2]]
  583. },
  584. handleChange1(value) {
  585. this.selectedOptions1 = value
  586. this.dataList.outputPrivate = CodeToText[value[0]]
  587. this.dataList.outputCity = CodeToText[value[1]]
  588. },
  589. submit() {
  590. if (this.outputYear) {
  591. this.startDate = this.dateFormat('YYYY-mm-dd', this.outputYear[0])
  592. this.endDate = this.dateFormat('YYYY-mm-dd', this.outputYear[1])
  593. } else {
  594. this.startDate = ''
  595. this.endDate = ''
  596. }
  597. // this.getList()
  598. },
  599. //关闭
  600. close() {
  601. this.$router.push({ path: 'procurementPlanList' })
  602. },
  603. loaddata() {
  604. procurementLook({ id: this.$route.query.id })
  605. .toPromise()
  606. .then((response) => {
  607. this.dataList = response
  608. var tmp = []
  609. tmp[0] = TextToCode[this.dataList.receivePrivate].code
  610. tmp[1] = TextToCode[this.dataList.receivePrivate][this.dataList.receiveCity].code
  611. tmp[2] = TextToCode[this.dataList.receivePrivate][this.dataList.receiveCity][this.dataList.receiveArea].code
  612. this.selectedOptions = tmp
  613. var tmp1 = []
  614. tmp1[0] = TextToCode[this.dataList.outputPrivate].code
  615. tmp1[1] = TextToCode[this.dataList.outputPrivate][this.dataList.outputCity].code
  616. this.selectedOptions1 = tmp1
  617. })
  618. // 货名
  619. packList({ constId: 'CON2' })
  620. .toPromise()
  621. .then((response) => {
  622. this.goodnameList = response
  623. })
  624. // 品级
  625. packList({ constId: 'CON3' })
  626. .toPromise()
  627. .then((response) => {
  628. this.gradeList = response
  629. })
  630. //粒形
  631. packList({ constId: 'PRO4' })
  632. .toPromise()
  633. .then((response) => {
  634. this.grainList = response
  635. })
  636. //类型
  637. packList({ constId: 'PRO1' })
  638. .toPromise()
  639. .then((response) => {
  640. this.procurementPlanTypeList = response
  641. })
  642. //包装方式
  643. packList({ constId: 'PRO2' })
  644. .toPromise()
  645. .then((response) => {
  646. this.packingTypeList = response
  647. })
  648. //运费承担方
  649. packList({ constId: 'PRO3' })
  650. .toPromise()
  651. .then((response) => {
  652. this.freightPayerList = response
  653. })
  654. },
  655. submit() {
  656. if (!this.dataList.title) {
  657. this.$message({
  658. message: '标题不能为空!',
  659. type: 'warning'
  660. })
  661. return
  662. }
  663. if (this.dataList.title.length>16) {
  664. this.$message({
  665. message: '标题输入错误!',
  666. type: 'warning'
  667. })
  668. return
  669. }
  670. if (!this.dataList.plannedPurchaseVolume) {
  671. this.$message({
  672. message: '计划采购量不能为空!',
  673. type: 'warning'
  674. })
  675. return
  676. }
  677. if (this.dataList.plannedPurchaseVolume>10000000||this.dataList.plannedPurchaseVolume<1) {
  678. this.$message({
  679. message: '计划采购量输入错误!',
  680. type: 'warning'
  681. })
  682. return
  683. }
  684. if (this.dataList.plannedPurchaseVolume.toString().indexOf('.')!=-1) {
  685. if(this.dataList.plannedPurchaseVolume.toString().split('.')[1].length>2){
  686. this.$message({
  687. message: '计划采购量输入错误!',
  688. type: 'warning'
  689. })
  690. return
  691. }
  692. }
  693. if (!this.dataList.minimumVolume) {
  694. this.$message({
  695. message: '最小成交量不能为空!',
  696. type: 'warning'
  697. })
  698. return
  699. }
  700. if (
  701. this.dataList.minimumVolume>10000000||this.dataList.minimumVolume<1) {
  702. this.$message({
  703. message: '最小成交量输入错误!',
  704. type: 'warning'
  705. })
  706. return
  707. }
  708. if (this.dataList.minimumVolume.toString().indexOf('.') != -1 &&this.dataList.minimumVolume.toString().split('.')[1].length >2) {
  709. this.$message({
  710. message: '最小成交量输入错误!',
  711. type: 'warning'
  712. })
  713. return
  714. }
  715. if (
  716. this.dataList.procurementPrice > 100000 ||
  717. this.dataList.procurementPrice < 0 ||
  718. (String(this.dataList.procurementPrice).indexOf(
  719. '.'
  720. ) != -1 &&
  721. String(this.dataList.procurementPrice).length -
  722. (String(this.dataList.procurementPrice).indexOf(
  723. '.'
  724. ) +
  725. 1) >
  726. 2)
  727. ) {
  728. this.$message({
  729. message: '采购价格输入错误',
  730. type: 'warning',
  731. })
  732. return
  733. }
  734. if (
  735. this.dataList.basisPrice&&String(this.dataList.basisPrice).indexOf('.') != -1 &&
  736. String(dataList.basisPrice).length -
  737. (String(this.dataList.basisPrice).indexOf('.') + 1) >
  738. 2||this.dataList.basisPrice>10000||this.dataList.basisPrice<-10000){
  739. this.$message({
  740. message: '基差输入错误',
  741. type: 'warning'
  742. })
  743. return
  744. }
  745. if (!this.dataList.buyer) {
  746. this.$message({
  747. message: '买方不能为空!',
  748. type: 'warning'
  749. })
  750. return
  751. }
  752. if (this.dataList.buyer.length>25||this.dataList.buyer.length<1) {
  753. this.$message({
  754. message: '买方输入错误!',
  755. type: 'warning'
  756. })
  757. return
  758. }
  759. if (!this.dataList.buyerPhone) {
  760. this.$message({
  761. message: '请输入买方电话!',
  762. type: 'warning'
  763. })
  764. return
  765. }
  766. if (this.dataList.buyerPhone.length!=11) {
  767. this.$message({
  768. message: '买方电话输入错误!',
  769. type: 'warning'
  770. })
  771. return
  772. }
  773. if (!this.dataList.waterContent) {
  774. this.$message({
  775. message: '水分不能为空!',
  776. type: 'warning'
  777. })
  778. return
  779. }
  780. if (this.dataList.waterContent>40||this.dataList.waterContent<1) {
  781. this.$message({
  782. message: '水分输入错误!',
  783. type: 'warning'
  784. })
  785. return
  786. }
  787. if (String(this.dataList.waterContent).indexOf('.') != -1 &&
  788. String(this.dataList.waterContent).length -
  789. (String(this.dataList.waterContent).indexOf('.') + 1) >
  790. 2) {
  791. this.$message({
  792. message: '水分输入错误',
  793. type: 'warning'
  794. })
  795. return
  796. }
  797. if (!this.dataList.bulkDensity) {
  798. this.$message({
  799. message: '容重不能为空!',
  800. type: 'warning'
  801. })
  802. return
  803. }
  804. if (
  805. this.dataList.bulkDensity&&String(this.dataList.bulkDensity).indexOf('.') != -1 &&
  806. String(this.dataList.bulkDensity).length -
  807. (String(this.dataList.bulkDensity).indexOf('.') + 1) >
  808. 2||this.dataList.bulkDensity>1000||this.dataList.bulkDensity<500){
  809. this.$message({
  810. message: '容重输入错误',
  811. type: 'warning'
  812. })
  813. return
  814. }
  815. if (
  816. this.dataList.protein&&String(this.dataList.protein).indexOf('.') != -1 &&
  817. String(this.dataList.protein).length -
  818. (String(this.dataList.protein).indexOf('.') + 1) >
  819. 2||this.dataList.protein&&this.dataList.protein>80||this.dataList.protein&&this.dataList.protein<1){
  820. this.$message({
  821. message: '蛋白占比输入错误',
  822. type: 'warning'
  823. })
  824. return
  825. }
  826. if (
  827. this.dataList.impurity!=''&&this.dataList.impurity!=undefined&&String(this.dataList.impurity).indexOf('.') != -1 &&
  828. String(this.dataList.impurity).length -
  829. (String(this.dataList.impurity).indexOf('.') + 1) >2
  830. ||this.dataList.impurity>40||this.dataList.impurity<1) {
  831. this.$message({
  832. message: '杂质输入错误',
  833. type: 'warning'
  834. })
  835. return
  836. }
  837. if (
  838. this.dataList.mildewGrain!=''&&this.dataList.mildewGrain!=undefined&&String(this.dataList.mildewGrain).indexOf('.') != -1 &&
  839. String(this.dataList.mildewGrain).length -
  840. (String(this.dataList.mildewGrain).indexOf('.') + 1) >
  841. 2||this.dataList.mildewGrain>40||this.dataList.mildewGrain<1) {
  842. this.$message({
  843. message: '霉变粒输入错误',
  844. type: 'warning'
  845. })
  846. return
  847. }
  848. if (
  849. this.dataList.jiaorenli!=''&&this.dataList.jiaorenli!=undefined&&String(this.dataList.jiaorenli).indexOf('.') != -1 &&
  850. String(this.dataList.jiaorenli).length -
  851. (String(this.dataList.jiaorenli).indexOf('.') + 1) >
  852. 2||this.dataList.jiaorenli>40||this.dataList.jiaorenli<1) {
  853. this.$message({
  854. message: '热损伤输入错误',
  855. type: 'warning'
  856. })
  857. return
  858. }
  859. if (
  860. this.dataList.imperfectGrain!=''&&this.dataList.imperfectGrain!=undefined&&String(this.dataList.imperfectGrain).indexOf('.') != -1 &&
  861. String(this.dataList.imperfectGrain).length -
  862. (String(this.dataList.imperfectGrain).indexOf('.') + 1) >
  863. 2||this.dataList.imperfectGrain>40||this.dataList.imperfectGrain<1) {
  864. this.$message({
  865. message: '不完善粒输入错误',
  866. type: 'warning'
  867. })
  868. return
  869. }
  870. this.dataList.id = this.$route.query.id
  871. this.$confirm(`提交后该采购信息将发布到交易平台,是否确定提交?`, {
  872. cancelButtonText: '取消',
  873. confirmButtonText: '确定',
  874. type: 'warning',
  875. })
  876. .then(() => {
  877. this.$refs.dataList.validate((valid) => {
  878. if (valid) {
  879. this.dataList.receivePrivate = CodeToText[this.selectedOptions[0]]
  880. this.dataList.receiveCity = CodeToText[this.selectedOptions[1]]
  881. this.dataList.receiveArea = CodeToText[this.selectedOptions[2]]
  882. this.dataList.outputPrivate = CodeToText[this.selectedOptions1[0]]
  883. this.dataList.outputCity = CodeToText[this.selectedOptions1[1]]
  884. if(this.dataList.procurementPlanType=='期货'){
  885. this.dataList.basisPrice='-'+Math.abs(this.dataList.basisPrice)
  886. }
  887. this.dataList.compId = this.compId
  888. // this.dataList.pcFlag = 1
  889. this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
  890. this.dataList.unitPrice=this.dataList.procurementPrice
  891. procurementEdit(this.dataList)
  892. .toPromise()
  893. .then((response) => {
  894. this.$message.success('编辑成功')
  895. this.$router.push({ path: 'procurementPlanList' })
  896. })
  897. } else {
  898. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  899. return false
  900. }
  901. })
  902. })
  903. .catch(() => {
  904. console.log(3523543534)
  905. return false
  906. })
  907. },
  908. selectwarehouseName() {},
  909. tarechange(e) {
  910. if (this.dataList.grossWeight && this.dataList.tare) {
  911. this.dataList.netWeight = Number(
  912. this.dataList.grossWeight - this.dataList.tare
  913. )
  914. }
  915. },
  916. grossWeightchange(e) {
  917. if (this.dataList.grossWeight && this.dataList.tare) {
  918. this.dataList.netWeight = Number(
  919. this.dataList.grossWeight - this.dataList.tare
  920. )
  921. }
  922. },
  923. selectgoodsName(e) {
  924. for (var i = 0; i < this.goodnameList.length; i++) {
  925. if (this.goodnameList[i].constValue == e) {
  926. this.dataList.goodsNameKey = this.goodnameList[i].constKey
  927. }
  928. }
  929. },
  930. selectpackingMethod(e) {
  931. for (var i = 0; i < this.packtypeList.length; i++) {
  932. if (this.packtypeList[i].constValue == e) {
  933. this.dataList.packingMethodKey = this.packtypeList[i].constKey
  934. }
  935. }
  936. },
  937. selectpackingMethod1(e) {
  938. for (var i = 0; i < this.packtypeList.length; i++) {
  939. if (this.packtypeList[i].constValue == e) {
  940. this.dataList1.packingMethodKey = this.packtypeList[i].constKey
  941. }
  942. }
  943. },
  944. selectstorageType(e) {
  945. for (var i = 0; i < this.storageType.length; i++) {
  946. if (this.storageType[i].constValue == e) {
  947. this.dataList.inOutTypeKey = this.storageType[i].constKey
  948. }
  949. }
  950. },
  951. selectstorageType1(e) {
  952. for (var i = 0; i < this.storageType1.length; i++) {
  953. if (this.storageType1[i].constValue == e) {
  954. this.dataList1.inOutTypeKey = this.storageType[i].constKey
  955. }
  956. }
  957. },
  958. handleClose() {
  959. this.accessoryTFs = false
  960. },
  961. tasktypechange() {
  962. this.tasknumber()
  963. },
  964. GetRandomNum(Min, Max) {
  965. var Range = Max - Min
  966. var Rand = Math.random()
  967. return Min + Math.round(Rand * Range)
  968. },
  969. // deletecontract(){},
  970. //删除
  971. approve() {},
  972. listQuery() {},
  973. total() {},
  974. clearfiltQuery() {},
  975. selectCrtDuty() {},
  976. },
  977. }
  978. </script>
  979. <style lang="scss" scoped>
  980. /deep/.basicInformation {
  981. .el-info-table {
  982. border: none;
  983. position: relative;
  984. }
  985. .el-form-item {
  986. width: 33.3333%;
  987. border: none;
  988. margin: 0;
  989. .el-form-item__label {
  990. text-align: left;
  991. font-size: 14px;
  992. font-family: PingFangSC-Regular, PingFang SC;
  993. font-weight: 400;
  994. color: #8890b1;
  995. }
  996. .el-form-item__content {
  997. padding-left: 0px;
  998. padding-right: 10px;
  999. // background: #fff;
  1000. white-space: nowrap;
  1001. height: 40px;
  1002. display: flex;
  1003. -webkit-box-align: center;
  1004. align-items: center;
  1005. text-align: left;
  1006. overflow: hidden;
  1007. }
  1008. }
  1009. }
  1010. /deep/.el-radio {
  1011. color: #606266;
  1012. font-weight: 500;
  1013. line-height: 1;
  1014. cursor: pointer;
  1015. white-space: nowrap;
  1016. outline: 0;
  1017. margin-right: 30px;
  1018. margin-top: 15px;
  1019. }
  1020. /deep/.el-radio__inner {
  1021. border: 1px solid #dcdfe6;
  1022. border-radius: 100%;
  1023. width: 14px;
  1024. height: 14px;
  1025. background-color: #fff;
  1026. cursor: pointer;
  1027. -webkit-box-sizing: border-box;
  1028. box-sizing: border-box;
  1029. margin-left: 100px;
  1030. }
  1031. /deep/.el-radio__input {
  1032. white-space: nowrap;
  1033. cursor: pointer;
  1034. outline: 0;
  1035. line-height: 1;
  1036. vertical-align: middle;
  1037. margin-top: -1px;
  1038. }
  1039. .title {
  1040. position: relative;
  1041. padding-left: 10px;
  1042. }
  1043. .title::before {
  1044. content: '';
  1045. display: inline-block;
  1046. width: 5px;
  1047. height: 30px;
  1048. background: #5473e8;
  1049. position: absolute;
  1050. left: 0;
  1051. }
  1052. .el-form {
  1053. padding: 0 15%;
  1054. display: flex;
  1055. flex-wrap: wrap;
  1056. margin-left: -50px;
  1057. margin-top: 15px;
  1058. width: 110%;
  1059. }
  1060. .el-button--primary {
  1061. background-color: #5878e8;
  1062. border-color: #5878e8;
  1063. }
  1064. .el-col {
  1065. background: #f6f7fc;
  1066. }
  1067. .bg-right {
  1068. text-align: right;
  1069. padding: 16px 20px;
  1070. }
  1071. .center {
  1072. position: relative;
  1073. top: 50px;
  1074. width: 40%;
  1075. height: 2000px;
  1076. margin: 0 auto;
  1077. margin-right: 180px;
  1078. }
  1079. /deep/.el-form-item__label {
  1080. width: 160px;
  1081. }
  1082. .inspector {
  1083. width: 50%;
  1084. }
  1085. /deep/.el-form-item--small .el-form-item__label,
  1086. .el-form-item--small .el-form-item__content {
  1087. text-align: left;
  1088. }
  1089. /deep/.el-input--small {
  1090. font-size: 13px;
  1091. position: relative;
  1092. display: inline-block;
  1093. }
  1094. .center1 .small-title {
  1095. margin-left: 323px;
  1096. }
  1097. .center1 {
  1098. width: 90%;
  1099. margin: 0 auto;
  1100. margin-left: 10px;
  1101. margin-top: 25px;
  1102. }
  1103. /deep/.el-input--small .el-input__inner {
  1104. height: 32px;
  1105. line-height: 32px;
  1106. }
  1107. /deep/.el-select {
  1108. display: inline-block;
  1109. position: relative;
  1110. width: 100%;
  1111. }
  1112. .annu {
  1113. height: 81px;
  1114. background: #ffffff;
  1115. border-radius: 4px;
  1116. }
  1117. .basicInformation .el-form-item {
  1118. width: 50.3333%;
  1119. border: none;
  1120. margin: 0;
  1121. }
  1122. .el-form {
  1123. font-size: 14px;
  1124. font-family: PingFangSC-Regular, PingFang SC;
  1125. font-weight: 400;
  1126. color: #8890b1;
  1127. line-height: 16px;
  1128. margin-left: 130px;
  1129. }
  1130. .a {
  1131. margin-left: -32px;
  1132. }
  1133. .el-radio-group {
  1134. margin-left: 80px;
  1135. }
  1136. .ding {
  1137. height: 23px;
  1138. background: #e8ecf6;
  1139. box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
  1140. }
  1141. .nav2 {
  1142. height: 25px;
  1143. background: #e8ecf6;
  1144. margin-top: 15px;
  1145. }
  1146. .ziti {
  1147. width: 72px;
  1148. height: 20px;
  1149. font-size: 14px;
  1150. font-family: PingFangSC-Regular, PingFang SC;
  1151. font-weight: 400;
  1152. color: #8890b1;
  1153. line-height: 20px;
  1154. margin-left: 314px;
  1155. /* margin-top: 112px; */
  1156. }
  1157. /deep/.ziti1 {
  1158. height: 40px;
  1159. font-size: 16px;
  1160. font-family: PingFangSC-Medium, PingFang SC;
  1161. font-weight: 500;
  1162. color: #262626;
  1163. line-height: 20px;
  1164. margin-left: 381px;
  1165. margin-top: -21px;
  1166. width: 100px;
  1167. }
  1168. .winseaview-view {
  1169. padding: 0 0 20px;
  1170. }
  1171. .container {
  1172. overflow: scroll;
  1173. height: 93vh;
  1174. }
  1175. /deep/.basicInformation .el-form-item .el-form-item__content {
  1176. padding-left: 0px;
  1177. padding-right: 10px;
  1178. white-space: nowrap;
  1179. height: 40px;
  1180. display: -webkit-box;
  1181. display: -ms-flexbox;
  1182. display: flex;
  1183. -webkit-box-align: center;
  1184. -ms-flex-align: center;
  1185. align-items: center;
  1186. text-align: left;
  1187. overflow: hidden;
  1188. font-size: 12px;
  1189. font-family: PingFangSC-Regular, PingFang SC;
  1190. font-weight: 400;
  1191. color: #232323;
  1192. line-height: 14px;
  1193. }
  1194. .nav {
  1195. width: 400px;
  1196. height: 20px;
  1197. }
  1198. .readonly :after {
  1199. content: '*';
  1200. color: #ff2727;
  1201. position: absolute;
  1202. right: 8px;
  1203. z-index: 10;
  1204. top: 21%;
  1205. font-size: 20px;
  1206. }
  1207. /deep/.typeselect .el-input__inner {
  1208. color: #8890b1;
  1209. }
  1210. </style>