futuresPurchaseContractAdd.vue 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887
  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 clearable
  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" filterable clearable>
  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: localStorage.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: localStorage.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. this.deptBudgetList.sourceLocation=data[5].lat+','+data[5].lng
  532. } else {
  533. this.newSelectedOptions1 = data[0] + '/' + data[1] + '/' + data[2]
  534. this.deptBudgetList.deliveryProvince = CodeToText[this.selectedOptions[0]]
  535. this.deptBudgetList.deliveryCity = data[1]
  536. this.deptBudgetList.deliveryArea = data[2]
  537. this.deptBudgetList.placeDelivery = data[3]
  538. this.deptBudgetList.deliveryLocation=data[5].lat+','+data[5].lng
  539. }
  540. },
  541. mapInputClick(type) {
  542. this.dialogVisible = true
  543. this.type = type
  544. },
  545. blurMap() {
  546. this.dialogVisible = false
  547. },
  548. focusMap() {
  549. this.dialogVisible = true
  550. },
  551. dataFilter(val) {
  552. this.deptBudgetList.personCharge = val
  553. if (val) {
  554. //val存在
  555. this.options = this.staffList.filter((item) => {
  556. if (
  557. !!~item.staffName.indexOf(val) ||
  558. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  559. ) {
  560. return true
  561. }
  562. })
  563. } else {
  564. //val为空时,还原数组
  565. this.options = this.staffList
  566. }
  567. },
  568. selectstaff(e) {
  569. for (var i = 0; i < this.staffList.length; i++) {
  570. if (this.staffList[i].staffName == e) {
  571. this.deptBudgetList.personPhone = this.staffList[i].staffMobilePhone
  572. this.deptBudgetList.personChargeKey = this.staffList[i].staffId
  573. }
  574. }
  575. },
  576. // 关闭 dialog时 处理文件url 初始化upload组件
  577. handleClose() {
  578. this.dialogViewSpareMoney = false
  579. },
  580. handleChange(value) {
  581. this.selectedOptions = value
  582. this.dataList.deliveryProvince = CodeToText[value[0]]
  583. this.dataList.deliveryCity = CodeToText[value[1]]
  584. this.dataList.deliveryArea = CodeToText[value[2]]
  585. },
  586. handleChange1(value) {
  587. this.selectedOptions1 = value
  588. this.dataList.contractGoodsInfo.outputPrivate = CodeToText[value[0]]
  589. this.dataList.contractGoodsInfo.outputCity = CodeToText[value[1]]
  590. },
  591. weightchange(e) {
  592. this.deptBudgetList.finalTradingVolume = e
  593. },
  594. returnsales() {
  595. this.$router.push({
  596. path: 'futuresPurchaseContract'
  597. })
  598. },
  599. loaddata() {
  600. // 包装方式
  601. packList({
  602. constId: 'PRO2'
  603. })
  604. .toPromise()
  605. .then((response) => {
  606. this.packtypeList = response
  607. })
  608. // 验收方式
  609. this.getUnitList()
  610. // 货名
  611. packList({
  612. constId: 'CON2'
  613. })
  614. .toPromise()
  615. .then((response) => {
  616. this.goodnameList = response
  617. })
  618. // 品级
  619. packList({
  620. constId: 'CON3'
  621. })
  622. .toPromise()
  623. .then((response) => {
  624. this.gradeList = response
  625. })
  626. //转基因
  627. packList({
  628. constId: 'CON7'
  629. })
  630. .toPromise()
  631. .then((response) => {
  632. this.transgeneList = response
  633. })
  634. //收货库
  635. getwarehousename({
  636. compId: this.compId,
  637. warehouseType: 1,
  638. })
  639. .toPromise()
  640. .then((response) => {
  641. this.warehouseNameList = response
  642. })
  643. getwarehousename({
  644. compId: this.compId,
  645. warehouseType: 2,
  646. })
  647. .toPromise()
  648. .then((response) => {
  649. this.warehouseNameList1 = response
  650. })
  651. // 双章
  652. packList({
  653. constId: 'CON4'
  654. })
  655. .toPromise()
  656. .then((response) => {
  657. this.ChapterTwoList = response
  658. })
  659. },
  660. onChange() {
  661. this.$refs.upload
  662. .handleSaveBill()
  663. .then(async response => {
  664. this.deptBudgetList.addressUrl = response
  665. })
  666. .catch(res => {
  667. EventBus.$emit('error', (JSON.parse(res) || {}).message)
  668. this.$refs.upload.clearFiles()
  669. })
  670. },
  671. getUnitList() {
  672. xiala({
  673. compId: localStorage.getItem('ws-pf_compId'),
  674. constCode: 'TYPEYAN',
  675. })
  676. .toPromise()
  677. .then((response) => {
  678. this.unitList = response
  679. let currItem
  680. this.unitList.forEach((item, index, arr) => {
  681. item.flag = 'delete'
  682. if (this.vModel == item.constKey) {
  683. currItem = item
  684. }
  685. })
  686. //
  687. if (currItem) {
  688. this.selectContract(currItem.constValue)
  689. }
  690. })
  691. },
  692. submit() {
  693. if(this.deptBudgetList.placeDelivery.indexOf('省')>-1){
  694. this.$message({
  695. message: '请手动删除详细地址中省市区/市,避免重复显示省市区/市!',
  696. type: 'warning',
  697. })
  698. return
  699. }
  700. if (!this.deptBudgetList.contractNo) {
  701. this.$message({
  702. message: '请输入合同编号',
  703. type: 'warning',
  704. })
  705. return
  706. }
  707. if (
  708. this.deptBudgetList.contractNo.length < 6 ||
  709. this.deptBudgetList.contractNo.length > 50
  710. ) {
  711. this.$message({
  712. message: '合同编号长度不符合要求,请输入6到50个字符之内!',
  713. type: 'warning',
  714. })
  715. return
  716. }
  717. if (!this.deptBudgetList.shippingType) {
  718. this.$message({
  719. message: '请输入运输方式!',
  720. type: 'warning',
  721. })
  722. return
  723. }
  724. if (
  725. this.deptBudgetList.shippingType.length < 1 ||
  726. this.deptBudgetList.shippingType.length > 20
  727. ) {
  728. this.$message({
  729. message: '运输方式长度不符合要求,请输入1到20个字符之内!',
  730. type: 'warning',
  731. })
  732. return
  733. }
  734. if (!this.deptBudgetList.buyer) {
  735. this.$message({
  736. message: '请输入买方名称!',
  737. type: 'warning',
  738. })
  739. return
  740. }
  741. if (this.deptBudgetList.buyer.length > 30) {
  742. this.$message({
  743. message: '买方名称长度不符合要求,请输入30个字符之内!',
  744. type: 'warning',
  745. })
  746. return
  747. }
  748. if (!this.deptBudgetList.settlementMethod) {
  749. this.$message({
  750. message: '请输入结算方式!',
  751. type: 'warning',
  752. })
  753. return
  754. }
  755. if (
  756. this.deptBudgetList.settlementMethod.length < 1 ||
  757. this.deptBudgetList.settlementMethod.length > 20
  758. ) {
  759. this.$message({
  760. message: '结算方式长度不符合要求,请输入1到20个字符之内!',
  761. type: 'warning',
  762. })
  763. return
  764. }
  765. if (!this.deptBudgetList.buyerPhone) {
  766. this.$message({
  767. message: '请输入买方电话!',
  768. type: 'warning',
  769. })
  770. return
  771. }
  772. if (isNaN(this.deptBudgetList.buyerPhone)) {
  773. this.$message({
  774. message: '输入买方电话有误!',
  775. type: 'warning',
  776. })
  777. return
  778. }
  779. if (!this.deptBudgetList.seller) {
  780. this.$message({
  781. message: '请输入卖方名称!',
  782. type: 'warning',
  783. })
  784. return
  785. }
  786. if (this.deptBudgetList.seller.length > 30) {
  787. this.$message({
  788. message: '卖方名称长度不符合要求,请输入30个字符之内!',
  789. type: 'warning',
  790. })
  791. return
  792. }
  793. if (!this.deptBudgetList.sellerPhone) {
  794. this.$message({
  795. message: '请输入卖方电话!',
  796. type: 'warning',
  797. })
  798. return
  799. }
  800. // if (isNaN(this.deptBudgetList.sellerPhone)) {
  801. // this.$message({
  802. // message: '输入卖方电话有误!',
  803. // type: 'warning',
  804. // })
  805. // return
  806. // }
  807. if (!this.deptBudgetList.acceptanceMethod) {
  808. this.$message({
  809. message: '请选择验收方式',
  810. type: 'warning',
  811. })
  812. return
  813. }
  814. if (!this.deptBudgetList.weight) {
  815. this.$message({
  816. message: '请输入交易数量!',
  817. type: 'warning',
  818. })
  819. return
  820. }
  821. if (
  822. isNaN(this.deptBudgetList.weight) ||
  823. (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
  824. String(this.deptBudgetList.weight).length -
  825. (String(this.deptBudgetList.weight).indexOf('.') + 1) >
  826. 3) ||
  827. this.deptBudgetList.weight < 0 ||
  828. this.deptBudgetList.weight > 200000
  829. ) {
  830. this.$message({
  831. message: '输入交易数量有误!',
  832. type: 'warning',
  833. })
  834. return
  835. }
  836. if (!this.deptBudgetList.warehousingFee) {
  837. this.$message({
  838. message: '请输入入库费!',
  839. type: 'warning',
  840. })
  841. return
  842. }
  843. if (
  844. isNaN(this.deptBudgetList.warehousingFee) ||
  845. (String(this.deptBudgetList.warehousingFee).indexOf('.') != -1 &&
  846. String(this.deptBudgetList.warehousingFee).length -
  847. (String(this.deptBudgetList.warehousingFee).indexOf('.') + 1) >
  848. 3) ||
  849. this.deptBudgetList.warehousingFee < 0 ||
  850. this.deptBudgetList.warehousingFee > 1000
  851. ) {
  852. this.$message({
  853. message: '入库费输入错误!',
  854. type: 'warning',
  855. })
  856. return
  857. }
  858. if (!this.deptBudgetList.measurementStandard) {
  859. this.$message({
  860. message: '请输入计量标准!',
  861. type: 'warning',
  862. })
  863. return
  864. }
  865. if (
  866. this.deptBudgetList.measurementStandard.length < 1 ||
  867. this.deptBudgetList.measurementStandard.length > 20
  868. ) {
  869. this.$message({
  870. message: '计量标准长度不符合要求,请输入1到20个字符之内!',
  871. type: 'warning',
  872. })
  873. return
  874. }
  875. if (!String(this.deptBudgetList.basisPrice)) {
  876. this.$message({
  877. message: '请输入基差!',
  878. type: 'warning',
  879. })
  880. return
  881. }
  882. if (
  883. isNaN(this.deptBudgetList.basisPrice) ||
  884. (String(this.deptBudgetList.basisPrice).indexOf('.') != -1 &&
  885. String(this.deptBudgetList.basisPrice).length -
  886. (String(this.deptBudgetList.basisPrice).indexOf('.') + 1) >
  887. 3) ||
  888. this.deptBudgetList.basisPrice < 0 ||
  889. this.deptBudgetList.basisPrice > 10000
  890. ) {
  891. this.$message({
  892. message: '基差输入错误!',
  893. type: 'warning',
  894. })
  895. return
  896. }
  897. if (!this.deptBudgetList.receiveWarehouse) {
  898. this.$message({
  899. message: '请选择收货库!',
  900. type: 'warning',
  901. })
  902. return
  903. }
  904. if (!this.deptBudgetList.transactionsPlace) {
  905. this.$message({
  906. message: '请输入交易所!',
  907. type: 'warning',
  908. })
  909. return
  910. }
  911. if (
  912. this.deptBudgetList.transactionsPlace.length < 2 ||
  913. this.deptBudgetList.transactionsPlace.length > 15
  914. ) {
  915. this.$message({
  916. message: '交易所长度不符合要求,请输入2到15个字符之内!',
  917. type: 'warning',
  918. })
  919. return
  920. }
  921. if (!this.newSelectedOptions1) {
  922. this.$message({
  923. message: '请选择交货所在地区!',
  924. type: 'warning',
  925. })
  926. return
  927. }
  928. if (!this.newSelectedOptions) {
  929. this.$message({
  930. message: '请选择产地!',
  931. type: 'warning',
  932. })
  933. return
  934. }
  935. if (!this.deptBudgetList.contractNumber) {
  936. this.$message({
  937. message: '请输入合约号!',
  938. type: 'warning',
  939. })
  940. return
  941. }
  942. if (
  943. this.deptBudgetList.contractNumber.length < 2 ||
  944. this.deptBudgetList.contractNumber.length > 15
  945. ) {
  946. this.$message({
  947. message: '合约号长度不符合要求,请输入2到15个字符之内!',
  948. type: 'warning',
  949. })
  950. return
  951. }
  952. if (!this.deptBudgetList.placeDelivery) {
  953. this.$message({
  954. message: '请输入交货详细地址!',
  955. type: 'warning',
  956. })
  957. return
  958. }
  959. if (!this.deptBudgetList.pointPrice) {
  960. this.$message({
  961. message: '请输入点价!',
  962. type: 'warning',
  963. })
  964. return
  965. }
  966. if (
  967. isNaN(this.deptBudgetList.pointPrice) ||
  968. (String(this.deptBudgetList.pointPrice).indexOf('.') != -1 &&
  969. String(this.deptBudgetList.pointPrice).length -
  970. (String(this.deptBudgetList.pointPrice).indexOf('.') + 1) >
  971. 3) ||
  972. this.deptBudgetList.pointPrice < 0 ||
  973. this.deptBudgetList.pointPrice > 100000
  974. ) {
  975. this.$message({
  976. message: '输入点价有误!',
  977. type: 'warning',
  978. })
  979. return
  980. }
  981. if (!this.deptBudgetList.signingDate) {
  982. this.$message({
  983. message: '请选择签订日期',
  984. type: 'warning',
  985. })
  986. return
  987. }
  988. if (!this.deptBudgetList.pointPriceDate) {
  989. this.$message({
  990. message: '请选择点价日期',
  991. type: 'warning',
  992. })
  993. return
  994. }
  995. if (!this.deptBudgetList.deliveryDateStart) {
  996. this.$message({
  997. message: '请选择交货日期(起)',
  998. type: 'warning',
  999. })
  1000. return
  1001. }
  1002. if (!this.deptBudgetList.deliveryDateEnd) {
  1003. this.$message({
  1004. message: '请选择交货日期(止)',
  1005. type: 'warning',
  1006. })
  1007. return
  1008. }
  1009. //时间
  1010. if (
  1011. new Date(this.deptBudgetList.deliveryDateStart).getTime() >
  1012. new Date(this.deptBudgetList.deliveryDateEnd).getTime()
  1013. ) {
  1014. this.$message({
  1015. message: '交货日期(止)选择错误',
  1016. type: 'warning',
  1017. })
  1018. return
  1019. }
  1020. //货物信息
  1021. if (!this.deptBudgetList.contractGoodsInfo.goodsName) {
  1022. this.$message({
  1023. message: '请选择货名',
  1024. type: 'warning',
  1025. })
  1026. return
  1027. }
  1028. if (!this.deptBudgetList.contractGoodsInfo.waterContent) {
  1029. this.$message({
  1030. message: '请输入水分',
  1031. type: 'warning',
  1032. })
  1033. return
  1034. }
  1035. if (
  1036. this.deptBudgetList.contractGoodsInfo.waterContent &&
  1037. String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') != -1 &&
  1038. String(this.deptBudgetList.contractGoodsInfo.waterContent).length -
  1039. (String(this.deptBudgetList.contractGoodsInfo.waterContent).indexOf('.') + 1) >
  1040. 2 || this.deptBudgetList.contractGoodsInfo.waterContent > 40 || this.deptBudgetList.contractGoodsInfo
  1041. .waterContent < 0
  1042. ) {
  1043. this.$message({
  1044. message: '水分输入错误',
  1045. type: 'warning',
  1046. })
  1047. return
  1048. }
  1049. if (!this.deptBudgetList.contractGoodsInfo.grade) {
  1050. this.$message({
  1051. message: '请选择品级',
  1052. type: 'warning',
  1053. })
  1054. return
  1055. }
  1056. if (!this.deptBudgetList.contractGoodsInfo.transgene) {
  1057. this.$message({
  1058. message: '请选择转基因',
  1059. type: 'warning',
  1060. })
  1061. return
  1062. }
  1063. if (!this.deptBudgetList.contractGoodsInfo.impurity) {
  1064. this.$message({
  1065. message: '请输入杂质',
  1066. type: 'warning',
  1067. })
  1068. return
  1069. }
  1070. if (
  1071. this.deptBudgetList.contractGoodsInfo.impurity &&
  1072. String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') != -1 &&
  1073. String(this.deptBudgetList.contractGoodsInfo.impurity).length -
  1074. (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') + 1) >
  1075. 2 || this.deptBudgetList.contractGoodsInfo.impurity > 40 || this.deptBudgetList.contractGoodsInfo.impurity < 0
  1076. ) {
  1077. this.$message({
  1078. message: '杂质输入错误',
  1079. type: 'warning',
  1080. })
  1081. return
  1082. }
  1083. if (!this.deptBudgetList.contractGoodsInfo.bulkDensity) {
  1084. this.$message({
  1085. message: '请输入容重',
  1086. type: 'warning',
  1087. })
  1088. return
  1089. }
  1090. if (
  1091. (this.deptBudgetList.contractGoodsInfo.bulkDensity &&
  1092. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') != -1 &&
  1093. String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
  1094. (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf('.') + 1) >
  1095. 2) || this.deptBudgetList.contractGoodsInfo.bulkDensity > 1000 || this.deptBudgetList.contractGoodsInfo
  1096. .bulkDensity < 0
  1097. ) {
  1098. this.$message({
  1099. message: '容重输入错误',
  1100. type: 'warning',
  1101. })
  1102. return
  1103. }
  1104. if (!this.deptBudgetList.contractGoodsInfo.mildewGrain) {
  1105. this.$message({
  1106. message: '请输入霉变粒',
  1107. type: 'warning',
  1108. })
  1109. return
  1110. }
  1111. if (
  1112. !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
  1113. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1114. '.'
  1115. ) != -1 &&
  1116. String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
  1117. (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
  1118. '.'
  1119. ) +
  1120. 1) >
  1121. 2 || this.deptBudgetList.contractGoodsInfo.mildewGrain > 40 || this.deptBudgetList.contractGoodsInfo
  1122. .mildewGrain < 0)
  1123. ) {
  1124. this.$message({
  1125. message: '霉变粒输入错误',
  1126. type: 'warning',
  1127. })
  1128. return
  1129. }
  1130. if (!this.deptBudgetList.contractGoodsInfo.jiaorenli) {
  1131. this.$message({
  1132. message: '请输入热损伤',
  1133. type: 'warning',
  1134. })
  1135. return
  1136. }
  1137. if (
  1138. !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
  1139. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
  1140. -1 &&
  1141. String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
  1142. (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
  1143. '.'
  1144. ) +
  1145. 1) >
  1146. 2 || this.deptBudgetList.contractGoodsInfo.jiaorenli > 40 || this.deptBudgetList.contractGoodsInfo
  1147. .jiaorenli < 0)
  1148. ) {
  1149. this.$message({
  1150. message: '热损伤输入错误',
  1151. type: 'warning',
  1152. })
  1153. return
  1154. }
  1155. if (!this.deptBudgetList.contractGoodsInfo.imperfectGrain) {
  1156. this.$message({
  1157. message: '请输入不完善粒',
  1158. type: 'warning',
  1159. })
  1160. return
  1161. }
  1162. if (
  1163. !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
  1164. (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
  1165. '.'
  1166. ) != -1 &&
  1167. String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
  1168. (String(
  1169. this.deptBudgetList.contractGoodsInfo.imperfectGrain
  1170. ).indexOf('.') +
  1171. 1) >
  1172. 2 || this.deptBudgetList.contractGoodsInfo.imperfectGrain > 40 || this.deptBudgetList.contractGoodsInfo
  1173. .imperfectGrain < 0)
  1174. ) {
  1175. this.$message({
  1176. message: '不完善粒输入错误',
  1177. type: 'warning',
  1178. })
  1179. return
  1180. }
  1181. if (!this.deptBudgetList.contractGoodsInfo.protein) {
  1182. this.$message({
  1183. message: '请输入蛋白',
  1184. type: 'warning',
  1185. })
  1186. return
  1187. }
  1188. if (
  1189. !this.deptBudgetList.contractGoodsInfo.protein ||
  1190. (String(this.deptBudgetList.contractGoodsInfo.protein).indexOf(
  1191. '.'
  1192. ) != -1 &&
  1193. String(this.deptBudgetList.contractGoodsInfo.protein).length -
  1194. (String(
  1195. this.deptBudgetList.contractGoodsInfo.protein
  1196. ).indexOf('.') +
  1197. 1) >
  1198. 2 || this.deptBudgetList.contractGoodsInfo.protein > 70 || this.deptBudgetList.contractGoodsInfo.protein < 0
  1199. )
  1200. ) {
  1201. this.$message({
  1202. message: '蛋白输入错误',
  1203. type: 'warning',
  1204. })
  1205. return
  1206. }
  1207. if (
  1208. this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000 ||
  1209. this.deptBudgetList.contractProcessInfo.goodsNameKey < 0 ||
  1210. (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
  1211. '.'
  1212. ) != -1 &&
  1213. String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
  1214. (String(
  1215. this.deptBudgetList.contractProcessInfo.goodsNameKey
  1216. ).indexOf('.') +
  1217. 1) >
  1218. 2)
  1219. ) {
  1220. this.$message({
  1221. message: '已付款金额输入错误',
  1222. type: 'warning',
  1223. })
  1224. return
  1225. }
  1226. if (
  1227. this.deptBudgetList.contractProcessInfo.waterContent > 10000000 ||
  1228. this.deptBudgetList.contractProcessInfo.waterContent < 0 ||
  1229. (String(this.deptBudgetList.contractProcessInfo.waterContent).indexOf(
  1230. '.'
  1231. ) != -1 &&
  1232. String(this.deptBudgetList.contractProcessInfo.waterContent).length -
  1233. (String(
  1234. this.deptBudgetList.contractProcessInfo.waterContent
  1235. ).indexOf('.') +
  1236. 1) >
  1237. 2)
  1238. ) {
  1239. this.$message({
  1240. message: '费用支出金额输入错误',
  1241. type: 'warning',
  1242. })
  1243. return
  1244. }
  1245. if (
  1246. this.deptBudgetList.contractProcessInfo.goodsName > 1000000000 ||
  1247. this.deptBudgetList.contractProcessInfo.goodsName < 0 ||
  1248. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1249. '.'
  1250. ) != -1 &&
  1251. String(this.deptBudgetList.contractProcessInfo.goodsName).length -
  1252. (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
  1253. '.'
  1254. ) +
  1255. 1) >
  1256. 2)
  1257. ) {
  1258. this.$message({
  1259. message: '已开发票金额输入错误',
  1260. type: 'warning',
  1261. })
  1262. return
  1263. }
  1264. if (
  1265. this.deptBudgetList.contractProcessInfo.impurity > 1000000000 ||
  1266. this.deptBudgetList.contractProcessInfo.impurity < 0 ||
  1267. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1268. '.'
  1269. ) != -1 &&
  1270. String(this.deptBudgetList.contractProcessInfo.impurity).length -
  1271. (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
  1272. '.'
  1273. ) +
  1274. 1) >
  1275. 2)
  1276. ) {
  1277. this.$message({
  1278. message: '未开发票金额输入错误',
  1279. type: 'warning',
  1280. })
  1281. return
  1282. }
  1283. if (
  1284. (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) ||
  1285. (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
  1286. (String(this.deptBudgetList.contractProcessInfo.mildewGrain).indexOf(
  1287. '.'
  1288. ) != -1 &&
  1289. String(this.deptBudgetList.contractProcessInfo.mildewGrain).length -
  1290. (String(
  1291. this.deptBudgetList.contractProcessInfo.mildewGrain
  1292. ).indexOf('.') +
  1293. 1) >
  1294. 2)
  1295. ) {
  1296. this.$message({
  1297. message: '未回款金额输入错误',
  1298. type: 'warning',
  1299. })
  1300. return
  1301. }
  1302. var that = this
  1303. this.$refs.deptBudgetList.validate((valid) => {
  1304. if (valid) {
  1305. this.deptBudgetList.compId = this.compId
  1306. this.deptBudgetList.contractType = 2
  1307. this.deptBudgetList.goodsType = 2
  1308. addList(this.deptBudgetList)
  1309. .toPromise()
  1310. .then((response) => {
  1311. // 存储买方、卖方、买方电话、卖方电话
  1312. let _data = {
  1313. byer: this.deptBudgetList.buyer,
  1314. seller: this.deptBudgetList.seller,
  1315. buyerPhone: this.deptBudgetList.buyerPhone,
  1316. sellerPhone: this.deptBudgetList.sellerPhone
  1317. }
  1318. if (this.restaurants1.length <= 20) {
  1319. this.restaurants1 = this.restaurants1.filter(function(val) {
  1320. if (val.value != _data.byer) {
  1321. return val
  1322. }
  1323. })
  1324. this.restaurants1.unshift({
  1325. value: _data.byer
  1326. })
  1327. } else {
  1328. this.restaurants1.unshift({
  1329. value: _data.byer
  1330. }).pop({
  1331. value: _data.byer
  1332. })
  1333. }
  1334. localStorage.setItem('deptBudgetList_data1', JSON.stringify(this.restaurants1));
  1335. if (this.restaurants2.length <= 20) {
  1336. this.restaurants2 = this.restaurants2.filter(function(val) {
  1337. if (val.value != _data.seller) {
  1338. return val
  1339. }
  1340. })
  1341. this.restaurants2.unshift({
  1342. value: _data.seller
  1343. })
  1344. } else {
  1345. this.restaurants2.unshift({
  1346. value: _data.seller
  1347. }).pop({
  1348. value: _data.seller
  1349. })
  1350. }
  1351. localStorage.setItem('deptBudgetList_data2', JSON.stringify(this.restaurants2));
  1352. if (this.restaurants2.length <= 20) {
  1353. this.restaurants3 = this.restaurants3.filter(function(val) {
  1354. if (val.value != _data.buyerPhone) {
  1355. return val
  1356. }
  1357. })
  1358. this.restaurants3.unshift({
  1359. value: _data.buyerPhone
  1360. })
  1361. } else {
  1362. this.restaurants3.unshift({
  1363. value: _data.buyerPhone
  1364. }).pop({
  1365. value: _data.buyerPhone
  1366. })
  1367. }
  1368. localStorage.setItem('deptBudgetList_data3', JSON.stringify(this.restaurants3));
  1369. if (this.restaurants4.length <= 20) {
  1370. this.restaurants4 = this.restaurants3.filter(function(val) {
  1371. if (val.value != _data.sellerPhone) {
  1372. return val
  1373. }
  1374. })
  1375. this.restaurants4.unshift({
  1376. value: _data.sellerPhone
  1377. })
  1378. } else {
  1379. this.restaurants4.unshift({
  1380. value: _data.sellerPhone
  1381. }).pop({
  1382. value: _data.sellerPhone
  1383. })
  1384. }
  1385. localStorage.setItem('deptBudgetList_data4', JSON.stringify(this.restaurants4));
  1386. this.$message.success('添加成功')
  1387. this.selectedOptions = []
  1388. this.deptBudgetList = {
  1389. deliverType: '1',
  1390. finalTradingVolume: 0,
  1391. contractGoodsInfo: {
  1392. goodsName: '',
  1393. },
  1394. contractProcessInfo: {},
  1395. }
  1396. this.$router.push({
  1397. path: 'futuresPurchaseContract'
  1398. })
  1399. })
  1400. } else {
  1401. EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
  1402. return false
  1403. }
  1404. })
  1405. },
  1406. resetForm(deptBudgetList) {
  1407. this.$refs[deptBudgetList].resetFields()
  1408. },
  1409. addClick() {
  1410. this.unitList.push({
  1411. flag: 'add',
  1412. constValue: '',
  1413. constKey: '',
  1414. })
  1415. },
  1416. saveClick(item, index) {
  1417. if (Object.is(item.id, 1)) {
  1418. return
  1419. }
  1420. if (Object.is(this.unitList[index].flag, 'delete')) {
  1421. this.$set(this.unitList, index, {
  1422. flag: 'check'
  1423. })
  1424. } else {
  1425. this.$set(this.unitList, index, {
  1426. flag: 'delete'
  1427. })
  1428. }
  1429. if (!item.constValue) {
  1430. this.unitList.splice(index, 1)
  1431. return
  1432. }
  1433. if (item.flag == 'add') {
  1434. item.constKey = Math.random() * 20
  1435. this.acceptanceCheck.compId = this.compId
  1436. this.acceptanceCheck.constKey = item.constKey
  1437. this.acceptanceCheck.constCode = 'TYPEYAN'
  1438. this.acceptanceCheck.constValue = item.constValue
  1439. this.acceptanceCheck.id = item.id
  1440. addxiala(this.acceptanceCheck)
  1441. .toPromise()
  1442. .then((response) => {
  1443. this.getUnitList()
  1444. })
  1445. } else if (item.flag == 'check') {
  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. editxiala(this.acceptanceCheck)
  1452. .toPromise()
  1453. .then((response) => {
  1454. this.getUnitList()
  1455. })
  1456. }
  1457. },
  1458. selectChapterTwo(e) {
  1459. for (var i = 0; i < this.ChapterTwoList.length; i++) {
  1460. if (this.ChapterTwoList[i].constValue == e) {
  1461. this.deptBudgetList.gradeKey = this.ChapterTwoList[i].constKey
  1462. }
  1463. }
  1464. },
  1465. selectunitList(e) {
  1466. for (var i = 0; i < this.unitList.length; i++) {
  1467. if (this.unitList[i].constValue == e) {
  1468. this.deptBudgetList.acceptanceMethodKey = this.unitList[i].constKey
  1469. }
  1470. }
  1471. },
  1472. selectgrade(e) {
  1473. for (var i = 0; i < this.gradeList.length; i++) {
  1474. if (this.gradeList[i].constValue == e) {
  1475. this.deptBudgetList.gradeKey = this.gradeList[i].constKey
  1476. this.deptBudgetList.contractGoodsInfo.gradeKey =
  1477. this.gradeList[i].constKey
  1478. }
  1479. }
  1480. },
  1481. selecttransgene(e) {
  1482. for (var i = 0; i < this.transgeneList.length; i++) {
  1483. if (this.transgeneList[i].constValue == e) {
  1484. this.deptBudgetList.gradeKey = this.transgeneList[i].constKey
  1485. }
  1486. }
  1487. },
  1488. selectgoodsName(e) {
  1489. for (var i = 0; i < this.goodnameList.length; i++) {
  1490. if (this.goodnameList[i].constValue == e) {
  1491. this.deptBudgetList.goodsNameKey = this.goodnameList[i].constKey
  1492. this.deptBudgetList.contractGoodsInfo.goodsNameKey = this.goodnameList[i].constKey
  1493. }
  1494. }
  1495. },
  1496. selectwarehouseName() {},
  1497. selectpackingMethod(e) {
  1498. for (var i = 0; i < this.packtypeList.length; i++) {
  1499. if (this.packtypeList[i].constValue == e) {
  1500. this.deptBudgetList.packingMethodKey = this.packtypeList[i].constKey
  1501. }
  1502. }
  1503. },
  1504. // 编辑
  1505. editClick(item, index) {
  1506. const map = JSON.parse(JSON.stringify(item))
  1507. if (Object.is(item.id, 1)) {
  1508. return
  1509. }
  1510. if (Object.is(this.unitList[index].flag, 'delete')) {
  1511. map.flag = 'check'
  1512. this.$set(this.unitList, index, map)
  1513. } else {
  1514. map.flag = 'delete'
  1515. this.$set(this.unitList, index, map)
  1516. }
  1517. },
  1518. // 删除
  1519. deleteClick(item, index) {
  1520. if (Object.is(item.constKey, 1)) {
  1521. return
  1522. }
  1523. if (!item.constValue) {
  1524. this.unitList.splice(index, 1)
  1525. return
  1526. }
  1527. delxiala({
  1528. id: this.unitList[index].id
  1529. })
  1530. .toPromise()
  1531. .then((response) => {
  1532. this.getUnitList()
  1533. this.pleaseChoose = ''
  1534. })
  1535. },
  1536. },
  1537. }
  1538. </script>
  1539. <style lang="scss" scoped>
  1540. .el-form {
  1541. padding: 0 15%;
  1542. }
  1543. /deep/.ws-info-table .el-form-item {
  1544. border-right: 1px solid #cdd2dc;
  1545. border-bottom: 1px solid #cdd2dc;
  1546. }
  1547. .readonly {
  1548. position: relative;
  1549. }
  1550. .readonly:after {
  1551. content: '*';
  1552. color: #ff2727;
  1553. position: absolute;
  1554. right: 8px;
  1555. z-index: 10;
  1556. top: 21%;
  1557. font-size: 20px;
  1558. }
  1559. .upload-demo {
  1560. margin-top: 10px;
  1561. }
  1562. .title {
  1563. position: relative;
  1564. }
  1565. .title::before {
  1566. content: '';
  1567. display: inline-block;
  1568. width: 5px;
  1569. height: 30px;
  1570. background: #5473e8;
  1571. position: absolute;
  1572. left: 0;
  1573. }
  1574. .el-button--primary {
  1575. background-color: #5878e8;
  1576. border-color: #5878e8;
  1577. }
  1578. .el-col {
  1579. background: #f6f7fc;
  1580. }
  1581. /deep/.ws-info-table .el-form-item .el-form-item__content {
  1582. padding: 0 25px;
  1583. border-left: 1px solid #cdd2dc;
  1584. background: #fafbfc;
  1585. }
  1586. /deep/.ws-info-table .el-form-item .el-form-item__label {
  1587. width: 140px;
  1588. text-align: center;
  1589. background: #f0f2f6;
  1590. // border: 1px solid #cdd2dc;
  1591. }
  1592. .button-container {
  1593. display: flex;
  1594. flex-wrap: nowrap;
  1595. justify-content: space-between;
  1596. align-items: center;
  1597. background-color: #fff;
  1598. width: 100%;
  1599. height: 50px;
  1600. padding: 0 10px;
  1601. &>div {
  1602. margin-left: 10px;
  1603. display: flex;
  1604. flex-wrap: nowrap;
  1605. flex-direction: row;
  1606. &>span {
  1607. line-height: 50px;
  1608. }
  1609. }
  1610. /deep/.auditFlow-box {
  1611. position: unset;
  1612. margin-left: 10px;
  1613. &/deep/.auditFlow-icon {
  1614. width: auto;
  1615. padding-right: 30px;
  1616. }
  1617. &/deep/.auditFlow-main {
  1618. position: absolute;
  1619. }
  1620. }
  1621. }
  1622. .box-app {
  1623. display: inline-block;
  1624. float: left;
  1625. margin-left: 30px;
  1626. line-height: 50px;
  1627. }
  1628. /deep/.el-dialog {
  1629. .el-form-item {
  1630. margin-bottom: 0 !important;
  1631. .el-input--medium {
  1632. textarea {
  1633. min-height: 100px !important;
  1634. }
  1635. }
  1636. }
  1637. }
  1638. .collapse-bottom {
  1639. margin-bottom: 20px;
  1640. }
  1641. .input-main .textarea .el-textarea__inner {
  1642. width: 100%;
  1643. z-index: 1;
  1644. }
  1645. .bg-left {
  1646. padding-left: 30px;
  1647. }
  1648. .bg-right {
  1649. padding-right: 10px;
  1650. text-align: right;
  1651. }
  1652. .bg-bottom {
  1653. margin: 15px 0px;
  1654. }
  1655. .wenzi h3 {
  1656. display: inline-block;
  1657. left: 10px;
  1658. }
  1659. .wenzi p {
  1660. display: inline-block;
  1661. }
  1662. .center {
  1663. width: 70%;
  1664. margin: 0 auto;
  1665. }
  1666. .el-form-item {
  1667. width: 50%;
  1668. }
  1669. .el-form-item__label {
  1670. text-align: center;
  1671. }
  1672. .ce {
  1673. width: 900px;
  1674. margin: 0 auto;
  1675. }
  1676. /*.crt-main .textarea /deep/ .el-form-item__label {*/
  1677. /* height: 82px;*/
  1678. /*}*/
  1679. // 控制select为只读的时候显示样式
  1680. .hide-sel {
  1681. .el-input__inner {
  1682. border: 0px;
  1683. }
  1684. .el-icon-arrow-up {
  1685. display: none;
  1686. }
  1687. .el-textarea__inner {
  1688. background-color: #fff !important;
  1689. border: 0;
  1690. }
  1691. .el-date-editor {
  1692. i {
  1693. display: none;
  1694. }
  1695. }
  1696. .is-disabled {
  1697. .el-input__inner:hover {
  1698. background-color: #fff !important;
  1699. border: 0;
  1700. }
  1701. color: #606266;
  1702. .el-input__inner {
  1703. background-color: #fff !important;
  1704. border: 0;
  1705. color: #606266;
  1706. }
  1707. .el-textarea__inner {
  1708. background-color: #fff !important;
  1709. border: 0;
  1710. color: #606266;
  1711. }
  1712. }
  1713. }
  1714. // 控制select为只读的时候显示样式
  1715. /deep/.ws-class-table-col {
  1716. height: auto;
  1717. padding: 0px 2px;
  1718. /deep/.el-input__inner {
  1719. padding: 0px 2px;
  1720. }
  1721. }
  1722. /deep/.is-disabled {
  1723. .el-input__prefix,
  1724. .el-input__suffix {
  1725. display: none;
  1726. }
  1727. .el-input__inner {
  1728. background-color: #fff;
  1729. border-color: #fff !important;
  1730. color: #000 !important;
  1731. font-size: 14px;
  1732. cursor: text;
  1733. padding: 0 !important;
  1734. }
  1735. }
  1736. .winseaview-view {
  1737. padding: 0 0 20px;
  1738. }
  1739. .container {
  1740. overflow: scroll;
  1741. height: 93vh;
  1742. }
  1743. /deep/.ws-info-table[data-v-850a44a6] .el-form-item .el-form-item__label {
  1744. width: 130px;
  1745. }
  1746. .el-textarea {
  1747. width: 101%;
  1748. }
  1749. .addressUrls {
  1750. width: 100%;
  1751. display: flex;
  1752. margin-top: 10px;
  1753. }
  1754. .addressUrls-item {
  1755. position: relative;
  1756. display: flex;
  1757. }
  1758. .icon-guanbi {
  1759. position: absolute;
  1760. right: 8px;
  1761. }
  1762. .addressUrl {
  1763. margin: 0px 10px;
  1764. border-radius: 3px;
  1765. }
  1766. //上传文件成功标识
  1767. /deep/.el-upload-list__item-status-label {
  1768. position: absolute;
  1769. right: 22px;
  1770. top: -1px;
  1771. line-height: inherit;
  1772. display: none;
  1773. }
  1774. .map {
  1775. position: fixed;
  1776. top: 0;
  1777. bottom: 0;
  1778. left: 0;
  1779. right: 0;
  1780. margin: auto;
  1781. width: 850px;
  1782. height: 400px;
  1783. background: gainsboro;
  1784. border-radius: 20px;
  1785. padding: 10px;
  1786. box-sizing: border-box;
  1787. z-index: 99;
  1788. }
  1789. .amap-container {
  1790. width: 100% !important;
  1791. }
  1792. .address-btn {
  1793. width: 100%;
  1794. text-align: left;
  1795. color:#000;
  1796. border:1px solid #ccc;
  1797. }
  1798. .inline-input {
  1799. width: 100%;
  1800. }
  1801. .typeselect{
  1802. width: 100%;
  1803. }
  1804. </style>