orderAdd.vue 66 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770
  1. <template>
  2. <div class="bg-in-stock" ref="printId">
  3. <!-- <h2 v-if="barcodeValue">订单编号</h2>
  4. <div class="numOrder" v-if="(barcodeValue && type !== 'pone') && orderType == 'check'">
  5. <barcode :value="barcodeValue"></barcode>
  6. </div>-->
  7. <el-form ref="orderFormRef" :rules="rules" :model="OrderForm" label-width="120px" inline :disabled="isDetail">
  8. <h3>基本信息</h3>
  9. <el-row>
  10. <el-col :span="10">
  11. <el-form-item label="订单类型:" prop="type" :rules="rules.type">
  12. <el-select v-model="OrderForm.type" clearable :disabled="type == 'pone'">
  13. <el-option v-for="(item, index) in orderTypeList" :key="index" :label="item.label" :value="item.value" />
  14. </el-select>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :span="10">
  18. <el-form-item label="下单客户:" prop="member_id">
  19. <el-select v-model="OrderForm.member_id" clearable :disabled="type == 'pone'" @change="selMember">
  20. <el-option v-for="item in customerList" :key="item.id" :label="item.name" :value="item.id" />
  21. </el-select>
  22. <!-- <el-button type="primary" v-if="type !== 'pone'" @click="addCust">新增客户</el-button> -->
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="10">
  26. <el-form-item label="客户名称:" prop="customer_name">
  27. <el-input placeholder="请输入客户名称" v-model="OrderForm.customer_name" :disabled="type == 'pone'"></el-input>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="10">
  31. <el-form-item label="客户联系方式:" prop="customer_phone">
  32. <el-input placeholder="请输入客户联系方式" v-model="OrderForm.customer_phone" :disabled="type == 'pone'"></el-input>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="10">
  36. <el-form-item label="起始时间:" prop="time" :rules="rules.start_time" v-if="OrderForm.type == 'TO_C'">
  37. <!-- <el-date-picker v-model="OrderForm.start_time" type="datetime" placeholder="选择日期时间"
  38. :disabled="type == 'pone'" :picker-options="pickerOptions" value-format="yyyy-MM-dd HH:mm:ss">
  39. </el-date-picker> -->
  40. <el-date-picker v-model="time" type="daterange" align="center" @change='timeChange' :editable="false"
  41. unlink-panels :clearable="true" :default-time="['00:00:00', '23:59:59']" range-separator="-"
  42. start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd hh:mm:ss" :picker-options="{
  43. disabledDate(time) {
  44. return (
  45. time.getTime() <=
  46. new Date(
  47. new Date().getFullYear(),
  48. new Date().getMonth(),
  49. new Date().getDate()
  50. ).getTime() -
  51. 86400000
  52. );
  53. },
  54. shortcuts: MixinPickerShortcuts,
  55. }">
  56. </el-date-picker>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :span="10">
  60. <el-form-item label="付款方式:" prop="pay_type" :rules="rules.pay_type">
  61. <el-select v-model="OrderForm.pay_type" clearable :disabled="type == 'pone'">
  62. <el-option v-for="item in collectingAccountList" :key="item.id" :label="item.name" :value="item.id" />
  63. </el-select>
  64. </el-form-item>
  65. </el-col>
  66. <el-col :span="10">
  67. <el-form-item label="销售人员:" prop="marketing_id" :rules="rules.marketing_id">
  68. <el-select v-model="OrderForm.marketing_id" clearable :disabled="type == 'pone'">
  69. <el-option v-for="item in marketingList" :key="item.id" :label="item.real_name" :value="item.id" />
  70. </el-select>
  71. </el-form-item>
  72. </el-col>
  73. <el-col :span="10">
  74. <el-form-item label="配送方式:" prop="send_type" :rules="rules.send_type">
  75. <el-select v-model="OrderForm.send_type" clearable :disabled="type == 'pone'">
  76. <el-option v-for="item in deliveryTypeList" :key="item.value" :label="item.label" :value="item.value" />
  77. </el-select>
  78. </el-form-item>
  79. </el-col>
  80. <el-col :span="10">
  81. <el-form-item label="配送仓库:" prop="warehouse_id" :rules="rules.warehouse_id">
  82. <!-- <el-cascader v-model="OrderForm.dept_id" :options="deptList" :props="{
  83. label: 'name',
  84. value: 'id',
  85. emitPath: false,
  86. checkStrictly: true
  87. }" clearable></el-cascader> -->
  88. <el-select @change="cleanGoodsList" v-model="OrderForm.warehouse_id" multiple clearable
  89. :disabled="type == 'pone'">
  90. <el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" />
  91. </el-select>
  92. </el-form-item>
  93. </el-col>
  94. <el-col :span="10">
  95. <el-form-item label="返回仓库:" prop="return_warehouse_id" :rules="rules.return_warehouse_id">
  96. <el-select v-model="OrderForm.return_warehouse_id" clearable :disabled="type == 'pone'">
  97. <el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" />
  98. </el-select>
  99. </el-form-item>
  100. </el-col>
  101. <el-col :span="10">
  102. <el-form-item label="配送地址:" prop="province_city_area_address">
  103. <el-cascader size="small" :options="options" clearable v-model="selectedOptions" @change="handleChange"
  104. :disabled="type == 'pone'">
  105. </el-cascader>
  106. <el-input v-model="OrderForm.address" placeholder="请输入" :disabled="type == 'pone'"></el-input>
  107. </el-form-item>
  108. </el-col>
  109. <el-col :span="10">
  110. <el-form-item label="允许负库存:">
  111. <el-radio-group v-model="OrderForm.subtract_stock" :disabled="type == 'pone'">
  112. <el-radio :label="false">禁止</el-radio>
  113. <el-radio :label="true">允许</el-radio>
  114. </el-radio-group>
  115. </el-form-item>
  116. </el-col>
  117. <el-col :span="10">
  118. <el-form-item label="订单渠道:" prop="sale_channel_id" :rules="rules.sale_channel_id">
  119. <el-select v-model="OrderForm.sale_channel_id" clearable :disabled="type == 'pone'">
  120. <el-option v-for="item in channList" :key="item.id" :label="item.name" :value="item.id" />
  121. </el-select>
  122. </el-form-item>
  123. </el-col>
  124. <el-col :span="24">
  125. <div class="redClass">
  126. <el-form-item label="备注:" prop="remark">
  127. <el-input v-model="OrderForm.remark" type="textarea" :autosize="{ minRows: 2 }"
  128. :disabled="type == 'pone'"></el-input>
  129. </el-form-item>
  130. </div>
  131. </el-col>
  132. </el-row>
  133. <div style="margin-bottom: 10px">
  134. <h3>商品明细</h3>
  135. <div v-if="!isDetail">
  136. <el-button class="button" size="mini" type="primary" @click="handleSelectGoods">手动选择</el-button>
  137. <el-button class="button" size="mini" type="primary" @click="handleSelectGrou">选择分组商品</el-button>
  138. </div>
  139. </div>
  140. <div style="display: block">
  141. <el-table :data="OrderForm.product_list" border :cell-style="{ textAlign: 'center' }"
  142. @selection-change="handleSelectionChange" :header-cell-style="{ textAlign: 'center' }" style="width: 95%">
  143. <el-table-column type="selection" width="40" align="center" />
  144. <el-table-column label="图标">
  145. <template slot-scope="scope">
  146. <img :src="scope.row.goods_vo.image_small_list" alt="" width="50px">
  147. </template>
  148. </el-table-column>
  149. <el-table-column label="仓库名称">
  150. <template slot-scope="scope">
  151. {{ warehouseName(scope.row.warehouse_id) }}
  152. </template>
  153. </el-table-column>
  154. <el-table-column label="库位号">
  155. <template slot-scope="scope">
  156. <el-popover placement="right" trigger="click" v-if="scope.row.area_stock_list">
  157. <div>
  158. <p v-for="item in scope.row.area_stock_list" :key="item.id">{{ item.warehouse_area_name }}</p>
  159. </div>
  160. <span slot="reference" v-if="scope.row.area_stock_list.length !== 0">{{
  161. scope.row.area_stock_list[0].warehouse_area_name }}</span>
  162. </el-popover>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="商品编号">
  166. <template slot-scope="scope">
  167. {{ scope.row.goods_vo.sn }}
  168. </template>
  169. </el-table-column>
  170. <el-table-column label="商品名称">
  171. <template slot-scope="scope">
  172. {{ scope.row.goods_vo.name }}
  173. </template>
  174. </el-table-column>
  175. <el-table-column label="sku">
  176. <template slot-scope="scope">
  177. <span v-if="!id"> {{ scope.row.product_vo.sku }}</span>
  178. <span v-else> {{ scope.row.product_vo.sku }}</span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="序列号">
  182. <template slot-scope="scope">
  183. <span v-if="!id"> {{ scope.row.product_vo.sn_code }}</span>
  184. <span v-else> {{ scope.row.product_vo.sn_code }}</span>
  185. </template>
  186. </el-table-column>
  187. <el-table-column prop="product_vo.spec_name" label="规格型号">
  188. <!-- <template slot-scope="scope">
  189. <span v-if="!id">{{ scope.row.product_vo.spec_name }}</span>
  190. <span v-else>{{ scope.row.product_vo.spec_name }}</span>
  191. </template> -->
  192. </el-table-column>
  193. <el-table-column label="单位">
  194. <template slot-scope="scope">
  195. <span v-if="!id"> {{ scope.row.product_vo.unit }}</span>
  196. <span v-else> {{ scope.row.product_vo.unit }}</span>
  197. </template>
  198. </el-table-column>
  199. <el-table-column label="订单数量">
  200. <template slot-scope="scope">
  201. <el-input v-model="scope.row.num" type="number" :min="0" :maxlength="20"></el-input>
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="库存数量">
  205. <template slot-scope="scope">
  206. {{ scope.row.usable_stock }}
  207. </template>
  208. </el-table-column>
  209. <el-table-column label="租赁天数" v-if="OrderForm.type == 'TO_C'">
  210. <template slot-scope="scope">
  211. <el-input v-model="scope.row.day_num" type="number" :min="0" :maxlength="20"></el-input>
  212. </template>
  213. </el-table-column>
  214. <!-- <el-table-column label="结束时间" width="200" v-if="OrderForm.type == 'TO_C'">
  215. <template slot-scope="scope">
  216. <el-date-picker style="width: 170px;" v-model="scope.row.end_time" type="datetime" placeholder="选择日期时间"
  217. :picker-options="pickerOptionsEnd" value-format="yyyy-MM-dd HH:mm:ss">
  218. </el-date-picker>
  219. </template>
  220. </el-table-column> -->
  221. <!-- <el-table-column label="差异">
  222. <template slot-scope="scope">
  223. {{ scope.row.usable_stock - scope.row.num || 0 }}
  224. </template>
  225. </el-table-column>
  226. <el-table-column label="数量">
  227. <template slot-scope="scope">
  228. <el-form-item v-if="!isDetail" :prop="'product_list.'+scope.$index+'.num'" :rules="rules.product_list.num" class="tableFormItem">
  229. <el-input v-model="scope.row.num" :maxlength="20" :minlength="1"></el-input>
  230. </el-form-item>
  231. <span v-else>{{ scope.row.num }}</span>
  232. </template>
  233. </el-table-column>
  234. <el-table-column label="单价">
  235. <template slot-scope="scope">
  236. <el-form-item v-if="!isDetail" :prop="'product_list.'+scope.$index+'.price'" :rules="rules.product_list.price" class="tableFormItem">
  237. <el-input v-model="scope.row.price" :maxlength="20" :minlength="1"></el-input>
  238. </el-form-item>
  239. <span v-else>{{ scope.row.price }}</span>
  240. </template>
  241. </el-table-column>
  242. <el-table-column label="金额">
  243. <template slot-scope="scope">
  244. {{ scope.row.total_price.toFixed(2) }}
  245. </template>
  246. </el-table-column>
  247. <el-table-column label="税率">
  248. <template slot-scope="scope">
  249. <el-form-item v-if="!isDetail" :prop="'product_list.'+scope.$index+'.tax_rate'" :rules="rules.product_list.tax_rate" class="tableFormItem">
  250. <el-input v-model="scope.row.tax_rate" :maxlength="20"></el-input>
  251. </el-form-item>
  252. <span v-else>{{ scope.row.tax_rate }}</span>
  253. </template>
  254. </el-table-column>
  255. <el-table-column label="税额">
  256. <template slot-scope="scope">
  257. {{ scope.row.tax_price.toFixed(2) }}
  258. </template>
  259. </el-table-column>
  260. <el-table-column label="优惠金额">
  261. <template slot-scope="scope">
  262. <el-form-item v-if="!isDetail" :prop="'product_list.'+scope.$index+'.discount_price'" :rules="rules.product_list.discount_price" class="tableFormItem">
  263. <el-input v-model="scope.row.discount_price"></el-input>
  264. </el-form-item>
  265. <span v-else>{{ scope.row.discount_price }}</span>
  266. </template>
  267. </el-table-column>
  268. <el-table-column label="合计">
  269. <template slot-scope="scope">
  270. {{ scope.row.pay_price.toFixed(2) }}
  271. </template>
  272. </el-table-column>
  273. <el-table-column label="备注">
  274. <template slot-scope="scope">
  275. <el-input v-if="!isDetail" v-model="scope.row.remark"></el-input>
  276. <span v-else>{{ scope.row.remark }}</span>
  277. </template>
  278. </el-table-column> -->
  279. <el-table-column label="操作" v-if="!isDetail && type !== 'pone'">
  280. <template slot-scope="scope">
  281. <el-button size="mini" type="danger" @click="OrderForm.product_list.splice(scope.$index, 1)">删除
  282. </el-button>
  283. </template>
  284. </el-table-column>
  285. </el-table>
  286. </div>
  287. <el-row style="margin-top: 15px;margin-bottom: 20px;">
  288. <el-col :span="8">
  289. <el-form-item label="应付金额:" prop="pay_price" :rules="rules.pay_price">
  290. <span>{{ "¥" + price }}</span>
  291. </el-form-item>
  292. </el-col>
  293. <el-col :span="8">
  294. <el-form-item label="折扣:" prop="">
  295. <el-input placeholder="请输入" v-model="discount" @blur="handleBlur" :disabled="type == 'pone'">
  296. <template slot="append">折</template>
  297. </el-input>
  298. </el-form-item>
  299. </el-col>
  300. <el-col :span="8">
  301. <el-form-item label="实付金额:" prop="real_price" :rules="rules.pay_price">
  302. <el-input v-model="OrderForm.real_price" placeholder="请输入" :disabled="type == 'pone'"></el-input>
  303. </el-form-item>
  304. </el-col>
  305. <el-col :span="16" v-if="OrderForm.type == 'TO_C' && id">
  306. <el-form-item label="交通费汇总:" prop="real_price">
  307. <span>{{ '¥' + TO_Cmoney }} </span>
  308. <el-button @click="reimList">查看明细</el-button>
  309. </el-form-item>
  310. </el-col>
  311. <el-col :span="8">
  312. <!-- <el-form-item label="交通费:" prop="real_price">
  313. <el-button></el-button>
  314. </el-form-item> -->
  315. </el-col>
  316. <el-col :span="8" v-if="OrderForm.type == 'TO_C' && id">
  317. <el-form-item label="总金额:" prop="real_price" :rules="rules.pay_price">
  318. {{ '¥' + totalAmount }}
  319. <!-- <el-input v-model="OrderForm.real_price" placeholder="请输入" :disabled="type == 'pone'"></el-input> -->
  320. </el-form-item>
  321. </el-col>
  322. </el-row>
  323. <!-- <div class="mx">
  324. <h3>支付信息</h3>
  325. <el-button v-if="!isDetail" class="button" size="mini" type="primary" icon="el-icon-circle-plus-outline"
  326. @click="handleInsertPayment"></el-button>
  327. </div>
  328. <div style="display:block">
  329. <el-table :data="OrderForm.payment_list" border :cell-style="{ textAlign: 'center' }"
  330. :header-cell-style="{ textAlign: 'center' }" style="width: 95%; ">
  331. <el-table-column label="支付方式">
  332. <template slot-scope="scope">
  333. <el-form-item v-if="!isDetail" :prop="'payment_list.'+scope.$index+'.collecting_account_id'" :rules="rules.payment_list.collecting_account_id" class="tableFormItem">
  334. <el-select v-model="scope.row.collecting_account_id">
  335. <el-option v-for="item in collectingAccountList" :key="item.id" :label="item.name" :value="item.id"/>
  336. </el-select>
  337. </el-form-item>
  338. <span v-else>{{ scope.row.collecting_account_name }}</span>
  339. </template>
  340. </el-table-column>
  341. <el-table-column label="支付金额">
  342. <template slot-scope="scope">
  343. <el-form-item v-if="!isDetail" :prop="'payment_list.'+scope.$index+'.price'" :rules="rules.payment_list.price" class="tableFormItem">
  344. <el-input v-model="scope.row.price"></el-input>
  345. </el-form-item>
  346. <span v-else>{{ scope.row.price }}</span>
  347. </template>
  348. </el-table-column>
  349. <el-table-column label="备注">
  350. <template slot-scope="scope">
  351. <el-input v-if="!isDetail" v-model="scope.row.remark"></el-input>
  352. <span v-else>{{ scope.row.remark }}</span>
  353. </template>
  354. </el-table-column>
  355. <el-table-column label="操作" v-if="!isDetail">
  356. <template slot-scope="scope">
  357. <el-button size="mini" type="danger"
  358. @click="OrderForm.payment_list.splice(scope.$index, 1)">删除
  359. </el-button>
  360. </template>
  361. </el-table-column>
  362. <div slot="append" style="text-align: right;line-height: 50px;margin-right: 20px;font-size: small">
  363. 收取定金:{{ OrderForm.deposit_price.toFixed(2) }} &nbsp;&nbsp;
  364. </div>
  365. </el-table>
  366. </div> -->
  367. <div class="footer">
  368. <!-- <el-button type="primary" @click="submit" v-if="!isDetail && type == 'pone'"
  369. :loading="formLoading">确认</el-button>
  370. <el-button type="primary" @click="submitOrderForm" v-if="!isDetail && type !== 'pone'"
  371. :loading="formLoading">保存</el-button> -->
  372. <el-button type="primary" @click="saveSubmitOrderForm" v-if="!isDetail && type !== 'pone'"
  373. :loading="formLoading">确认</el-button>
  374. <el-button @click="printIng" :disabled="false" v-if="isDetail">打印</el-button>
  375. <!-- <el-button type="primary" :disabled="false" @click="handleAudit(true)" v-if="isDetail && checkPermission(['order:audit']) && OrderForm.allowable.audit">审核通过</el-button>
  376. <el-button type="danger" :disabled="false" @click="handleAudit(false)" v-if="isDetail && checkPermission(['order:audit']) && OrderForm.allowable.audit">审核驳回</el-button> -->
  377. <el-button @click="roBack()" :disabled="false">返回</el-button>
  378. </div>
  379. </el-form>
  380. <el-dialog title="添加客户信息" :visible.sync="customer.dialogVisible" width="1100px" @open="handleDialogOpen"
  381. :modal-append-to-body="false" :close-on-click-modal="false" :close-on-press-escape="false">
  382. <el-form :model="customer.supplierForm" :rules="customer.supplierRules" ref="supplierForm" label-width="120px"
  383. inline>
  384. <el-form-item label="公司名称" prop="name">
  385. <el-input v-model="customer.supplierForm.name" :minlength="2" :maxlength="20" clearable
  386. placeholder="请输入公司名称"></el-input>
  387. </el-form-item>
  388. <el-form-item label="客户联系人" prop="contact ">
  389. <el-input v-model="customer.supplierForm.contact" :minlength="2" :maxlength="20" clearable
  390. placeholder="请输入客户联系人"></el-input>
  391. </el-form-item>
  392. <el-form-item label="性别" prop="gender">
  393. <el-radio v-model="customer.supplierForm.gender" label="男">男</el-radio>
  394. <el-radio v-model="customer.supplierForm.gender" label="女">女</el-radio>
  395. </el-form-item>
  396. <el-form-item label="手机号码" prop="mobile">
  397. <el-input v-model="customer.supplierForm.mobile" :minlength="2" :maxlength="20" clearable
  398. placeholder="请输入手机号码"></el-input>
  399. </el-form-item>
  400. <el-form-item label="邮件" prop="email">
  401. <el-input v-model="customer.supplierForm.email" :minlength="2" :maxlength="20" clearable
  402. placeholder="请输入电子邮件"></el-input>
  403. </el-form-item>
  404. <el-form-item label="客户类别" prop="type">
  405. <el-select v-model="customer.supplierForm.type" placeholder="请选择客户类别">
  406. <el-option v-for="item in customer.options" :key="item.value" :label="item.label" :value="item.value">
  407. </el-option>
  408. </el-select>
  409. </el-form-item>
  410. <!-- <el-form-item label="状态" prop="status">
  411. <el-input v-model="customer.supplierForm.status" :minlength="2" :maxlength="20" clearable
  412. placeholder="请输入客户状态"></el-input>
  413. </el-form-item> -->
  414. </el-form>
  415. <span slot="footer" class="dialog-footer">
  416. <el-button @click="customer.dialogVisible = false">取 消</el-button>
  417. <el-button type="primary" @click="submitSupplierForm">确 定</el-button>
  418. </span>
  419. </el-dialog>
  420. <el-dialog title="商品列表" :visible.sync="goodsVisible" width="1000px" @close="closeGoosData">
  421. <el-table ref="table" :data="goodsData.records" border style="width: 100%" @selection-change="handleSelChange">
  422. <el-table-column type="selection" width="55" />
  423. <el-table-column prop="name" label="分组名称"> </el-table-column>
  424. <el-table-column prop="remark" label="描述"> </el-table-column>
  425. </el-table>
  426. <el-pagination @size-change="handlePageSizeChange" @current-change="handlePageCurrentChange"
  427. :current-page="goodsData.page" :page-sizes="[10, 20, 50, 100]" :page-size="goodsData.size"
  428. layout="total, sizes, prev, pager, next, jumper" :total="goodsData.total"></el-pagination>
  429. <span slot="footer" class="dialog-footer">
  430. <el-button @click="closeGoosData">取 消</el-button>
  431. <el-button type="primary" @click="submitGoosData()">确 定</el-button>
  432. </span>
  433. </el-dialog>
  434. <el-dialog title="明细列表" :visible.sync="reimListVisible">
  435. <el-table ref="table" :data="OrderForm.order_customer_fees" border style="width: 100%">
  436. <!-- <el-table-column type="selection" width="55" /> -->
  437. <el-table-column prop="money" label="金额"> </el-table-column>
  438. <el-table-column prop="file_url" label="图片">
  439. <template slot-scope="scope">
  440. <img :src="scope.row.file_url" alt="" @click="showImage(scope.row.file_url)" style="width: 60px;height: 60px">
  441. </template>
  442. </el-table-column>
  443. <el-table-column label="操作">
  444. <template slot-scope="scope">
  445. <el-button size="mini" @click="editReim(scope.row)">修改</el-button>
  446. </template>
  447. </el-table-column>
  448. </el-table>
  449. <!-- <el-pagination @size-change="handlePageSizeChange" @current-change="handlePageCurrentChange"
  450. :current-page="goodsData.page" :page-sizes="[10, 20, 50, 100]" :page-size="goodsData.size"
  451. layout="total, sizes, prev, pager, next, jumper" :total="goodsData.total"></el-pagination> -->
  452. <!-- <span slot="footer" class="dialog-footer">
  453. <el-button @click="closeGoosData">取 消</el-button>
  454. <el-button type="primary" @click="submitGoosData()">确 定</el-button>
  455. </span> -->
  456. </el-dialog>
  457. <el-dialog title="交通费信息" :visible.sync="reimburVisible" :modal-append-to-body="false" :close-on-click-modal="false"
  458. :close-on-press-escape="false">
  459. <el-form :model="reimburForm" ref="reimburForm" label-width="120px" inline>
  460. <el-row>
  461. <el-col :span="12">
  462. <el-form-item label="金额:" prop="money ">
  463. <el-input v-model="reimburForm.money" :minlength="2" :maxlength="20" clearable
  464. placeholder="请输入报销金额"></el-input>
  465. </el-form-item>
  466. </el-col>
  467. <el-col>
  468. <el-form-item label="报销凭证:" prop="gender">
  469. <el-upload class="avatar-uploader" :action="MixinUploadApi" :show-file-list="false"
  470. :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
  471. <img v-if="reimburForm.file_url" :src="reimburForm.file_url" class="avatar">
  472. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  473. </el-upload>
  474. </el-form-item>
  475. </el-col>
  476. </el-row>
  477. </el-form>
  478. <span slot="footer" class="dialog-footer">
  479. <el-button @click="reimburVisible = false">取 消</el-button>
  480. <el-button type="primary" @click="addReimburForm">确 定</el-button>
  481. </span>
  482. </el-dialog>
  483. <el-dialog :visible.sync="imgDialogVisible" width="50%">
  484. <img :src="currentImage" alt="" style="width: 100%">
  485. </el-dialog>
  486. </div>
  487. </template>
  488. <script>
  489. import { mapGetters } from "vuex";
  490. import * as API_Order from "@/api/order";
  491. import * as API_BasicSetting from "@/api/basicSetting";
  492. import * as API_Member from "@/api/member";
  493. import * as API_Setting from "@/api/setting";
  494. import * as API_CollectingAccount from "@/api/collectingAccount";
  495. import * as API_productClass from "@/api/productClass.js"
  496. import { RegExp } from "~/ui-utils";
  497. import * as API_GoodsLend from '@/api/goodsLend'
  498. import {
  499. provinceAndCityData,
  500. pcTextArr,
  501. regionData,
  502. pcaTextArr,
  503. codeToText,
  504. } from "element-china-area-data";
  505. import Print from "print-js";
  506. import html2canvas from "html2canvas";
  507. import customAreaData from '@/customAreaData';
  508. const initOrderForm = {
  509. product_list: [],
  510. payment_list: [],
  511. tax_price: 0,
  512. total_price: 0,
  513. discount_price: 0,
  514. pay_price: 0,
  515. deposit_price: 0,
  516. send_type: "INTRA_CITY_SERVICE",
  517. subtract_stock: false,
  518. payment_status: "NOT_PAY",
  519. start_time: null,
  520. real_price: 0
  521. };
  522. export default {
  523. name: "orderAdd",
  524. data() {
  525. return {
  526. brcode: false,
  527. options: customAreaData,
  528. selectedOptions: [],
  529. warehouseList: [], // 仓库列表
  530. memberList: [], // 会员列表
  531. marketingList: [], // 销售经理列表
  532. storeList: [], // 门店列表
  533. collectingAccountList: [], // 支付方式列表
  534. fileList: [],
  535. deliveryTypeList: [
  536. /* {
  537. code: "express",
  538. name: "快递配送",
  539. },
  540. {
  541. code: "self_pick",
  542. name: "门店自提",
  543. }, */
  544. ],
  545. id: "",
  546. /** 订单表单*/
  547. OrderForm: {
  548. //省市区地址
  549. province_city_area: "",
  550. //详细信息
  551. address: "",
  552. real_price: '',
  553. province_city_area_address: "",
  554. subtract_stock: false,
  555. warehouse_id: [],
  556. return_warehouse_id: '',
  557. start_time: null,
  558. customer_name: "",
  559. customer_phone: '',
  560. marketing_id: ''
  561. },
  562. formLoading: false,
  563. isDetail: undefined,
  564. multipleSelection: [], // 勾选的商品
  565. batchUpdateNum: 0, // 批量设置的数量
  566. showUpdateNum: false, // 是否显示数量设置
  567. batchDiscountType: 0, // 批量设置的类型 0按比例 1按金额
  568. batchDiscountPrice: 0, // 批量设置的优惠比例或金额
  569. showDiscountPrice: false, // 是否显示优惠金额设置
  570. batchTaxRate: 0, // 批量设置的税率
  571. showTaxRate: false, // 是否显示税率设置
  572. rules: {
  573. customer_name: [this.MixinRequired("请输入客户名称", "blur")],
  574. type: [this.MixinRequired("请选择订单类型", "change")],
  575. pay_type: [this.MixinRequired("请选择付款方式", "change")],
  576. pay_price: [this.MixinRequired("请输入付款金额", "blur")],
  577. marketing_id: [this.MixinRequired("请选择销售人员", "change")],
  578. send_type: [this.MixinRequired("请选择配送方式", "change")],
  579. warehouse_id: [this.MixinRequired("请选择仓库", "change")],
  580. return_warehouse_id: [this.MixinRequired("请选择返回仓库", "change")],
  581. order_time: [this.MixinRequired("下单时间不能为空", "change")],
  582. payment_status: [this.MixinRequired("支付状态不能为空", "change")],
  583. payment_time: [this.MixinRequired("支付时间不能为空", "change")],
  584. real_price: [this.MixinRequired("请输入实付金额", "blur")],
  585. // delivery_type: [this.MixinRequired("请选择配送方式", "change")],
  586. product_list: {
  587. num: [
  588. this.MixinRequired("数量不能为空", "change"),
  589. {
  590. validator: (rule, value, callback) => {
  591. if (value && !RegExp.integer.test(value)) {
  592. callback(new Error("请输入正整数"));
  593. } else {
  594. callback();
  595. }
  596. },
  597. },
  598. ],
  599. tax_rate: [
  600. this.MixinRequired("税率不能为空", "change"),
  601. {
  602. validator: (rule, value, callback) => {
  603. if (value && !RegExp.money.test(value)) {
  604. callback(new Error("请输入正确的税率"));
  605. } else {
  606. callback();
  607. }
  608. },
  609. trigger: "blur",
  610. },
  611. ],
  612. price: [
  613. this.MixinRequired("单价不能为空", "change"),
  614. {
  615. validator: (rule, value, callback) => {
  616. if (value && !RegExp.money.test(value)) {
  617. callback(new Error("请输入正确的价格"));
  618. } else {
  619. callback();
  620. }
  621. },
  622. trigger: "blur",
  623. },
  624. ],
  625. discount_price: [
  626. this.MixinRequired("优惠金额不能为空", "change"),
  627. {
  628. validator: (rule, value, callback) => {
  629. if (value && !RegExp.money.test(value)) {
  630. callback(new Error("请输入正确的金额"));
  631. } else {
  632. callback();
  633. }
  634. },
  635. trigger: "blur",
  636. },
  637. ],
  638. },
  639. payment_list: {
  640. collecting_account_id: [
  641. this.MixinRequired("请选择支付方式", "change"),
  642. ],
  643. price: [
  644. this.MixinRequired("支付金额不能为空", "change"),
  645. {
  646. validator: (rule, value, callback) => {
  647. if (value && !RegExp.money.test(value)) {
  648. callback(new Error("请输入正确的金额"));
  649. } else {
  650. callback();
  651. }
  652. },
  653. trigger: "blur",
  654. },
  655. {
  656. validator: (rule, value, callback) => {
  657. if (value && value * 1 <= 0) {
  658. callback(new Error("支付金额必须大于0"));
  659. } else {
  660. callback();
  661. }
  662. },
  663. trigger: "blur",
  664. },
  665. ],
  666. },
  667. customer_phone: [
  668. this.MixinRequired("请输入手机号码!"),
  669. {
  670. validator: (rule, value, callback) => {
  671. if (!RegExp.mobile.test(value)) {
  672. callback(new Error("手机号码格式有误!"));
  673. } else {
  674. callback();
  675. }
  676. },
  677. trigger: ["change", "blur"],
  678. },
  679. ],
  680. },
  681. deptList: [],
  682. // 客户列表
  683. customerList: [],
  684. //
  685. orderTypeList: [],
  686. // 条形码
  687. barcodeValue: "",
  688. time: [],
  689. //新增客户
  690. customer: {
  691. dialogVisible: false,
  692. supplierRules: {
  693. custom_sn: [
  694. this.MixinRequired("请输入客户编号!"),
  695. { min: 2, max: 20, message: "长度在 2 到 20 个字符" },
  696. {
  697. validator: (rule, value, callback) => {
  698. if (value && !RegExp.userName.test(value)) {
  699. callback(
  700. new Error("只支持汉字、字母、数字、“-”、“_”的组合!")
  701. );
  702. } else {
  703. callback();
  704. }
  705. },
  706. },
  707. ],
  708. postal_address: [this.MixinRequired("请输入通讯地址!")],
  709. telephone: [
  710. this.MixinRequired("请输入联系电话!"),
  711. {
  712. validator: (rule, value, callback) => {
  713. if (!RegExp.mobile.test(value)) {
  714. callback(new Error("联系电话格式有误!"));
  715. } else {
  716. callback();
  717. }
  718. },
  719. trigger: ["change", "blur"],
  720. },
  721. ],
  722. name: [this.MixinRequired("请输入联系人!")],
  723. mobile: [
  724. this.MixinRequired("请输入手机号码!"),
  725. {
  726. validator: (rule, value, callback) => {
  727. if (!RegExp.mobile.test(value)) {
  728. callback(new Error("手机号码格式有误!"));
  729. } else {
  730. callback();
  731. }
  732. },
  733. trigger: ["change", "blur"],
  734. },
  735. ],
  736. gender: [
  737. { required: true, message: "请选择性别", trigger: "change" },
  738. ],
  739. type: [
  740. { required: true, message: "请选择客户类别", trigger: "change" },
  741. ],
  742. contact: [
  743. { required: true, message: "请输入客户联系人", trigger: "blur" },
  744. ],
  745. },
  746. supplierForm: {},
  747. options: [],
  748. },
  749. //折扣
  750. discount: 0,
  751. pickerOptions: {
  752. disabledDate(v) {
  753. return v.getTime() < new Date().getTime() - 86400000;// - 86400000是否包括当天
  754. }
  755. },
  756. pickerOptionsEnd: {
  757. disabledDate(time) {
  758. // 禁用所有在 start_time 之前的时间
  759. return time.getTime() < new Date().getTime();
  760. }
  761. },
  762. type: '',
  763. goodsData: [],
  764. goodsVisible: false,
  765. goodsList: [],//暂存勾选的分类
  766. params: {
  767. pages: 1,
  768. size: 10
  769. },//商品分页
  770. orderType: '',//条形码查看类型
  771. monthDiff: 0,
  772. channList: [],//渠道列表
  773. totalAmount: 0,//总计金额
  774. reimListVisible: false,
  775. reimburVisible: false,
  776. reimburForm: {
  777. order_id: '',
  778. money: "",
  779. file_url: ''
  780. },
  781. TO_Cmoney: 0,//交通费汇总
  782. /* 查看大图 */
  783. imgDialogVisible: false,
  784. currentImage: ''
  785. };
  786. },
  787. computed: {
  788. ...mapGetters(["user"])
  789. },
  790. mounted() {
  791. this.type = this.$route.params.type
  792. this.orderType = this.$route.params.type
  793. this.GET_WarehouseList();
  794. this.GET_MemberList();
  795. this.GET_MarketingList();
  796. this.GET_StoreList();
  797. this.GET_CollectingAccountList();
  798. // 获取客户列表
  799. this.GET_CustomerList();
  800. this.OrderForm.marketing_id = JSON.parse(JSON.parse(localStorage.getItem("admin_user")).data).uid
  801. },
  802. methods: {
  803. /* 查看大图 */
  804. showImage(url) {
  805. this.currentImage = url;
  806. this.imgDialogVisible = true;
  807. },
  808. //提交报销单
  809. addReimburForm() {
  810. API_Order.editOrderCustomerFee(this.reimburForm, this.reimburForm.id).then(res => {
  811. this.$message.success('修改成功!')
  812. this.reimburVisible = false
  813. this.GET_OrderDetail();
  814. })
  815. },
  816. handleAvatarSuccess(res, file) {
  817. this.reimburForm.file_url = file.response.url
  818. // this.reimburForm.file_url = URL.createObjectURL(file.raw);
  819. },
  820. beforeAvatarUpload(file) {
  821. const isLt2M = file.size / 1024 / 1024 < 2;
  822. /* if (!isJPG) {isJPG && const isJPG = file.type === 'image/jpeg';
  823. this.$message.error('上传头像图片只能是 JPG 格式!');
  824. } */
  825. if (!isLt2M) {
  826. this.$message.error('上传头像图片大小不能超过 2MB!');
  827. }
  828. return isLt2M;
  829. },
  830. /* 修改 */
  831. editReim(row) {
  832. this.reimburForm.file_url = ''
  833. this.reimburForm = row
  834. this.reimburVisible = true
  835. },
  836. /* 交通费明细 */
  837. reimList() {
  838. this.reimListVisible = true
  839. },
  840. cleanUrl(url) {
  841. // 检查URL是否以.png结尾
  842. if (url.endsWith('.png')) {
  843. // 找到.png后第一个下划线的位置
  844. const index = url.indexOf('.png') + 4;
  845. // 返回从开始到.png后的字符串
  846. return url.substring(0, index);
  847. }
  848. // 如果不是.png,可以选择去除最后一个下划线后的部分
  849. // 这部分根据实际情况调整,这里假设总是去除最后一个下划线后的内容
  850. const lastIndex = url.lastIndexOf('_');
  851. if (lastIndex !== -1) {
  852. return url.substring(0, lastIndex);
  853. }
  854. // 如果没有下划线,返回原URL
  855. return url;
  856. },
  857. // 租赁时间
  858. timeChange(val) {
  859. let start = new Date(val[1]); // 将起始日期字符串转换为Date对象
  860. let end = new Date(val[0]); // 将结束日期字符串转换为Date对象
  861. let timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
  862. this.monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)) + 1;
  863. this.OrderForm.product_list.map(el => {
  864. el.day_num = this.monthDiff
  865. })
  866. },
  867. selMember(val) {
  868. API_BasicSetting.getCustomer(val).then(res => {
  869. this.$set(this.OrderForm, 'customer_name', res.name);
  870. this.$set(this.OrderForm, 'customer_phone', res.mobile);
  871. /* this.$nextTick(() => { this.OrderForm.customer_name = res.name
  872. this.OrderForm.customer_phone = res.mobile
  873. }) */
  874. })
  875. },
  876. //选择商品
  877. handleSelChange(val) {
  878. if (val.length > 1) {
  879. // 如果当前选中数量超过1,移除先前选中的,保留最后选中的
  880. const lastSelected = val[val.length - 1];
  881. this.$refs.table.clearSelection(); // 清除所有选中
  882. this.$refs.table.toggleRowSelection(lastSelected, true); // 重新选中最后一个
  883. }
  884. this.goodsList = val // 更新当前选中的行
  885. },
  886. // 保存已选商品
  887. submitGoosData() {
  888. if (this.goodsList.length >= 1) {
  889. API_productClass.getProductByGroup(this.OrderForm.warehouse_id, this.goodsList[0].id).then(res => {
  890. res.map(el => {
  891. if (this.OrderForm.type == 'TO_C') {
  892. el.day_num = this.monthDiff
  893. }
  894. this.OrderForm.product_list.push(el)
  895. })
  896. this.goodsVisible = false;
  897. })
  898. } else {
  899. this.$message.error("请选择商品信息");
  900. }
  901. },
  902. // 关闭商品明细
  903. closeGoosData() {
  904. this.goodsVisible = false;
  905. },
  906. handleBlur() {
  907. const value = this.discount;
  908. const regex = /^(10|([1-9](\.\d{0,1})?))$/;
  909. if (!regex.test(value)) {
  910. this.discount = ''; // 清空不符合条件的输入
  911. }
  912. },
  913. /* //折扣正则
  914. handleInput(event) {
  915. // 使用正则表达式来检查输入是否为1到10的整数或最多两位小数
  916. const value = event.target.value;
  917. const regex = /^(10|([1-9](\.\d{0,1})?))$/;
  918. if (regex.test(value) || value === '') {
  919. this.discount = value;
  920. } else {
  921. event.target.value = this.discount;
  922. }
  923. }, */
  924. // 打印功能
  925. printIng() {
  926. // Print({
  927. // printable: 'deliverySheet',
  928. // type: 'html',
  929. // targetStyles: ['*'],
  930. // ignoreElements: ['no-logs', 'goods-image', 'no-btn']
  931. // })
  932. const printContent = this.$refs.printId;
  933. // 获取dom 宽度 高度
  934. const width = printContent.clientWidth;
  935. const height = printContent.clientHeight;
  936. // 创建一个canvas节点
  937. const canvas = document.createElement("canvas");
  938. const scale = 1; // 定义任意放大倍数,支持小数;越大,图片清晰度越高,生成图片越慢。
  939. canvas.width = width * scale; // 定义canvas 宽度 * 缩放
  940. canvas.height = height * scale; // 定义canvas高度 *缩放
  941. canvas.style.width = width * scale + "px";
  942. canvas.style.height = height * scale + "px";
  943. canvas.getContext("2d").scale(scale, scale); // 获取context,设置scale
  944. const scrollTop =
  945. document.documentElement.scrollTop || document.body.scrollTop; // 获取滚动轴滚动的长度
  946. const scrollLeft =
  947. document.documentElement.scrollLeft || document.body.scrollLeft; // 获取水平滚动轴的长度
  948. html2canvas(printContent, {
  949. canvas,
  950. backgroundColor: null,
  951. useCORS: true,
  952. windowHeight: document.body.scrollHeight,
  953. scrollX: -scrollLeft, // 解决水平偏移问题,防止打印的内容不全
  954. scrollY: -scrollTop,
  955. })
  956. .then((canvas) => {
  957. const url = canvas.toDataURL("image/png");
  958. printJS({
  959. printable: url,
  960. type: "image",
  961. documentTitle: "", // 标题
  962. style: "@page{size:auto;margin: 0cm 1cm 0cm 1cm;}", // 去除页眉页脚
  963. });
  964. })
  965. .catch((err) => {
  966. console.error(err);
  967. });
  968. },
  969. /* validateNumber(){
  970. const regex = '/^(?:[0-9]|10(?:\.0{1,2})?)$/';
  971. return regex.test(this.discount)
  972. }, */
  973. //获取仓库名称
  974. warehouseName(val) {
  975. let name = ''
  976. this.warehouseList.map(el => {
  977. if (el.id == val) {
  978. return name = el.name
  979. }
  980. })
  981. return name
  982. },
  983. /** dialog打开后重置form表单校验结果 */
  984. handleDialogOpen() {
  985. setTimeout(() => {
  986. this.$refs["supplierForm"].clearValidate();
  987. });
  988. this.customer.supplierForm = {};
  989. },
  990. submitSupplierForm() {
  991. this.$refs["supplierForm"].validate((valid) => {
  992. if (valid) {
  993. const { id } = this.customer.supplierForm;
  994. const params = this.MixinClone(this.customer.supplierForm);
  995. API_BasicSetting.addCustomer(params).then(() => {
  996. this.customer.dialogVisible = false;
  997. this.$message.success("添加成功!");
  998. this.GET_CustomerList();
  999. });
  1000. } else {
  1001. this.$message.error("表单填写有误,请核对!");
  1002. return false;
  1003. }
  1004. });
  1005. },
  1006. // 添加客户
  1007. addCust() {
  1008. this.customer.dialogVisible = true;
  1009. },
  1010. handleChange(value) {
  1011. /* const city = value[value.length - 2]; // 获取当前市的代码
  1012. const cityName = codeToText[city]; // 根据代码获取市的名称
  1013. const loc = value.map((code) => codeToText[code]).join(","); // 拼接地址字符串
  1014. this.OrderForm.province_city_area_address = loc.replace("市辖区", cityName); // 更新地址字段,替换市辖区为市名称*/
  1015. this.OrderForm.province_city_area = value.join(",");
  1016. //打印区域码所对应的属性值即中文地址
  1017. },
  1018. /** 初始化 */
  1019. init() {
  1020. const { id } = this.$route.params;
  1021. if (id) {
  1022. this.id = id;
  1023. this.GET_OrderDetail();
  1024. } else {
  1025. this.OrderForm = this.MixinClone(initOrderForm);
  1026. this.$set(this.OrderForm, "order_time", new Date().getTime());
  1027. this.$nextTick(() => {
  1028. this.$refs.orderFormRef.clearValidate();
  1029. });
  1030. }
  1031. this.isDetail = this.$route.name === "orderDetail";
  1032. },
  1033. /** 清除已选商品明细 */
  1034. cleanGoodsList() {
  1035. // 切换仓库需要清除已选对应仓库下的商品数据
  1036. this.$set(this.OrderForm, "product_list", []);
  1037. },
  1038. //获取客户列表
  1039. GET_CustomerList() {
  1040. API_BasicSetting.customer(this.params)
  1041. .then((response) => {
  1042. this.customerList = response.data;
  1043. })
  1044. .catch(() => { });
  1045. API_Setting.getPage({ dictType: "order_type" }).then((res) => {
  1046. this.orderTypeList = res.data;
  1047. });
  1048. API_Setting.getPage({ dictType: "order_send_type" }).then((res) => {
  1049. this.deliveryTypeList = res.data;
  1050. });
  1051. },
  1052. /** 获取会员列表 */
  1053. GET_MemberList() {
  1054. API_Member.getMemberList({
  1055. page_no: 1,
  1056. page_size: -1,
  1057. disable_flag: false,
  1058. }).then((response) => {
  1059. this.memberList = response.data;
  1060. });
  1061. },
  1062. /** 获取销售经理列表 */
  1063. GET_MarketingList() {
  1064. /* API_BasicSetting.getMarketingManagerList({
  1065. page_no: 1,
  1066. page_size: -1,
  1067. disable_flag: 0,
  1068. }).then((response) => {
  1069. this.marketingList = response.data;
  1070. }); */
  1071. API_BasicSetting.getUserByDept().then((res) => {
  1072. this.marketingList = res;
  1073. });
  1074. //渠道
  1075. API_GoodsLend.channel(this.params).then(response => {
  1076. this.channList = response.data
  1077. }).catch(() => { })
  1078. },
  1079. /** 获取自提门店列表 */
  1080. GET_StoreList() {
  1081. API_BasicSetting.getBranches({
  1082. page_no: 1,
  1083. page_size: -1,
  1084. }).then((response) => {
  1085. this.storeList = response.data;
  1086. });
  1087. },
  1088. /** 获取支付方式列表 */
  1089. GET_CollectingAccountList() {
  1090. API_CollectingAccount.getList({
  1091. page_no: 1,
  1092. page_size: -1,
  1093. enable_flag: true,
  1094. }).then((response) => {
  1095. this.collectingAccountList = response.data;
  1096. });
  1097. },
  1098. roBack() {
  1099. const { callback } = this.$route.params;
  1100. if (typeof callback === "function") callback();
  1101. this.$store.dispatch("delCurrentViews", {
  1102. view: this.$route,
  1103. $router: this.$router,
  1104. });
  1105. this.$router.push({ name: "order" });
  1106. },
  1107. // 选择批次商品
  1108. async handleSelectGoods() {
  1109. if (!this.OrderForm.type) {
  1110. this.$message.error("请选择订单类型!");
  1111. return
  1112. }
  1113. if (this.OrderForm.warehouse_id.length == 0) {
  1114. this.$message.error("请选择仓库!");
  1115. return;
  1116. }
  1117. let warehouse_ids = this.OrderForm.warehouse_id.join(',')
  1118. const goodsData = await this.$EnPickerGoods({
  1119. goodsApi: `/admin/erp/warehouseOut/getGoodByWarehouse/warehouseIdAndOrderType/${this.OrderForm.type}/${warehouse_ids}`,
  1120. // goodsApi: `/admin/erp/warehouseOut/getGoodByWarehouse/warehouseIdAndOrderType`,
  1121. selectedIds: this.OrderForm.product_list.map((item) => item.product_id),
  1122. //goodsApiParams: { order_type: this.OrderForm.type,warehouse_ids:arr },
  1123. });
  1124. goodsData.map(el => {
  1125. el.day_num = this.monthDiff
  1126. console.log(el);
  1127. })
  1128. this.OrderForm.product_list = goodsData;
  1129. },
  1130. /** 分页大小发生改变 */
  1131. handlePageSizeChange(size) {
  1132. this.params.size = size;
  1133. API_productClass.getProductList(this.params).then(res => {
  1134. this.goodsData = res
  1135. this.goodsVisible = true
  1136. })
  1137. },
  1138. /** 分页页数发生改变 */
  1139. handlePageCurrentChange(page) {
  1140. this.params.page = page;
  1141. API_productClass.getProductList(this.params).then(res => {
  1142. this.goodsData = res
  1143. this.goodsVisible = true
  1144. })
  1145. },
  1146. /* 选择分组商品 */
  1147. handleSelectGrou() {
  1148. if (!this.OrderForm.type) {
  1149. this.$message.error("请选择订单类型!");
  1150. return
  1151. }
  1152. if (this.OrderForm.warehouse_id.length == 0) {
  1153. this.$message.error("请选择仓库!");
  1154. return;
  1155. }
  1156. this.params.order_choose_type = this.OrderForm.type
  1157. API_productClass.getProductList(this.params).then(res => {
  1158. this.goodsData = res
  1159. this.goodsVisible = true
  1160. })
  1161. },
  1162. /** 添加支付方式 */
  1163. handleInsertPayment() {
  1164. const defaultCollectingAccount = this.collectingAccountList.findLast(
  1165. (item) => item.default_flag === true
  1166. );
  1167. /* this.OrderForm.payment_list.push({
  1168. collecting_account_id: defaultCollectingAccount
  1169. ? defaultCollectingAccount.id
  1170. : null,
  1171. }); */
  1172. },
  1173. /** table单选框事件 */
  1174. handleSelectionChange(val) {
  1175. this.multipleSelection = val;
  1176. },
  1177. /** 显示数量设置 */
  1178. handleShowUpdateNum() {
  1179. if (this.multipleSelection.length === 0) {
  1180. this.$message.error("请先勾选商品");
  1181. return;
  1182. }
  1183. this.showUpdateNum = true;
  1184. this.batchUpdateNum = 1;
  1185. this.$nextTick(() => {
  1186. this.$refs.batchSetNumRef.focus();
  1187. });
  1188. },
  1189. /** 取消数量设置 */
  1190. handleCancelUpdateNum() {
  1191. this.showUpdateNum = false;
  1192. },
  1193. /** 确认设置数量 */
  1194. handleConfirmUpdateNum() {
  1195. this.showUpdateNum = false;
  1196. for (let i = 0; i < this.multipleSelection.length; i++) {
  1197. this.multipleSelection[i].num = this.batchUpdateNum;
  1198. }
  1199. },
  1200. /** 显示优惠金额设置 */
  1201. handleShowUpdateDiscountPrice() {
  1202. if (this.multipleSelection.length === 0) {
  1203. this.$message.error("请先勾选商品");
  1204. return;
  1205. }
  1206. this.showDiscountPrice = true;
  1207. this.batchDiscountPrice = 0;
  1208. this.$nextTick(() => {
  1209. this.$refs.batchSetDiscountRef.focus();
  1210. });
  1211. },
  1212. /** 取消优惠金额设置 */
  1213. handleCancelUpdateDiscountPrice() {
  1214. this.showDiscountPrice = false;
  1215. },
  1216. /** 确认设置优惠金额 */
  1217. handleConfirmUpdateDiscountPrice() {
  1218. this.showDiscountPrice = false;
  1219. for (let i = 0; i < this.multipleSelection.length; i++) {
  1220. const item = this.multipleSelection[i];
  1221. if (this.batchDiscountType === 0) {
  1222. // 按比例
  1223. item.discount_price =
  1224. item.total_price * this.batchDiscountPrice * 0.01;
  1225. } else {
  1226. // 按金额
  1227. item.discount_price = this.batchDiscountPrice;
  1228. }
  1229. }
  1230. },
  1231. /** 显示税率设置 */
  1232. handleShowUpdateTaxRate() {
  1233. if (this.multipleSelection.length === 0) {
  1234. this.$message.error("请先勾选商品");
  1235. return;
  1236. }
  1237. this.showTaxRate = true;
  1238. this.batchTaxRate = 0;
  1239. this.$nextTick(() => {
  1240. this.$refs.batchSetTaxRateRef.focus();
  1241. });
  1242. },
  1243. /** 取消税率设置 */
  1244. handleCancelUpdateTaxRate() {
  1245. this.showTaxRate = false;
  1246. },
  1247. /** 确认设置税率 */
  1248. handleConfirmUpdateTaxRate() {
  1249. this.showTaxRate = false;
  1250. if (this.batchTaxRate != null) {
  1251. for (let i = 0; i < this.multipleSelection.length; i++) {
  1252. this.multipleSelection[i].tax_rate = this.batchTaxRate;
  1253. }
  1254. }
  1255. },
  1256. //保存订单
  1257. async submitOrderForm() {
  1258. // 校验商品明细数据
  1259. const valid = await this.$refs.orderFormRef
  1260. .validate()
  1261. .catch((err) => err);
  1262. if (valid !== true) {
  1263. this.$message.error("表单数据输入有误,请检查!");
  1264. return;
  1265. }
  1266. const { id } = this.OrderForm;
  1267. var loc = "";
  1268. for (let i = 0; i < this.selectedOptions.length; i++) {
  1269. loc += codeToText[this.selectedOptions[i]] + ",";
  1270. }
  1271. this.OrderForm.province_city_area_address = loc + this.OrderForm.address;
  1272. const params = this.MixinClone(this.OrderForm);
  1273. /* params.item_list = params.product_list;
  1274. params.product_list.map((el) => {
  1275. el.goods_id = el.id;
  1276. el.id = "";
  1277. });*/
  1278. delete this.OrderForm.start_time;
  1279. delete this.OrderForm.end_time;
  1280. if (this.time) {
  1281. this.OrderForm.start_time = this.time[0];
  1282. this.OrderForm.end_time = this.time[1];
  1283. }
  1284. delete this.time;
  1285. params.pay_price = this.price;
  1286. params.real_price = Number(params.real_price);
  1287. /* params.product_list.map((el) => {
  1288. return (el.product_id = el.id);
  1289. }); */
  1290. params.item_list = params.product_list;
  1291. params.order_time = Math.floor(params.order_time / 1000);
  1292. params.payment_time = Math.floor(params.payment_time / 1000);
  1293. this.formLoading = true;
  1294. if (id) {
  1295. API_Order.editOrder(id, params)
  1296. .then((response) => {
  1297. this.$message.success("修改成功!");
  1298. this.backOrderList();
  1299. })
  1300. .finally(() => {
  1301. this.formLoading = false;
  1302. });
  1303. } else {
  1304. params.product_list = params.product_list.map((el) => {
  1305. el.product_stock_id = el.id;
  1306. el.id = "";
  1307. return el;
  1308. });
  1309. API_Order.addOrder(params)
  1310. .then(() => {
  1311. this.$message.success("添加成功!");
  1312. this.backOrderList();
  1313. })
  1314. .finally(() => {
  1315. this.formLoading = false;
  1316. });
  1317. }
  1318. },
  1319. //确认并保存订单
  1320. async saveSubmitOrderForm() {
  1321. // 校验商品明细数据
  1322. const valid = await this.$refs.orderFormRef
  1323. .validate()
  1324. .catch((err) => err);
  1325. if (valid !== true) {
  1326. this.$message.error("表单数据输入有误,请检查!");
  1327. return;
  1328. }
  1329. const { id } = this.OrderForm;
  1330. //设置时间
  1331. delete this.OrderForm.start_time;
  1332. delete this.OrderForm.end_time;
  1333. if (this.time) {
  1334. this.OrderForm.start_time = this.time[0];
  1335. this.OrderForm.end_time = this.time[1];
  1336. }
  1337. delete this.time;
  1338. var loc = "";
  1339. for (let i = 0; i < this.selectedOptions.length; i++) {
  1340. loc += codeToText[this.selectedOptions[i]] + ",";
  1341. }
  1342. this.OrderForm.province_city_area_address = loc + this.OrderForm.address;
  1343. const params = this.MixinClone(this.OrderForm);
  1344. params.reduction = this.discount
  1345. params.pay_price = this.price;
  1346. params.real_price = Number(params.real_price);
  1347. params.item_list = params.product_list;
  1348. params.order_time = Math.floor(params.order_time / 1000);
  1349. params.payment_time = Math.floor(params.payment_time / 1000);
  1350. this.formLoading = true;
  1351. if (id) {
  1352. API_Order.editOrder(id, params)
  1353. .then((response) => {
  1354. this.$message.success("修改成功!");
  1355. API_Order.submit(id).then((res) => {
  1356. /* this.$message.success("订单已确认"); */
  1357. this.backOrderList();
  1358. });
  1359. })
  1360. .finally(() => {
  1361. this.formLoading = false;
  1362. });
  1363. } else {
  1364. params.product_list = params.product_list.map((el) => {
  1365. el.product_stock_id = el.id;
  1366. el.id = "";
  1367. return el;
  1368. });
  1369. API_Order.addOrder(params)
  1370. .then((res) => {
  1371. /* this.$message.success("添加成功!"); */
  1372. API_Order.submit(res).then((res) => {
  1373. this.$message.success("订单已确认!");
  1374. this.backOrderList();
  1375. });
  1376. })
  1377. .finally(() => {
  1378. this.formLoading = false;
  1379. });
  1380. }
  1381. },
  1382. //延期确定
  1383. async submit() {
  1384. // 校验商品明细数据
  1385. const valid = await this.$refs.orderFormRef
  1386. .validate()
  1387. .catch((err) => err);
  1388. if (valid !== true) {
  1389. this.$message.error("表单数据输入有误,请检查!");
  1390. return;
  1391. }
  1392. const { id } = this.OrderForm;
  1393. /* var loc = "";
  1394. for (let i = 0; i < this.selectedOptions.length; i++) {
  1395. loc += codeToText[this.selectedOptions[i]] + ",";
  1396. }
  1397. this.OrderForm.province_city_area_address = loc + this.OrderForm.address; */
  1398. const params = this.MixinClone(this.OrderForm);
  1399. /* params.pay_price = this.price;
  1400. params.real_price = Number(params.real_price); */
  1401. params.item_list = params.product_list;
  1402. this.formLoading = true;
  1403. API_Order.extension(id, params)
  1404. .then((response) => {
  1405. this.$message.success("调整成功!");
  1406. this.backOrderList();
  1407. })
  1408. .finally(() => {
  1409. this.formLoading = false;
  1410. });
  1411. },
  1412. /** 获取仓库 */
  1413. GET_WarehouseList() {
  1414. API_BasicSetting.getWarehouseListAll({}).then((response) => {
  1415. this.warehouseList = response;
  1416. });
  1417. API_Setting.getPage({ dictType: "customer_type" }).then((res) => {
  1418. this.customer.options = res.data;
  1419. });
  1420. },
  1421. /** 审核 */
  1422. async handleAudit(isPass, remark) {
  1423. // 二次确认
  1424. const text = isPass ? "审核通过" : "审核驳回";
  1425. await this.$confirm(`确认要${text}吗?`, "提示");
  1426. await API_Order.audit(
  1427. this.id,
  1428. isPass ? "WAIT_WAREHOUSE_OUT" : "AUDIT_REJECT",
  1429. remark
  1430. );
  1431. this.$message.success("审核成功!");
  1432. this.backOrderList();
  1433. },
  1434. /** 返回订单列表 */
  1435. backOrderList() {
  1436. const { callback } = this.$route.params;
  1437. if (typeof callback === "function") callback();
  1438. this.$store.dispatch("delCurrentViews", {
  1439. view: this.$route,
  1440. $router: this.$router,
  1441. });
  1442. this.$router.push({ name: "order" });
  1443. },
  1444. /** 获取订单详情 */
  1445. GET_OrderDetail() {
  1446. API_Order.getOrderDetail(this.id).then((response) => {
  1447. /**/ this.price = response.pay_price;
  1448. this.discount = response.reduction
  1449. this.barcodeValue = response.sn
  1450. response.product_list = response.item_list.map(el => {
  1451. el.good_vo = el.goods_vo
  1452. return el
  1453. });
  1454. if (response.type == "TO_C") {
  1455. let moneyToc = 0
  1456. response.order_customer_fees.map(el => {
  1457. moneyToc += el.money
  1458. })
  1459. this.TO_Cmoney = moneyToc
  1460. this.totalAmount = moneyToc + response.real_price
  1461. }
  1462. this.OrderForm = response;
  1463. /* this.fileList = response.attachment
  1464. ? [{ name: "附件", url: response.attachment }]
  1465. : [];
  1466. this.OrderForm.order_time = Math.floor(
  1467. this.OrderForm.order_time * 1000
  1468. );*/
  1469. if (response.type == "TO_C") {
  1470. this.time.push(response.start_time);
  1471. this.time.push(response.end_time);
  1472. }
  1473. this.selectedOptions = response.province_city_area.split(",");
  1474. /* if (this.OrderForm.payment_time) {
  1475. this.OrderForm.payment_time = Math.floor(
  1476. this.OrderForm.payment_time * 1000
  1477. );
  1478. } */
  1479. });
  1480. },
  1481. },
  1482. computed: {
  1483. price: {
  1484. get() {
  1485. let total = 0;
  1486. if (!this.OrderForm.product_list) return
  1487. if (!this.id) {
  1488. if (this.OrderForm.type == "TO_C") {
  1489. /* var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
  1490. this.OrderForm.product_list.map((item) => {
  1491. var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
  1492. var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
  1493. var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
  1494. total += item.product_vo.day_price * item.num * monthDiff;
  1495. }); */
  1496. var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
  1497. var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
  1498. var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
  1499. var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
  1500. this.OrderForm.product_list.map((item) => {
  1501. total += item.product_vo.day_price * item.num * item.day_num;
  1502. });
  1503. return total;
  1504. } else {
  1505. this.OrderForm.product_list.map((item) => {
  1506. total += item.product_vo.price * item.num;
  1507. });
  1508. return total;
  1509. }
  1510. } else {
  1511. if (this.OrderForm.type == "TO_C") {
  1512. var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
  1513. var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
  1514. var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
  1515. var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
  1516. this.OrderForm.product_list.map((item) => {
  1517. total += item.product_vo.day_price * item.num * item.day_num;
  1518. });
  1519. return total;
  1520. } else {
  1521. this.OrderForm.product_list.map((item) => {
  1522. total += item.product_vo.price * item.num;
  1523. });
  1524. return total;
  1525. }
  1526. }
  1527. },
  1528. set(newValue) {
  1529. this.OrderForm.real_price = newValue;
  1530. /* let total = 0;
  1531. if (!this.OrderForm.product_list) return
  1532. if (!this.id) {
  1533. if (this.OrderForm.type == "TO_C") {
  1534. var start = new Date(this.OrderForm.start_time); // 将起始日期字符串转换为Date对象
  1535. this.OrderForm.product_list.map((item) => {
  1536. var end = new Date(item.end_time); // 将结束日期字符串转换为Date对象
  1537. var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
  1538. var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
  1539. total += item.product_vo.day_price * item.num * monthDiff;
  1540. });
  1541. return total;
  1542. } else {
  1543. this.OrderForm.product_list.map((item) => {
  1544. total += item.product_vo.price * item.num;
  1545. });
  1546. return total;
  1547. }
  1548. } else {
  1549. if (this.OrderForm.type == "TO_C") {
  1550. var start = new Date(this.time[1]); // 将起始日期字符串转换为Date对象
  1551. var end = new Date(this.time[0]); // 将结束日期字符串转换为Date对象
  1552. var timeDiff = Math.abs(end.getTime() - start.getTime()); // 获取时间差(单位:毫秒)
  1553. var monthDiff = Math.ceil(timeDiff / (24 * 60 * 60 * 1000)); // 根据每个月平均天数进行近似计算
  1554. this.OrderForm.product_list.map((item) => {
  1555. total += item.product_vo.day_price * item.num * monthDiff;
  1556. });
  1557. return total;
  1558. } else {
  1559. this.OrderForm.product_list.map((item) => {
  1560. total += item.product_vo.price * item.num;
  1561. });
  1562. return total;
  1563. }
  1564. } */
  1565. }
  1566. },
  1567. },
  1568. watch: {
  1569. discount: {
  1570. deep: true,
  1571. handler(newVal) {
  1572. if (newVal) {
  1573. this.OrderForm.real_price = this.price * newVal / 10;
  1574. this.totalAmount = this.TO_Cmoney + this.OrderForm.real_price
  1575. } else {
  1576. this.OrderForm.real_price = this.OrderForm.real_price
  1577. }
  1578. },
  1579. },
  1580. price: {
  1581. deep: true,
  1582. handler(newVal) {
  1583. if (this.OrderForm.reduction) {
  1584. this.OrderForm.real_price = newVal * this.discount / 10;
  1585. this.totalAmount = this.TO_Cmoney + this.OrderForm.real_price
  1586. }
  1587. },
  1588. },
  1589. "OrderForm.product_list": {
  1590. deep: true,
  1591. handler(newVal) {
  1592. newVal.forEach((item) => {
  1593. /* item.sum=item.price*item.num
  1594. return */
  1595. });
  1596. /* this.OrderForm.total_price = newVal.reduce(
  1597. (sum, item) => sum + item.total_price,
  1598. 0
  1599. ); // 税额(总)
  1600. item.tax_price = item.total_price * item.tax_rate * 0.01;
  1601. // 合计
  1602. this.OrderForm.discount_price = newVal.reduce(
  1603. (sum, item) => sum + item.discount_price * 1,
  1604. 0
  1605. );
  1606. this.OrderForm.tax_price = newVal.reduce(
  1607. (sum, item) => sum + item.tax_price,
  1608. 0
  1609. ); */
  1610. },
  1611. },
  1612. /* "OrderForm.payment_list": {
  1613. deep: true,
  1614. handler(newVal) {
  1615. this.OrderForm.deposit_price = newVal.reduce(
  1616. (sum, item) => sum + item.price * 1,
  1617. 0
  1618. );
  1619. },
  1620. }, */
  1621. $route: {
  1622. immediate: true,
  1623. handler(newVal) {
  1624. if (
  1625. newVal.name === "orderAdd" ||
  1626. newVal.name === "orderEdit" ||
  1627. newVal.name === "orderDetail" ||
  1628. newVal.name === "extensionUpdate"
  1629. ) {
  1630. this.init();
  1631. }
  1632. },
  1633. },
  1634. "OrderForm.payment_status": {
  1635. handler(newVal) {
  1636. if (newVal === "PAY" && !this.OrderForm.payment_time) {
  1637. this.OrderForm.payment_time = new Date().getTime();
  1638. }
  1639. },
  1640. },
  1641. },
  1642. };
  1643. </script>
  1644. <style type="text/scss" lang="scss" scoped>
  1645. /** 底部步骤 */
  1646. .footer {
  1647. width: 95%;
  1648. padding: 10px;
  1649. bottom: 0px;
  1650. text-align: center;
  1651. z-index: 999;
  1652. }
  1653. .mx {
  1654. display: flex;
  1655. align-items: center;
  1656. .button {
  1657. margin-left: 10px;
  1658. }
  1659. }
  1660. .bg-in-stock {
  1661. background-color: #fff;
  1662. margin: 10px;
  1663. padding: 25px;
  1664. .numOrder {
  1665. display: flex;
  1666. justify-content: center;
  1667. }
  1668. }
  1669. /deep/ {
  1670. .el-input--suffix .el-input__inner {
  1671. padding-right: 10px;
  1672. }
  1673. .error-input {
  1674. .el-input__inner {
  1675. border: 1px solid red;
  1676. }
  1677. }
  1678. }
  1679. /deep/ .el-form-item {
  1680. // width: 350px;
  1681. }
  1682. /** 表格中输入框样式 */
  1683. .tableFormItem {
  1684. width: 100%;
  1685. margin-bottom: 0;
  1686. }
  1687. /** 输入框错误提示样式 */
  1688. /deep/ .el-form-item__error {
  1689. // position: relative;
  1690. }
  1691. /** date-picker宽度和其他输入框保持一致 */
  1692. /deep/ .el-date-editor {
  1693. .el-input__inner {
  1694. padding-inline-start: 15px;
  1695. }
  1696. .el-input__prefix {
  1697. display: none;
  1698. }
  1699. }
  1700. .redClass /deep/ .el-form-item__content {
  1701. //color: red !important;
  1702. font-weight: 700;
  1703. width: 500px !important;
  1704. }
  1705. /deep/ .el-form-item {
  1706. width: 100%;
  1707. height: auto;
  1708. .el-input {
  1709. width: 200px;
  1710. }
  1711. }
  1712. /deep/.avatar-uploader .el-upload {
  1713. border: 1px dashed #d9d9d9;
  1714. border-radius: 6px;
  1715. cursor: pointer;
  1716. position: relative;
  1717. overflow: hidden;
  1718. }
  1719. .avatar-uploader .el-upload:hover {
  1720. border-color: #409EFF;
  1721. }
  1722. .avatar-uploader-icon {
  1723. font-size: 28px;
  1724. color: #8c939d;
  1725. width: 178px;
  1726. height: 178px;
  1727. line-height: 178px;
  1728. text-align: center;
  1729. }
  1730. .avatar {
  1731. width: 178px;
  1732. height: 178px;
  1733. display: block;
  1734. }
  1735. </style>