purchaseContractAdd.vue 72 KB

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