futuresSalesContractAdd.vue 60 KB

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