collectionContractAdd.vue 60 KB

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