salesContractAdd.vue 63 KB

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