acquisitionContractAdd.vue 58 KB

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