futuresSalesContractAdd.vue 60 KB

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