futuresPurchaseContractAdd.vue 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894
  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 class="bg-bottom" type="primary" size="small" @click="returnsales()"><img width="6" height="10"
  10. style="vertical-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
  11. </el-button>
  12. </el-col>
  13. </el-row>
  14. <ws-form ref="deptBudgetList" :rules="rules" :model="deptBudgetList">
  15. <div class="remark">
  16. <h3>基本信息</h3>
  17. <p style="color: #8890b1">
  18. 注:基本信息和货物信息均为必填项,“<span style="color:red">*</span>” 标记的条目提交后不可修改。
  19. </p>
  20. </div>
  21. <ws-info-table>
  22. <!--合同编号-->
  23. <ws-form-item label="合同编号" span="1" prop="contractNo" class="readonly" required>
  24. <ws-input v-model="deptBudgetList.contractNo" placeholder="请输入合同编号" maxlength="50" size="small" />
  25. </ws-form-item>
  26. <!--运输方式-->
  27. <ws-form-item label="运输方式" span="1" prop="shippingType">
  28. <ws-input v-model="deptBudgetList.shippingType" placeholder="请输入运输方式" maxlength="100" size="small" />
  29. </ws-form-item>
  30. <!--买方-->
  31. <ws-form-item label="买方" span="1" prop="buyer">
  32. <!-- <ws-input v-model="deptBudgetList.buyer" placeholder="请输入买方名称" maxlength="100" size="small" /> -->
  33. <el-autocomplete class="inline-input" v-model="deptBudgetList.buyer" :fetch-suggestions="querySearch1"
  34. placeholder="请输入买方名称" @select="handleSelect"></el-autocomplete>
  35. </ws-form-item>
  36. <!--结算方式-->
  37. <ws-form-item label="结算方式" span="1" prop="settlementMethod">
  38. <ws-input v-model="deptBudgetList.settlementMethod" placeholder="请输入结算方式" maxlength="100" size="small" />
  39. </ws-form-item>
  40. <!--买方电话-->
  41. <ws-form-item label="买方电话" span="1" prop="buyerPhone">
  42. <el-autocomplete class="inline-input" v-model="deptBudgetList.buyerPhone" :fetch-suggestions="querySearch3"
  43. placeholder="请输入买方电话" @select="handleSelect"></el-autocomplete>
  44. <!-- <ws-input v-model.number="deptBudgetList.buyerPhone" placeholder="请输入买方电话" maxlength="100" size="small" /> -->
  45. </ws-form-item>
  46. <ws-form-item label="交货方式" span="1" prop="seller" class="readonly">
  47. <el-radio v-model="deptBudgetList.deliverType" label="1">我方自提</el-radio>
  48. <el-radio v-model="deptBudgetList.deliverType" label="2">对方送货</el-radio>
  49. </ws-form-item>
  50. <!--卖方-->
  51. <ws-form-item label="卖方" span="1" prop="seller">
  52. <el-autocomplete class="inline-input" v-model="deptBudgetList.seller" :fetch-suggestions="querySearch2"
  53. placeholder="请输入卖方名称" @select="handleSelect"></el-autocomplete>
  54. <!-- <ws-input v-model="deptBudgetList.seller" placeholder="请输入卖方名称" maxlength="100" size="small" /> -->
  55. </ws-form-item>
  56. <!--包装方式-->
  57. <ws-form-item label="包装方式" span="1" prop="packingMethod">
  58. <ws-select v-model="deptBudgetList.packingMethod" placeholder="" class="typeselect" :value="value1"
  59. @change="selectpackingMethod">
  60. <ws-option v-for="item in packtypeList" :key="item.constKey" :label="item.constValue"
  61. :value="item.constValue" />
  62. </ws-select>
  63. </ws-form-item>
  64. <!--卖方电话-->
  65. <ws-form-item label="卖方电话" span="1" prop="sellerPhone">
  66. <el-autocomplete class="inline-input" v-model="deptBudgetList.sellerPhone" :fetch-suggestions="querySearch4"
  67. placeholder="请输入卖方电话" @select="handleSelect"></el-autocomplete>
  68. <!-- <ws-input v-model="deptBudgetList.sellerPhone" placeholder="请输入卖方电话" maxlength="100" size="small" /> -->
  69. </ws-form-item>
  70. <!--验收方式-->
  71. <ws-form-item label="验收方式" span="1" prop="acceptanceMethod">
  72. <el-select v-model="deptBudgetList.acceptanceMethod" placeholder="请选择验收方式" style="width: 100%" filterable
  73. @change="selectunitList">
  74. <el-option v-for="(item, index) in unitList" :key="item.constValue" :label="item.constValue"
  75. :value="item.constValue">
  76. <span class="unit-left" style="float: left">
  77. <span v-if="item.flag == 'delete'"> {{ item.constValue }}</span>
  78. <!-- 新增文本框 -->
  79. <div style="width: 160px" v-if="item.flag !== 'delete'" @click.stop>
  80. <ws-input v-model="item.constValue" clearable maxlength="10" style="width: 100%"></ws-input>
  81. </div>
  82. </span>
  83. <span style="float: right; color: #8492a6; font-size: 13px">
  84. <!-- 对号 -->
  85. <i class="el-icon-check" style="line-height: 29px; margin-left: 10px" v-if="item.flag !== 'delete'"
  86. @click.stop="saveClick(item, index)"></i>
  87. <!-- 编辑 -->
  88. <i class="el-icon-edit" style="line-height: 29px; margin-left: 10px" v-if="item.flag == 'delete'"
  89. @click.stop="editClick(item, index)"></i>
  90. <!-- 删除 -->
  91. <i class="el-icon-delete" style="line-height: 29px" @click.stop="deleteClick(item, index)"></i>
  92. </span>
  93. </el-option>
  94. <!-- 新增按钮 -->
  95. <el-option value="" label="">
  96. <div style="
  97. text-align: right;
  98. border-top: 1px solid #dcdfe6;
  99. padding: 5px;
  100. ">
  101. <ws-button type="primary" @click.stop="addClick">{{
  102. $t('button.add')
  103. }}</ws-button>
  104. </div>
  105. </el-option>
  106. </el-select>
  107. </ws-form-item>
  108. <!--交易数量(吨)-->
  109. <ws-form-item label="交易数量(吨)" span="1" prop="weight">
  110. <ws-input @input="weightchange" v-model="deptBudgetList.weight" placeholder="请输入重量(吨)" maxlength="100"
  111. size="small" />
  112. </ws-form-item>
  113. <!--入库费(元/吨)-->
  114. <ws-form-item label="入库费(元/吨)" span="1" prop="warehousingFee">
  115. <ws-input v-model="deptBudgetList.warehousingFee" placeholder="请输入入库费(元/吨)" maxlength="100" size="small" />
  116. </ws-form-item>
  117. <!--基差(元/吨)-->
  118. <ws-form-item label="基差(元/吨)" span="1" prop="basisPrice">
  119. <ws-input v-model="deptBudgetList.basisPrice" placeholder="请输入基差(元/吨)" maxlength="100" size="small" />
  120. </ws-form-item>
  121. <!--计量标准-->
  122. <ws-form-item label="计量标准" span="1" prop="measurementStandard">
  123. <ws-input v-model="deptBudgetList.measurementStandard" placeholder="请输入计量标准,如库内磅单" maxlength="100"
  124. size="small" />
  125. </ws-form-item>
  126. <!--交易所-->
  127. <ws-form-item label="交易所" span="1" prop="transactionsPlace">
  128. <ws-input v-model="deptBudgetList.transactionsPlace" placeholder="请输入交易所" maxlength="100" size="small" />
  129. </ws-form-item>
  130. <!--收货库-->
  131. <el-form-item label="收货库" span="1" prop="receiveWarehouse">
  132. <el-select v-model="deptBudgetList.receiveWarehouse" placeholder="请选择收货库" class="typeselect"
  133. @change="selectwarehouseName">
  134. <el-option v-for="item in warehouseNameList" :key="item.constKey" :label="item.warehouseName"
  135. :value="item.warehouseName" />
  136. </el-select>
  137. </el-form-item>
  138. <!--合约号-->
  139. <ws-form-item label="合约号" span="1" prop="contractNumber">
  140. <ws-input v-model="deptBudgetList.contractNumber" placeholder="请输入合约号" maxlength="100" size="small" />
  141. </ws-form-item>
  142. <!--交货所在地区-->
  143. <ws-form-item label="交货所在地区" span="1" prop="sourceGoods">
  144. <!-- <el-cascader
  145. :options="options_"
  146. v-model="selectedOptions"
  147. clearable
  148. size="large"
  149. placeholder="请选择交货所在地区"
  150. style="width: 200%"
  151. @change="handleChange"
  152. /> -->
  153. <el-button @click="mapInputClick('deliveryProv')" class="address-btn">
  154. {{ newSelectedOptions1 }}
  155. </el-button>
  156. </ws-form-item>
  157. <!--点价(元/吨)-->
  158. <ws-form-item label="点价(元/吨)" span="1" prop="pointPrice">
  159. <ws-input v-model="deptBudgetList.pointPrice" placeholder="请输入合约点价" maxlength="100" size="small" />
  160. </ws-form-item>
  161. <!--交货详细地址-->
  162. <ws-form-item label="交货详细地址" span="1" prop="placeDelivery">
  163. <ws-input v-model="deptBudgetList.placeDelivery" placeholder="请输入交货详细地址" maxlength="20" size="small" />
  164. </ws-form-item>
  165. <!--点价日期-->
  166. <ws-form-item label="点价日期" span="1" prop="pointPriceDate">
  167. <ws-date-picker v-model="deptBudgetList.pointPriceDate" type="date" placeholder="请选择点价日期"
  168. value-format="yyyy-MM-dd" />
  169. </ws-form-item>
  170. <!--签订日期-->
  171. <ws-form-item label="签订日期" span="1" prop="signingDate">
  172. <ws-date-picker v-model="deptBudgetList.signingDate" type="date" placeholder="请选择合同签订日期"
  173. value-format="yyyy-MM-dd" />
  174. </ws-form-item>
  175. <!--交货日期(起)-->
  176. <ws-form-item label="交货日期(起)" span="1" prop="deliveryDateStart">
  177. <ws-date-picker v-model="deptBudgetList.deliveryDateStart" type="date" placeholder="请选择交货日期(起)"
  178. value-format="yyyy-MM-dd" />
  179. </ws-form-item>
  180. <!--临时仓库负责人-->
  181. <ws-form-item v-show="deptBudgetList.deliverType == 1" label="临时仓库负责人" span="1" prop="packingMethod">
  182. <el-select v-model="deptBudgetList.personCharge" placeholder="请选择临时仓库负责人" filterable clearable
  183. @change="selectstaff">
  184. <el-option v-for="item in options" :key="item.value" :label="item.staffName" :value="item.staffName" />
  185. </el-select>
  186. </ws-form-item>
  187. <!--交货日期(止)-->
  188. <ws-form-item label="交货日期(止)" span="1" prop="deliveryDateEnd">
  189. <ws-date-picker v-model="deptBudgetList.deliveryDateEnd" type="date" placeholder="请选择交货日期(止)"
  190. value-format="yyyy-MM-dd" />
  191. </ws-form-item>
  192. </ws-info-table>
  193. <div class="wenzi">
  194. <h3>货物信息</h3>
  195. </div>
  196. <!--货物信息-->
  197. <ws-info-table>
  198. <!--货名-->
  199. <ws-form-item label="货名" span="1" prop="goodsName" class="readonly">
  200. <ws-select v-model="deptBudgetList.contractGoodsInfo.goodsName" placeholder="" class="typeselect"
  201. @change="selectgoodsName">
  202. <ws-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
  203. :value="item.constValue" />
  204. </ws-select>
  205. </ws-form-item>
  206. <!--水分(%)<=-->
  207. <ws-form-item label="水分(%)<=" span="1" prop="waterContent">
  208. <ws-input v-model="deptBudgetList.contractGoodsInfo.waterContent" placeholder="请输入水分占比" maxlength="100"
  209. size="small" />
  210. </ws-form-item>
  211. <!--品级-->
  212. <ws-form-item label="品级" span="1" prop="grade">
  213. <ws-select v-model="deptBudgetList.contractGoodsInfo.grade" placeholder="请选择品级" class="typeselect"
  214. @change="selectgrade">
  215. <ws-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
  216. :value="item.constValue" />
  217. </ws-select>
  218. </ws-form-item>
  219. <!--杂质(%)<=-->
  220. <ws-form-item label="杂质(%)<=" span="1" prop="impurity">
  221. <ws-input v-model="deptBudgetList.contractGoodsInfo.impurity" placeholder="请输入杂质占比(%)" maxlength="100"
  222. size="small" />
  223. </ws-form-item>
  224. <!--容重(克/升)>=-->
  225. <ws-form-item label="容重(克/升)>=" span="1" prop="bulkDensity">
  226. <ws-input v-model="deptBudgetList.contractGoodsInfo.bulkDensity" placeholder="请输入容重" maxlength="100"
  227. size="small" />
  228. </ws-form-item>
  229. <!--霉变粒(%)<=-->
  230. <ws-form-item label="霉变粒(%)<=" span="1" prop="mildewGrain">
  231. <ws-input v-model="deptBudgetList.contractGoodsInfo.mildewGrain" placeholder="请输入霉变粒占比(%)" maxlength="100"
  232. size="small" />
  233. </ws-form-item>
  234. <!--热损伤(%)<=-->
  235. <ws-form-item label="热损伤(%)<=" span="1" prop="jiaorenli">
  236. <ws-input v-model="deptBudgetList.contractGoodsInfo.jiaorenli" placeholder="请输入输入热损伤占比(%)" maxlength="100"
  237. size="small" />
  238. </ws-form-item>
  239. <!--不完善粒(%)<=-->
  240. <ws-form-item label="不完善粒(%)<=" span="1" prop="imperfectGrain">
  241. <ws-input v-model="deptBudgetList.contractGoodsInfo.imperfectGrain" placeholder="请输入不完善粒占比(%)" maxlength="100"
  242. size="small" />
  243. </ws-form-item>
  244. <!--蛋白(%)>=-->
  245. <ws-form-item label="蛋白(%)>=" span="1" prop="protein">
  246. <ws-input v-model="deptBudgetList.contractGoodsInfo.protein" placeholder="请输入蛋白占比(%)" maxlength="100"
  247. size="small" />
  248. </ws-form-item>
  249. <!--转基因-->
  250. <ws-form-item label="转基因" span="1" prop="transgene">
  251. <ws-select v-model="deptBudgetList.contractGoodsInfo.transgene" placeholder="请选择转基因要求" class="typeselect"
  252. @change="selecttransgene">
  253. <ws-option v-for="item in transgeneList" :key="item.constKey" :label="item.constValue"
  254. :value="item.constValue" />
  255. </ws-select>
  256. </ws-form-item>
  257. <!--产地-->
  258. <ws-form-item label="产地" span="1" prop="protein">
  259. <!-- <el-cascader
  260. :options="options1_"
  261. v-model="selectedOptions1"
  262. clearable
  263. size="large"
  264. placeholder="请选择产地"
  265. @change="handleChange1"
  266. style="width:200%"
  267. /> -->
  268. <el-button @click="mapInputClick('source')" class="address-btn">
  269. {{ newSelectedOptions }}
  270. </el-button>
  271. </ws-form-item>
  272. </ws-info-table>
  273. <div class="wenzi">
  274. <h3>流程信息</h3>
  275. </div>
  276. <!--流程信息-->
  277. <ws-info-table>
  278. <!--已付款(元)-->
  279. <ws-form-item label="已付款(元)" span="1" prop="goodsNameKey">
  280. <ws-input v-model="deptBudgetList.contractProcessInfo.goodsNameKey" placeholder="请输入已付款(元)" maxlength="100"
  281. size="small" />
  282. </ws-form-item>
  283. <!--已开发票(元)-->
  284. <ws-form-item label="已开发票(元)" span="1" prop="goodsName">
  285. <ws-input v-model="deptBudgetList.contractProcessInfo.goodsName" placeholder="请输入已开发票(元)" maxlength="100"
  286. size="small" />
  287. </ws-form-item>
  288. <!--费用支出(元)-->
  289. <ws-form-item label="费用支出(元)" span="1" prop="waterContent">
  290. <ws-input v-model="deptBudgetList.contractProcessInfo.waterContent" placeholder="请输入费用支出(元)" maxlength="100"
  291. size="small" />
  292. </ws-form-item>
  293. <!--未开发票(元)-->
  294. <ws-form-item label="未开发票(元)" span="1" prop="impurity">
  295. <ws-input v-model="deptBudgetList.contractProcessInfo.impurity" placeholder="请输入未开发票(元)" maxlength="100"
  296. size="small" />
  297. </ws-form-item>
  298. <!--双章原件回收情况-->
  299. <ws-form-item label="双章原件回收情况" span="1" prop="grade">
  300. <ws-select v-model="deptBudgetList.contractProcessInfo.grade" placeholder="" class="typeselect"
  301. @change="selectChapterTwo">
  302. <ws-option v-for="item in ChapterTwoList" :key="item.constKey" :label="item.constValue"
  303. :value="item.constValue" />
  304. </ws-select>
  305. </ws-form-item>
  306. </ws-info-table>
  307. <div class="wenzi">
  308. <h3>备注信息</h3>
  309. </div>
  310. <!--备注信息-->
  311. <ws-input v-model="deptBudgetList.remarks" type="textarea" row="3" placeholder="请输入备注信息,不超过200字"
  312. maxlength="200" />
  313. <ws-upload ref="upload" :comp-id="compId" :appendix-ids="deptBudgetList.addressUrl" :size-limit="size"
  314. @onChange="onChange" accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar" />
  315. </ws-form>
  316. <div v-if="dialogVisible" class="map">
  317. <map-drag @marker="marker" :isShowaddress="true" v-on:addressListen="getAddress" :type="type">
  318. </map-drag>
  319. </div>
  320. <div style="text-align: right; padding: 10px" class="center">
  321. <el-button class="bg-bottom" type="primary" size="small" @click="submit(deptBudgetList)">提交</el-button>
  322. </div>
  323. </div>
  324. </template>
  325. <script>
  326. import {
  327. getwarehousename,
  328. packList,
  329. addList,
  330. xiala,
  331. addxiala,
  332. editxiala,
  333. delxiala,
  334. getstaff,
  335. } from '@/model/contarct/index'
  336. import {
  337. regionData,
  338. provinceAndCityDataPlus,
  339. CodeToText,
  340. TextToCode
  341. } from 'element-china-area-data'
  342. import {
  343. dayjs,
  344. fmoney,
  345. EventBus
  346. } from 'base-core-lib'
  347. import WsUpload from '@/components/WsUpload'
  348. import mapDrag from '@/components/mapdrag/mapdrag'
  349. export default {
  350. name: 'viewSpareMoney',
  351. components: {
  352. WsUpload,
  353. mapDrag
  354. },
  355. watch: {
  356. vesselId(val) {
  357. this.getVesselData()
  358. },
  359. isShow(val) {
  360. this.showType = val
  361. },
  362. },
  363. data() {
  364. return {
  365. restaurants1: [],
  366. restaurants2: [],
  367. restaurants3: [],
  368. restaurants4: [],
  369. type: '',
  370. dialogVisible: false,
  371. newSelectedOptions1: '请选择交货所在地区',
  372. newSelectedOptions: '请选择产地',
  373. //弹出框
  374. dialogViewSpareMoney: false,
  375. dialogApproveFormVisible: false,
  376. // 船舶类型
  377. monetaryKey: null,
  378. // 表格显示数据
  379. tableDate: [],
  380. // 是否显示
  381. showType: true,
  382. // 年
  383. year: '',
  384. options_: regionData,
  385. options1_: provinceAndCityDataPlus,
  386. selectedOptions: [],
  387. selectedOptions1: [],
  388. // 提交类型
  389. submitType: true,
  390. tableData: [{
  391. date: 1111,
  392. name: 'qqqq',
  393. address: 'errrtt'
  394. }],
  395. packtypeList: [],
  396. compId: sessionStorage.getItem('ws-pf_compId'),
  397. rules: {
  398. // contractNo: [
  399. // { required: true, message: '请输入合同编号', trigger: 'blur' },
  400. // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' },
  401. // ],
  402. },
  403. options: [],
  404. staffList: [],
  405. appendixIdsAdd: '',
  406. size: 10,
  407. unitList: [],
  408. goodnameList: [],
  409. value1: '袋装',
  410. value2: '未回收',
  411. gradeList: [],
  412. warehouseNameList: [],
  413. warehouseNameList1: [],
  414. ChapterTwoList: [],
  415. transgeneList: [],
  416. deptBudgetList: {
  417. deliverType: '1',
  418. finalTradingVolume: 0,
  419. contractGoodsInfo: {
  420. goodsName: '',
  421. },
  422. contractProcessInfo: {},
  423. sourceGoods: '',
  424. placeDelivery: '',
  425. },
  426. acceptanceCheck: {},
  427. pickerBeginDateBefore: {
  428. disabledDate: (time) => {
  429. return time.getTime() > Date.now()
  430. },
  431. },
  432. ruleDeptBudget: {
  433. contractNo: [{
  434. required: true,
  435. message: '请输入活动名称',
  436. trigger: 'blur'
  437. },
  438. {
  439. min: 6,
  440. max: 20,
  441. message: '长度在 6 到 20 个字符',
  442. trigger: 'blur',
  443. },
  444. ],
  445. },
  446. selectIntendedShip: {},
  447. interviewTypeList: {},
  448. }
  449. },
  450. activated() {
  451. //cg.viewBudget
  452. //cg.viewSpareMoney
  453. // this.getVesselData();
  454. this.selectedOptions = []
  455. this.selectedOptions1 = []
  456. this.newSelectedOptions = '请选择产地'
  457. this.newSelectedOptions1 = '请选择交货所在地区'
  458. this.deptBudgetList.packingMethod = '散装'
  459. this.deptBudgetList.packingMethodKey = 1
  460. this.deptBudgetList.contractGoodsInfo.goodsName = '玉米'
  461. this.deptBudgetList.contractGoodsInfo.goodsNameKey = 1
  462. this.deptBudgetList.contractProcessInfo.grade = '未回收'
  463. this.deptBudgetList.contractProcessInfo.gradeKey = 1
  464. this.deptBudgetList.contractGoodsInfo.grade = '一等品'
  465. this.deptBudgetList.contractGoodsInfo.gradeKey = 1
  466. getstaff({
  467. compId: sessionStorage.getItem('ws-pf_compId')
  468. })
  469. .toPromise()
  470. .then((response) => {
  471. this.options = response
  472. this.staffList = response
  473. })
  474. this.loaddata()
  475. this.showType = this.isShow
  476. },
  477. mounted() {
  478. this.restaurants1 = JSON.parse(localStorage.getItem('deptBudgetList_data1'));
  479. this.restaurants2 = JSON.parse(localStorage.getItem('deptBudgetList_data2'));
  480. this.restaurants3 = JSON.parse(localStorage.getItem('deptBudgetList_data3'));
  481. this.restaurants4 = JSON.parse(localStorage.getItem('deptBudgetList_data4'));
  482. if (!this.restaurants1) this.restaurants1 = [];
  483. if (!this.restaurants2) this.restaurants2 = [];
  484. if (!this.restaurants3) this.restaurants3 = [];
  485. if (!this.restaurants4) this.restaurants4 = [];
  486. },
  487. methods: {
  488. querySearch1(queryString, cb) {
  489. var restaurants1 = this.restaurants1;
  490. var results = queryString ? restaurants1.filter(this.createFilter(queryString)) : restaurants1;
  491. // 调用 callback 返回建议列表的数据
  492. cb(results);
  493. },
  494. querySearch2(queryString, cb) {
  495. var restaurants2 = this.restaurants2;
  496. var results = queryString ? restaurants2.filter(this.createFilter(queryString)) : restaurants2;
  497. // 调用 callback 返回建议列表的数据
  498. cb(results);
  499. },
  500. querySearch3(queryString, cb) {
  501. var restaurants3 = this.restaurants3;
  502. var results = queryString ? restaurants3.filter(this.createFilter(queryString)) : restaurants3;
  503. // 调用 callback 返回建议列表的数据
  504. cb(results);
  505. },
  506. querySearch4(queryString, cb) {
  507. var restaurants4 = this.restaurants4;
  508. var results = queryString ? restaurants4.filter(this.createFilter(queryString)) : restaurants4;
  509. // 调用 callback 返回建议列表的数据
  510. cb(results);
  511. },
  512. createFilter(queryString) {
  513. return (restaurant) => {
  514. return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
  515. };
  516. },
  517. handleSelect(item) {
  518. console.log(item);
  519. },
  520. marker: function(item) {
  521. this.deptBudgetList.warehousePositioning =
  522. item.lnglat.lat + ',' + item.lnglat.lng
  523. },
  524. getAddress(data) {
  525. console.log('getAddress', data)
  526. if (data[4] == 'source') {
  527. this.newSelectedOptions = data[0] + '/' + data[1] + '/' + data[2]
  528. this.deptBudgetList.contractGoodsInfo.outputPrivate = data[0]
  529. this.deptBudgetList.contractGoodsInfo.outputCity = data[1]
  530. this.deptBudgetList.contractGoodsInfo.outputArea = data[2]
  531. } else {
  532. this.newSelectedOptions1 = data[0] + '/' + data[1] + '/' + data[2]
  533. this.deptBudgetList.deliveryProvince = CodeToText[this.selectedOptions[0]]
  534. this.deptBudgetList.deliveryCity = data[1]
  535. this.deptBudgetList.deliveryArea = data[2]
  536. this.deptBudgetList.placeDelivery = data[3]
  537. }
  538. },
  539. mapInputClick(type) {
  540. this.dialogVisible = true
  541. this.type = type
  542. },
  543. blurMap() {
  544. this.dialogVisible = false
  545. },
  546. focusMap() {
  547. this.dialogVisible = true
  548. },
  549. dataFilter(val) {
  550. this.deptBudgetList.personCharge = val
  551. if (val) {
  552. //val存在
  553. this.options = this.staffList.filter((item) => {
  554. if (
  555. !!~item.staffName.indexOf(val) ||
  556. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  557. ) {
  558. return true
  559. }
  560. })
  561. } else {
  562. //val为空时,还原数组
  563. this.options = this.staffList
  564. }
  565. },
  566. selectstaff(e) {
  567. for (var i = 0; i < this.staffList.length; i++) {
  568. if (this.staffList[i].staffName == e) {
  569. this.deptBudgetList.personPhone = this.staffList[i].staffMobilePhone
  570. this.deptBudgetList.personChargeKey = this.staffList[i].staffId
  571. }
  572. }
  573. },
  574. // 关闭 dialog时 处理文件url 初始化upload组件
  575. handleClose() {
  576. this.dialogViewSpareMoney = false
  577. },
  578. handleChange(value) {
  579. this.selectedOptions = value
  580. this.dataList.deliveryProvince = CodeToText[value[0]]
  581. this.dataList.deliveryCity = CodeToText[value[1]]
  582. this.dataList.deliveryArea = CodeToText[value[2]]
  583. },
  584. handleChange1(value) {
  585. this.selectedOptions1 = value
  586. this.dataList.contractGoodsInfo.outputPrivate = CodeToText[value[0]]
  587. this.dataList.contractGoodsInfo.outputCity = CodeToText[value[1]]
  588. },
  589. weightchange(e) {
  590. this.deptBudgetList.finalTradingVolume = e
  591. },
  592. returnsales() {
  593. this.$router.push({
  594. path: 'futuresPurchaseContract'
  595. })
  596. },
  597. loaddata() {
  598. // 包装方式
  599. packList({
  600. constId: 'PRO2'
  601. })
  602. .toPromise()
  603. .then((response) => {
  604. this.packtypeList = response
  605. })
  606. // 验收方式
  607. this.getUnitList()
  608. // 货名
  609. packList({
  610. constId: 'CON2'
  611. })
  612. .toPromise()
  613. .then((response) => {
  614. this.goodnameList = response
  615. })
  616. // 品级
  617. packList({
  618. constId: 'CON3'
  619. })
  620. .toPromise()
  621. .then((response) => {
  622. this.gradeList = response
  623. })
  624. //转基因
  625. packList({
  626. constId: 'CON7'
  627. })
  628. .toPromise()
  629. .then((response) => {
  630. this.transgeneList = response
  631. })
  632. //收货库
  633. getwarehousename({
  634. compId: this.compId,
  635. warehouseType: 1,
  636. })
  637. .toPromise()
  638. .then((response) => {
  639. this.warehouseNameList = response
  640. })
  641. getwarehousename({
  642. compId: this.compId,
  643. warehouseType: 2,
  644. })
  645. .toPromise()
  646. .then((response) => {
  647. this.warehouseNameList1 = response
  648. })
  649. // 双章
  650. packList({
  651. constId: 'CON4'
  652. })
  653. .toPromise()
  654. .then((response) => {
  655. this.ChapterTwoList = response
  656. })
  657. },
  658. onChange() {
  659. this.$refs.upload
  660. .handleSaveBill()
  661. .then(async response => {
  662. this.deptBudgetList.addressUrl = response
  663. })
  664. .catch(res => {
  665. EventBus.$emit('error', (JSON.parse(res) || {}).message)
  666. this.$refs.upload.clearFiles()
  667. })
  668. },
  669. getUnitList() {
  670. xiala({
  671. compId: sessionStorage.getItem('ws-pf_compId'),
  672. constCode: 'TYPEYAN',
  673. })
  674. .toPromise()
  675. .then((response) => {
  676. this.unitList = response
  677. let currItem
  678. this.unitList.forEach((item, index, arr) => {
  679. item.flag = 'delete'
  680. if (this.vModel == item.constKey) {
  681. currItem = item
  682. }
  683. })
  684. //
  685. if (currItem) {
  686. this.selectContract(currItem.constValue)
  687. }
  688. })
  689. },
  690. submit() {
  691. if (!this.deptBudgetList.contractNo) {
  692. this.$message({
  693. message: '请输入合同编号',
  694. type: 'warning',
  695. })
  696. return
  697. }
  698. if (
  699. this.deptBudgetList.contractNo.length < 6 ||
  700. this.deptBudgetList.contractNo.length > 50
  701. ) {
  702. this.$message({
  703. message: '合同编号长度不符合要求,请输入6到50个字符之内!',
  704. type: 'warning',
  705. })
  706. return
  707. }
  708. if (!this.deptBudgetList.shippingType) {
  709. this.$message({
  710. message: '请输入运输方式!',
  711. type: 'warning',
  712. })
  713. return
  714. }
  715. if (
  716. this.deptBudgetList.shippingType.length < 1 ||
  717. this.deptBudgetList.shippingType.length > 20
  718. ) {
  719. this.$message({
  720. message: '运输方式长度不符合要求,请输入1到20个字符之内!',
  721. type: 'warning',
  722. })
  723. return
  724. }
  725. if (!this.deptBudgetList.buyer) {
  726. this.$message({
  727. message: '请输入买方名称!',
  728. type: 'warning',
  729. })
  730. return
  731. }
  732. if (this.deptBudgetList.buyer.length > 30) {
  733. this.$message({
  734. message: '买方名称长度不符合要求,请输入30个字符之内!',
  735. type: 'warning',
  736. })
  737. return
  738. }
  739. if (!this.deptBudgetList.settlementMethod) {
  740. this.$message({
  741. message: '请输入结算方式!',
  742. type: 'warning',
  743. })
  744. return
  745. }
  746. if (
  747. this.deptBudgetList.settlementMethod.length < 1 ||
  748. this.deptBudgetList.settlementMethod.length > 20
  749. ) {
  750. this.$message({
  751. message: '结算方式长度不符合要求,请输入1到20个字符之内!',
  752. type: 'warning',
  753. })
  754. return
  755. }
  756. if (!this.deptBudgetList.buyerPhone) {
  757. this.$message({
  758. message: '请输入买方电话!',
  759. type: 'warning',
  760. })
  761. return
  762. }
  763. if (isNaN(this.deptBudgetList.buyerPhone)) {
  764. this.$message({
  765. message: '输入买方电话有误!',
  766. type: 'warning',
  767. })
  768. return
  769. }
  770. if (
  771. this.deptBudgetList.buyerPhone.length < 7 ||
  772. this.deptBudgetList.buyerPhone.length > 20
  773. ) {
  774. this.$message({
  775. message: '买方电话长度不符合要求,请输入7到20个字符之内!',
  776. type: 'warning',
  777. })
  778. return
  779. }
  780. if (!this.deptBudgetList.seller) {
  781. this.$message({
  782. message: '请输入卖方名称!',
  783. type: 'warning',
  784. })
  785. return
  786. }
  787. if (this.deptBudgetList.seller.length > 30) {
  788. this.$message({
  789. message: '卖方名称长度不符合要求,请输入30个字符之内!',
  790. type: 'warning',
  791. })
  792. return
  793. }
  794. if (!this.deptBudgetList.sellerPhone) {
  795. this.$message({
  796. message: '请输入卖方电话!',
  797. type: 'warning',
  798. })
  799. return
  800. }
  801. if (isNaN(this.deptBudgetList.sellerPhone)) {
  802. this.$message({
  803. message: '输入卖方电话有误!',
  804. type: 'warning',
  805. })
  806. return
  807. }
  808. if (
  809. this.deptBudgetList.buyerPhone.length < 7 ||
  810. this.deptBudgetList.buyerPhone.length > 20
  811. ) {
  812. this.$message({
  813. message: '卖方电话长度不符合要求,请输入7到20个字符之内!',
  814. type: 'warning',
  815. })
  816. return
  817. }
  818. if (!this.deptBudgetList.acceptanceMethod) {
  819. this.$message({
  820. message: '请选择验收方式',
  821. type: 'warning',
  822. })
  823. return
  824. }
  825. if (!this.deptBudgetList.weight) {
  826. this.$message({
  827. message: '请输入交易数量!',
  828. type: 'warning',
  829. })
  830. return
  831. }
  832. if (
  833. isNaN(this.deptBudgetList.weight) ||
  834. (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
  835. String(this.deptBudgetList.weight).length -
  836. (String(this.deptBudgetList.weight).indexOf('.') + 1) >
  837. 3) ||
  838. this.deptBudgetList.weight < 0 ||
  839. this.deptBudgetList.weight > 200000
  840. ) {
  841. this.$message({
  842. message: '输入交易数量有误!',
  843. type: 'warning',
  844. })
  845. return
  846. }
  847. if (!this.deptBudgetList.warehousingFee) {
  848. this.$message({
  849. message: '请输入入库费!',
  850. type: 'warning',
  851. })
  852. return
  853. }
  854. if (
  855. isNaN(this.deptBudgetList.warehousingFee) ||
  856. (String(this.deptBudgetList.warehousingFee).indexOf('.') != -1 &&
  857. String(this.deptBudgetList.warehousingFee).length -
  858. (String(this.deptBudgetList.warehousingFee).indexOf('.') + 1) >
  859. 3) ||
  860. this.deptBudgetList.warehousingFee < 0 ||
  861. this.deptBudgetList.warehousingFee > 1000
  862. ) {
  863. this.$message({
  864. message: '入库费输入错误!',
  865. type: 'warning',
  866. })
  867. return
  868. }
  869. if (!this.deptBudgetList.measurementStandard) {
  870. this.$message({
  871. message: '请输入计量标准!',
  872. type: 'warning',
  873. })
  874. return
  875. }
  876. if (
  877. this.deptBudgetList.measurementStandard.length < 1 ||
  878. this.deptBudgetList.measurementStandard.length > 20
  879. ) {
  880. this.$message({
  881. message: '计量标准长度不符合要求,请输入1到20个字符之内!',
  882. type: 'warning',
  883. })
  884. return
  885. }
  886. if (!String(this.deptBudgetList.basisPrice)) {
  887. this.$message({
  888. message: '请输入基差!',
  889. type: 'warning',
  890. })
  891. return
  892. }
  893. if (
  894. isNaN(this.deptBudgetList.basisPrice) ||
  895. (String(this.deptBudgetList.basisPrice).indexOf('.') != -1 &&
  896. String(this.deptBudgetList.basisPrice).length -
  897. (String(this.deptBudgetList.basisPrice).indexOf('.') + 1) >
  898. 3) ||
  899. this.deptBudgetList.basisPrice < 0 ||
  900. this.deptBudgetList.basisPrice > 10000
  901. ) {
  902. this.$message({
  903. message: '基差输入错误!',
  904. type: 'warning',
  905. })
  906. return
  907. }
  908. if (!this.deptBudgetList.receiveWarehouse) {
  909. this.$message({
  910. message: '请选择收货库!',
  911. type: 'warning',
  912. })
  913. return
  914. }
  915. if (!this.deptBudgetList.transactionsPlace) {
  916. this.$message({
  917. message: '请输入交易所!',
  918. type: 'warning',
  919. })
  920. return
  921. }
  922. if (
  923. this.deptBudgetList.transactionsPlace.length < 2 ||
  924. this.deptBudgetList.transactionsPlace.length > 15
  925. ) {
  926. this.$message({
  927. message: '交易所长度不符合要求,请输入2到15个字符之内!',
  928. type: 'warning',
  929. })
  930. return
  931. }
  932. if (!this.newSelectedOptions1) {
  933. this.$message({
  934. message: '请选择交货所在地区!',
  935. type: 'warning',
  936. })
  937. return
  938. }
  939. if (!this.newSelectedOptions) {
  940. this.$message({
  941. message: '请选择产地!',
  942. type: 'warning',
  943. })
  944. return
  945. }
  946. if (!this.deptBudgetList.contractNumber) {
  947. this.$message({
  948. message: '请输入合约号!',
  949. type: 'warning',
  950. })
  951. return
  952. }
  953. if (
  954. this.deptBudgetList.contractNumber.length < 2 ||
  955. this.deptBudgetList.contractNumber.length > 15
  956. ) {
  957. this.$message({
  958. message: '合约号长度不符合要求,请输入2到15个字符之内!',
  959. type: 'warning',
  960. })
  961. return
  962. }
  963. if (!this.deptBudgetList.placeDelivery) {
  964. this.$message({
  965. message: '请输入交货详细地址!',
  966. type: 'warning',
  967. })
  968. return
  969. }
  970. if (!this.deptBudgetList.pointPrice) {
  971. this.$message({
  972. message: '请输入点价!',
  973. type: 'warning',
  974. })
  975. return
  976. }
  977. if (
  978. isNaN(this.deptBudgetList.pointPrice) ||
  979. (String(this.deptBudgetList.pointPrice).indexOf('.') != -1 &&
  980. String(this.deptBudgetList.pointPrice).length -
  981. (String(this.deptBudgetList.pointPrice).indexOf('.') + 1) >
  982. 3) ||
  983. this.deptBudgetList.pointPrice < 0 ||
  984. this.deptBudgetList.pointPrice > 100000
  985. ) {
  986. this.$message({
  987. message: '输入点价有误!',
  988. type: 'warning',
  989. })
  990. return
  991. }
  992. if (!this.deptBudgetList.signingDate) {
  993. this.$message({
  994. message: '请选择签订日期',
  995. type: 'warning',
  996. })
  997. return
  998. }
  999. if (!this.deptBudgetList.pointPriceDate) {
  1000. this.$message({
  1001. message: '请选择点价日期',
  1002. type: 'warning',
  1003. })
  1004. return
  1005. }
  1006. if (!this.deptBudgetList.deliveryDateStart) {
  1007. this.$message({
  1008. message: '请选择交货日期(起)',
  1009. type: 'warning',
  1010. })
  1011. return
  1012. }
  1013. if (!this.deptBudgetList.deliveryDateEnd) {
  1014. this.$message({
  1015. message: '请选择交货日期(止)',
  1016. type: 'warning',
  1017. })
  1018. return
  1019. }
  1020. //时间
  1021. if (
  1022. new Date(this.deptBudgetList.deliveryDateStart).getTime() >
  1023. new Date(this.deptBudgetList.deliveryDateEnd).getTime()
  1024. ) {
  1025. this.$message({
  1026. message: '交货日期(止)选择错误',
  1027. type: 'warning',
  1028. })
  1029. return
  1030. }
  1031. //货物信息
  1032. if (!this.deptBudgetList.contractGoodsInfo.goodsName) {
  1033. this.$message({
  1034. message: '请选择货名',
  1035. type: 'warning',
  1036. })
  1037. return
  1038. }
  1039. if (!this.deptBudgetList.contractGoodsInfo.waterContent) {
  1040. this.$message({
  1041. message: '请输入水分',
  1042. type: 'warning',
  1043. })
  1044. return
  1045. }
  1046. if (
  1047. this.deptBudgetList.contractGoodsInfo.waterContent &&
  1048. String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') != -1 &&
  1049. String(this.deptBudgetList.contractGoodsInfo.waterContent).length -
  1050. (String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') + 1) >
  1051. 2 || this.deptBudgetList.contractGoodsInfo.waterContent > 40 || this.deptBudgetList.contractGoodsInfo
  1052. .waterContent < 0
  1053. ) {
  1054. this.$message({
  1055. message: '水分输入错误',
  1056. type: 'warning',
  1057. })
  1058. return
  1059. }
  1060. if (!this.deptBudgetList.contractGoodsInfo.grade) {
  1061. this.$message({
  1062. message: '请选择品级',
  1063. type: 'warning',
  1064. })
  1065. return
  1066. }
  1067. if (!this.deptBudgetList.contractGoodsInfo.transgene) {
  1068. this.$message({
  1069. message: '请选择转基因',
  1070. type: 'warning',
  1071. })
  1072. return
  1073. }
  1074. if (!this.deptBudgetList.contractGoodsInfo.impurity) {
  1075. this.$message({
  1076. message: '请输入杂质',
  1077. type: 'warning',
  1078. })
  1079. return
  1080. }
  1081. if (
  1082. this.deptBudgetList.contractGoodsInfo.impurity &&
  1083. String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') != -1 &&
  1084. String(this.deptBudgetList.contractGoodsInfo.impurity).length -
  1085. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') + 1) >
  1086. 2 || this.deptBudgetList.contractGoodsInfo.impurity > 40 || this.deptBudgetList.contractGoodsInfo.impurity < 0
  1087. ) {
  1088. this.$message({
  1089. message: '杂质输入错误',
  1090. type: 'warning',
  1091. })
  1092. return
  1093. }
  1094. if (!this.deptBudgetList.contractGoodsInfo.bulkDensity) {
  1095. this.$message({
  1096. message: '请输入容重',
  1097. type: 'warning',
  1098. })
  1099. return
  1100. }
  1101. if (
  1102. (this.deptBudgetList.contractGoodsInfo.bulkDensity &&
  1103. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') != -1 &&
  1104. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
  1105. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') + 1) >
  1106. 2) || this.deptBudgetList.contractGoodsInfo.bulkDensity > 1000 || this.deptBudgetList.contractGoodsInfo
  1107. .bulkDensity < 0
  1108. ) {
  1109. this.$message({
  1110. message: '容重输入错误',
  1111. type: 'warning',
  1112. })
  1113. return
  1114. }
  1115. if (!this.deptBudgetList.contractGoodsInfo.mildewGrain) {
  1116. this.$message({
  1117. message: '请输入霉变粒',
  1118. type: 'warning',
  1119. })
  1120. return
  1121. }
  1122. if (
  1123. !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
  1124. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1125. '.'
  1126. ) != -1 &&
  1127. String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
  1128. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1129. '.'
  1130. ) +
  1131. 1) >
  1132. 2 || this.deptBudgetList.contractGoodsInfo.mildewGrain > 40 || this.deptBudgetList.contractGoodsInfo
  1133. .mildewGrain < 0)
  1134. ) {
  1135. this.$message({
  1136. message: '霉变粒输入错误',
  1137. type: 'warning',
  1138. })
  1139. return
  1140. }
  1141. if (!this.deptBudgetList.contractGoodsInfo.jiaorenli) {
  1142. this.$message({
  1143. message: '请输入热损伤',
  1144. type: 'warning',
  1145. })
  1146. return
  1147. }
  1148. if (
  1149. !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
  1150. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
  1151. -1 &&
  1152. String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
  1153. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
  1154. '.'
  1155. ) +
  1156. 1) >
  1157. 2 || this.deptBudgetList.contractGoodsInfo.jiaorenli > 40 || this.deptBudgetList.contractGoodsInfo
  1158. .jiaorenli < 0)
  1159. ) {
  1160. this.$message({
  1161. message: '热损伤输入错误',
  1162. type: 'warning',
  1163. })
  1164. return
  1165. }
  1166. if (!this.deptBudgetList.contractGoodsInfo.imperfectGrain) {
  1167. this.$message({
  1168. message: '请输入不完善粒',
  1169. type: 'warning',
  1170. })
  1171. return
  1172. }
  1173. if (
  1174. !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
  1175. (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
  1176. '.'
  1177. ) != -1 &&
  1178. String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
  1179. (String(
  1180. this.deptBudgetList.contractGoodsInfo.imperfectGrain
  1181. ).indexOf('.') +
  1182. 1) >
  1183. 2 || this.deptBudgetList.contractGoodsInfo.imperfectGrain > 40 || this.deptBudgetList.contractGoodsInfo
  1184. .imperfectGrain < 0)
  1185. ) {
  1186. this.$message({
  1187. message: '不完善粒输入错误',
  1188. type: 'warning',
  1189. })
  1190. return
  1191. }
  1192. if (!this.deptBudgetList.contractGoodsInfo.protein) {
  1193. this.$message({
  1194. message: '请输入蛋白',
  1195. type: 'warning',
  1196. })
  1197. return
  1198. }
  1199. if (
  1200. !this.deptBudgetList.contractGoodsInfo.protein ||
  1201. (String(this.deptBudgetList.contractGoodsInfo.protein).indexOf(
  1202. '.'
  1203. ) != -1 &&
  1204. String(this.deptBudgetList.contractGoodsInfo.protein).length -
  1205. (String(
  1206. this.deptBudgetList.contractGoodsInfo.protein
  1207. ).indexOf('.') +
  1208. 1) >
  1209. 2 || this.deptBudgetList.contractGoodsInfo.protein > 70 || this.deptBudgetList.contractGoodsInfo.protein < 0
  1210. )
  1211. ) {
  1212. this.$message({
  1213. message: '蛋白输入错误',
  1214. type: 'warning',
  1215. })
  1216. return
  1217. }
  1218. if (
  1219. this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000 ||
  1220. this.deptBudgetList.contractProcessInfo.goodsNameKey < 0 ||
  1221. (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
  1222. '.'
  1223. ) != -1 &&
  1224. String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
  1225. (String(
  1226. this.deptBudgetList.contractProcessInfo.goodsNameKey
  1227. ).indexOf('.') +
  1228. 1) >
  1229. 2)
  1230. ) {
  1231. this.$message({
  1232. message: '已付款金额输入错误',
  1233. type: 'warning',
  1234. })
  1235. return
  1236. }
  1237. if (
  1238. this.deptBudgetList.contractProcessInfo.waterContent > 10000000 ||
  1239. this.deptBudgetList.contractProcessInfo.waterContent < 0 ||
  1240. (String(this.deptBudgetList.contractProcessInfo.waterContent).indexOf(
  1241. '.'
  1242. ) != -1 &&
  1243. String(this.deptBudgetList.contractProcessInfo.waterContent).length -
  1244. (String(
  1245. this.deptBudgetList.contractProcessInfo.waterContent
  1246. ).indexOf('.') +
  1247. 1) >
  1248. 2)
  1249. ) {
  1250. this.$message({
  1251. message: '费用支出金额输入错误',
  1252. type: 'warning',
  1253. })
  1254. return
  1255. }
  1256. if (
  1257. this.deptBudgetList.contractProcessInfo.goodsName > 1000000000 ||
  1258. this.deptBudgetList.contractProcessInfo.goodsName < 0 ||
  1259. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1260. '.'
  1261. ) != -1 &&
  1262. String(this.deptBudgetList.contractProcessInfo.goodsName).length -
  1263. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1264. '.'
  1265. ) +
  1266. 1) >
  1267. 2)
  1268. ) {
  1269. this.$message({
  1270. message: '已开发票金额输入错误',
  1271. type: 'warning',
  1272. })
  1273. return
  1274. }
  1275. if (
  1276. this.deptBudgetList.contractProcessInfo.impurity > 1000000000 ||
  1277. this.deptBudgetList.contractProcessInfo.impurity < 0 ||
  1278. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1279. '.'
  1280. ) != -1 &&
  1281. String(this.deptBudgetList.contractProcessInfo.impurity).length -
  1282. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1283. '.'
  1284. ) +
  1285. 1) >
  1286. 2)
  1287. ) {
  1288. this.$message({
  1289. message: '未开发票金额输入错误',
  1290. type: 'warning',
  1291. })
  1292. return
  1293. }
  1294. if (
  1295. (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) ||
  1296. (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
  1297. (String(this.deptBudgetList.contractProcessInfo.mildewGrain).indexOf(
  1298. '.'
  1299. ) != -1 &&
  1300. String(this.deptBudgetList.contractProcessInfo.mildewGrain).length -
  1301. (String(
  1302. this.deptBudgetList.contractProcessInfo.mildewGrain
  1303. ).indexOf('.') +
  1304. 1) >
  1305. 2)
  1306. ) {
  1307. this.$message({
  1308. message: '未回款金额输入错误',
  1309. type: 'warning',
  1310. })
  1311. return
  1312. }
  1313. var that = this
  1314. this.$refs.deptBudgetList.validate((valid) => {
  1315. if (valid) {
  1316. this.deptBudgetList.compId = this.compId
  1317. this.deptBudgetList.contractType = 2
  1318. this.deptBudgetList.goodsType = 2
  1319. addList(this.deptBudgetList)
  1320. .toPromise()
  1321. .then((response) => {
  1322. // 存储买方、卖方、买方电话、卖方电话
  1323. let _data = {
  1324. byer: this.deptBudgetList.buyer,
  1325. seller: this.deptBudgetList.seller,
  1326. buyerPhone: this.deptBudgetList.buyerPhone,
  1327. sellerPhone: this.deptBudgetList.sellerPhone
  1328. }
  1329. if (this.restaurants1.length <= 20) {
  1330. this.restaurants1 = this.restaurants1.filter(function(val) {
  1331. if (val.value != _data.byer) {
  1332. return val
  1333. }
  1334. })
  1335. this.restaurants1.unshift({
  1336. value: _data.byer
  1337. })
  1338. } else {
  1339. this.restaurants1.unshift({
  1340. value: _data.byer
  1341. }).pop({
  1342. value: _data.byer
  1343. })
  1344. }
  1345. localStorage.setItem('deptBudgetList_data1', JSON.stringify(this.restaurants1));
  1346. if (this.restaurants2.length <= 20) {
  1347. this.restaurants2 = this.restaurants2.filter(function(val) {
  1348. if (val.value != _data.seller) {
  1349. return val
  1350. }
  1351. })
  1352. this.restaurants2.unshift({
  1353. value: _data.seller
  1354. })
  1355. } else {
  1356. this.restaurants2.unshift({
  1357. value: _data.seller
  1358. }).pop({
  1359. value: _data.seller
  1360. })
  1361. }
  1362. localStorage.setItem('deptBudgetList_data2', JSON.stringify(this.restaurants2));
  1363. if (this.restaurants2.length <= 20) {
  1364. this.restaurants3 = this.restaurants3.filter(function(val) {
  1365. if (val.value != _data.buyerPhone) {
  1366. return val
  1367. }
  1368. })
  1369. this.restaurants3.unshift({
  1370. value: _data.buyerPhone
  1371. })
  1372. } else {
  1373. this.restaurants3.unshift({
  1374. value: _data.buyerPhone
  1375. }).pop({
  1376. value: _data.buyerPhone
  1377. })
  1378. }
  1379. localStorage.setItem('deptBudgetList_data3', JSON.stringify(this.restaurants3));
  1380. if (this.restaurants4.length <= 20) {
  1381. this.restaurants4 = this.restaurants3.filter(function(val) {
  1382. if (val.value != _data.sellerPhone) {
  1383. return val
  1384. }
  1385. })
  1386. this.restaurants4.unshift({
  1387. value: _data.sellerPhone
  1388. })
  1389. } else {
  1390. this.restaurants4.unshift({
  1391. value: _data.sellerPhone
  1392. }).pop({
  1393. value: _data.sellerPhone
  1394. })
  1395. }
  1396. localStorage.setItem('deptBudgetList_data4', JSON.stringify(this.restaurants4));
  1397. this.$message.success('添加成功')
  1398. this.selectedOptions = []
  1399. this.deptBudgetList = {
  1400. deliverType: '1',
  1401. finalTradingVolume: 0,
  1402. contractGoodsInfo: {
  1403. goodsName: '',
  1404. },
  1405. contractProcessInfo: {},
  1406. }
  1407. this.$router.push({
  1408. path: 'futuresPurchaseContract'
  1409. })
  1410. })
  1411. } else {
  1412. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1413. return false
  1414. }
  1415. })
  1416. },
  1417. resetForm(deptBudgetList) {
  1418. this.$refs[deptBudgetList].resetFields()
  1419. },
  1420. addClick() {
  1421. this.unitList.push({
  1422. flag: 'add',
  1423. constValue: '',
  1424. constKey: '',
  1425. })
  1426. },
  1427. saveClick(item, index) {
  1428. if (Object.is(item.id, 1)) {
  1429. return
  1430. }
  1431. if (Object.is(this.unitList[index].flag, 'delete')) {
  1432. this.$set(this.unitList, index, {
  1433. flag: 'check'
  1434. })
  1435. } else {
  1436. this.$set(this.unitList, index, {
  1437. flag: 'delete'
  1438. })
  1439. }
  1440. if (!item.constValue) {
  1441. this.unitList.splice(index, 1)
  1442. return
  1443. }
  1444. if (item.flag == 'add') {
  1445. item.constKey = Math.random() * 20
  1446. this.acceptanceCheck.compId = this.compId
  1447. this.acceptanceCheck.constKey = item.constKey
  1448. this.acceptanceCheck.constCode = 'TYPEYAN'
  1449. this.acceptanceCheck.constValue = item.constValue
  1450. this.acceptanceCheck.id = item.id
  1451. addxiala(this.acceptanceCheck)
  1452. .toPromise()
  1453. .then((response) => {
  1454. this.getUnitList()
  1455. })
  1456. } else if (item.flag == 'check') {
  1457. this.acceptanceCheck.compId = this.compId
  1458. this.acceptanceCheck.constKey = item.constKey
  1459. this.acceptanceCheck.constCode = 'TYPEYAN'
  1460. this.acceptanceCheck.constValue = item.constValue
  1461. this.acceptanceCheck.id = item.id
  1462. editxiala(this.acceptanceCheck)
  1463. .toPromise()
  1464. .then((response) => {
  1465. this.getUnitList()
  1466. })
  1467. }
  1468. },
  1469. selectChapterTwo(e) {
  1470. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  1471. if (this.ChapterTwoList[i].constValue == e) {
  1472. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  1473. }
  1474. }
  1475. },
  1476. selectunitList(e) {
  1477. for (var i = 0; i < this.unitList.length; i++) {
  1478. if (this.unitList[i].constValue == e) {
  1479. this.deptBudgetList.acceptanceMethodKey = this.unitList[i].constKey
  1480. }
  1481. }
  1482. },
  1483. selectgrade(e) {
  1484. for (var i = 0; i < this.gradeList.length; i++) {
  1485. if (this.gradeList[i].constValue == e) {
  1486. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  1487. }
  1488. }
  1489. },
  1490. selecttransgene(e) {
  1491. for (var i = 0; i < this.transgeneList.length; i++) {
  1492. if (this.transgeneList[i].constValue == e) {
  1493. this.deptBudgetList.gradeKey = this.transgeneList[i].constKey
  1494. }
  1495. }
  1496. },
  1497. selectgoodsName(e) {
  1498. for (var i = 0; i < this.goodnameList.length; i++) {
  1499. if (this.goodnameList[i].constValue == e) {
  1500. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  1501. this.deptBudgetList.contractGoodsInfo.goodsNameKey = this.goodnameList[i].constKey
  1502. }
  1503. }
  1504. },
  1505. selectwarehouseName() {},
  1506. selectpackingMethod(e) {
  1507. for (var i = 0; i < this.packtypeList.length; i++) {
  1508. if (this.packtypeList[i].constValue == e) {
  1509. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  1510. }
  1511. }
  1512. },
  1513. // 编辑
  1514. editClick(item, index) {
  1515. const map = JSON.parse(JSON.stringify(item))
  1516. if (Object.is(item.id, 1)) {
  1517. return
  1518. }
  1519. if (Object.is(this.unitList[index].flag, 'delete')) {
  1520. map.flag = 'check'
  1521. this.$set(this.unitList, index, map)
  1522. } else {
  1523. map.flag = 'delete'
  1524. this.$set(this.unitList, index, map)
  1525. }
  1526. },
  1527. // 删除
  1528. deleteClick(item, index) {
  1529. if (Object.is(item.constKey, 1)) {
  1530. return
  1531. }
  1532. if (!item.constValue) {
  1533. this.unitList.splice(index, 1)
  1534. return
  1535. }
  1536. delxiala({
  1537. id: this.unitList[index].id
  1538. })
  1539. .toPromise()
  1540. .then((response) => {
  1541. this.getUnitList()
  1542. this.pleaseChoose = ''
  1543. })
  1544. },
  1545. },
  1546. }
  1547. </script>
  1548. <style lang="scss" scoped>
  1549. .el-form {
  1550. padding: 0 15%;
  1551. }
  1552. /deep/.ws-info-table .el-form-item {
  1553. border-right: 1px solid #cdd2dc;
  1554. border-bottom: 1px solid #cdd2dc;
  1555. }
  1556. .readonly {
  1557. position: relative;
  1558. }
  1559. .readonly:after {
  1560. content: '*';
  1561. color: #ff2727;
  1562. position: absolute;
  1563. right: 8px;
  1564. z-index: 10;
  1565. top: 21%;
  1566. font-size: 20px;
  1567. }
  1568. .upload-demo {
  1569. margin-top: 10px;
  1570. }
  1571. .title {
  1572. position: relative;
  1573. }
  1574. .title::before {
  1575. content: '';
  1576. display: inline-block;
  1577. width: 5px;
  1578. height: 30px;
  1579. background: #5473e8;
  1580. position: absolute;
  1581. left: 0;
  1582. }
  1583. .el-button--primary {
  1584. background-color: #5878e8;
  1585. border-color: #5878e8;
  1586. }
  1587. .el-col {
  1588. background: #f6f7fc;
  1589. }
  1590. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1591. padding: 0 25px;
  1592. border-left: 1px solid #cdd2dc;
  1593. background: #fafbfc;
  1594. }
  1595. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1596. width: 140px;
  1597. text-align: center;
  1598. background: #f0f2f6;
  1599. // border: 1px solid #cdd2dc;
  1600. }
  1601. .button-container {
  1602. display: flex;
  1603. flex-wrap: nowrap;
  1604. justify-content: space-between;
  1605. align-items: center;
  1606. background-color: #fff;
  1607. width: 100%;
  1608. height: 50px;
  1609. padding: 0 10px;
  1610. &>div {
  1611. margin-left: 10px;
  1612. display: flex;
  1613. flex-wrap: nowrap;
  1614. flex-direction: row;
  1615. &>span {
  1616. line-height: 50px;
  1617. }
  1618. }
  1619. /deep/.auditFlow-box {
  1620. position: unset;
  1621. margin-left: 10px;
  1622. &/deep/.auditFlow-icon {
  1623. width: auto;
  1624. padding-right: 30px;
  1625. }
  1626. &/deep/.auditFlow-main {
  1627. position: absolute;
  1628. }
  1629. }
  1630. }
  1631. .box-app {
  1632. display: inline-block;
  1633. float: left;
  1634. margin-left: 30px;
  1635. line-height: 50px;
  1636. }
  1637. /deep/.el-dialog {
  1638. .el-form-item {
  1639. margin-bottom: 0 !important;
  1640. .el-input--medium {
  1641. textarea {
  1642. min-height: 100px !important;
  1643. }
  1644. }
  1645. }
  1646. }
  1647. .collapse-bottom {
  1648. margin-bottom: 20px;
  1649. }
  1650. .input-main .textarea .el-textarea__inner {
  1651. width: 100%;
  1652. z-index: 1;
  1653. }
  1654. .bg-left {
  1655. padding-left: 30px;
  1656. }
  1657. .bg-right {
  1658. padding-right: 10px;
  1659. text-align: right;
  1660. }
  1661. .bg-bottom {
  1662. margin: 15px 0px;
  1663. }
  1664. .wenzi h3 {
  1665. display: inline-block;
  1666. left: 10px;
  1667. }
  1668. .wenzi p {
  1669. display: inline-block;
  1670. }
  1671. .center {
  1672. width: 70%;
  1673. margin: 0 auto;
  1674. }
  1675. .el-form-item {
  1676. width: 50%;
  1677. }
  1678. .el-form-item__label {
  1679. text-align: center;
  1680. }
  1681. .ce {
  1682. width: 900px;
  1683. margin: 0 auto;
  1684. }
  1685. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  1686. /* height: 82px;*/
  1687. /*}*/
  1688. // 控制select为只读的时候显示样式
  1689. .hide-sel {
  1690. .el-input__inner {
  1691. border: 0px;
  1692. }
  1693. .el-icon-arrow-up {
  1694. display: none;
  1695. }
  1696. .el-textarea__inner {
  1697. background-color: #fff !important;
  1698. border: 0;
  1699. }
  1700. .el-date-editor {
  1701. i {
  1702. display: none;
  1703. }
  1704. }
  1705. .is-disabled {
  1706. .el-input__inner:hover {
  1707. background-color: #fff !important;
  1708. border: 0;
  1709. }
  1710. color: #606266;
  1711. .el-input__inner {
  1712. background-color: #fff !important;
  1713. border: 0;
  1714. color: #606266;
  1715. }
  1716. .el-textarea__inner {
  1717. background-color: #fff !important;
  1718. border: 0;
  1719. color: #606266;
  1720. }
  1721. }
  1722. }
  1723. // 控制select为只读的时候显示样式
  1724. /deep/.ws-class-table-col {
  1725. height: auto;
  1726. padding: 0px 2px;
  1727. /deep/.el-input__inner {
  1728. padding: 0px 2px;
  1729. }
  1730. }
  1731. /deep/.is-disabled {
  1732. .el-input__prefix,
  1733. .el-input__suffix {
  1734. display: none;
  1735. }
  1736. .el-input__inner {
  1737. background-color: #fff;
  1738. border-color: #fff !important;
  1739. color: #000 !important;
  1740. font-size: 14px;
  1741. cursor: text;
  1742. padding: 0 !important;
  1743. }
  1744. }
  1745. .winseaview-view {
  1746. padding: 0 0 20px;
  1747. }
  1748. .container {
  1749. overflow: scroll;
  1750. height: 93vh;
  1751. }
  1752. /deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
  1753. width: 130px;
  1754. }
  1755. .el-textarea {
  1756. width: 101%;
  1757. }
  1758. .addressUrls {
  1759. width: 100%;
  1760. display: flex;
  1761. margin-top: 10px;
  1762. }
  1763. .addressUrls-item {
  1764. position: relative;
  1765. display: flex;
  1766. }
  1767. .icon-guanbi {
  1768. position: absolute;
  1769. right: 8px;
  1770. }
  1771. .addressUrl {
  1772. margin: 0px 10px;
  1773. border-radius: 3px;
  1774. }
  1775. //上传文件成功标识
  1776. /deep/.el-upload-list__item-status-label {
  1777. position: absolute;
  1778. right: 22px;
  1779. top: -1px;
  1780. line-height: inherit;
  1781. display: none;
  1782. }
  1783. .map {
  1784. position: fixed;
  1785. top: 0;
  1786. bottom: 0;
  1787. left: 0;
  1788. right: 0;
  1789. margin: auto;
  1790. width: 850px;
  1791. height: 400px;
  1792. background: gainsboro;
  1793. border-radius: 20px;
  1794. padding: 10px;
  1795. box-sizing: border-box;
  1796. z-index: 99;
  1797. }
  1798. .amap-container {
  1799. width: 100% !important;
  1800. }
  1801. .address-btn {
  1802. width: 100%;
  1803. text-align: left;
  1804. }
  1805. .inline-input {
  1806. width: 100%;
  1807. }
  1808. .typeselect{
  1809. width: 100%;
  1810. }
  1811. </style>