auxiliarySalesOrderDetail.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. <template>
  2. <div class="s-page">
  3. <el-page-header @back="goBack" :content="title"></el-page-header>
  4. <el-divider></el-divider>
  5. <el-card class="box-card">
  6. <div slot="header" class="clearfix">
  7. <span>单据信息</span>
  8. </div>
  9. <div class="mymain-container">
  10. <el-form ref="formData" :rules="rules" :model="formData" label-width="110px" size="small" label-position="left">
  11. <el-row :gutter="20" justify="start">
  12. <el-col :span="8" v-if="id">
  13. <el-form-item label="单据状态">
  14. <el-input type="text" :value="formData.flag == 'SAVE'?'已保存':formData.flag == 'SUBMIT'?'已提交':formData.flag == 'CANCEL'?'取消订单':formData.flag == 'PAY_NOT_TAKE'?'已支付,未提货':formData.flag == 'PAY_TAKE'?'已支付,已提货':''" disabled></el-input>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :span="8" v-if="id">
  18. <el-form-item label="单据编号">
  19. <el-input type="text" :value="formData.salesId" disabled></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :span="8">
  23. <el-form-item label="所属商户" :required="true" >
  24. <el-input type="text" :value="companyName" disabled></el-input>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :span="8">
  28. <el-form-item label="网点名称" prop="websitId" :required="true">
  29. <el-select v-model="formData.websit" :disabled="formData.flag != 'SAVE' && formType!=0" value-key="websitId" @change="changeWebsit" placeholder="请选择" style="width: 100%;">
  30. <el-option
  31. v-for="item in websitList"
  32. :key="item.websitId"
  33. :label="item.name"
  34. :value="item">
  35. </el-option>
  36. </el-select>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="8">
  40. <el-form-item label="购买方" :required="true" style="padding-bottom: 1px;">
  41. <el-radio-group v-model="formData.buyPeople" @change="formData.workerName = '';formData.workerMobile=''">
  42. <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="WORKER">内部师傅</el-radio>
  43. <el-radio :disabled="formData.flag != 'SAVE' && formType!=0" label="CUSTOMER">客户</el-radio>
  44. </el-radio-group>
  45. </el-form-item>
  46. </el-col>
  47. <template v-if="formData.buyPeople == 'CUSTOMER'">
  48. <el-col :span="8">
  49. <el-form-item label="客户姓名" prop="workerName" :required="true">
  50. <el-input type="text" :disabled="formData.flag != 'SAVE' && formType!=0" v-model="formData.workerName" placeholder="请输入"></el-input>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="8">
  54. <el-form-item label="客户联系电话" prop="workerMobile" :required="true">
  55. <el-input type="text" :disabled="formData.flag != 'SAVE' && formType!=0" v-model="formData.workerMobile" placeholder="请输入"></el-input>
  56. </el-form-item>
  57. </el-col>
  58. </template>
  59. <template v-else>
  60. <el-col :span="8">
  61. <el-form-item label="师傅姓名" prop="worker" :required="true">
  62. <el-select v-model="formData.worker" :disabled="formData.flag != 'SAVE' && formType!=0" value-key="nickName" @focus="()=>{
  63. if(!this.formData.websitId){return this.$message.warning('请先选择网点名称!');}
  64. }" filterable @change="changeWorker" @blur="workerBlur" placeholder="请选择" style="width: 100%;">
  65. <el-option
  66. v-for="item in workerList"
  67. :key="item.id"
  68. :label="item.nickName + '-' + item.mobile"
  69. :value="item">
  70. </el-option>
  71. </el-select>
  72. </el-form-item>
  73. </el-col>
  74. <!-- <el-col :span="8">
  75. <el-form-item label="师傅身份证" prop="identity" :required="true">
  76. <el-input type="text" :disabled="formData.flag != 'SAVE' && formType!=0" v-model="formData.identity" placeholder="请输入"></el-input>
  77. </el-form-item>
  78. </el-col> -->
  79. <el-col :span="8">
  80. <el-form-item label="师傅联系电话" prop="workerMobile" :required="true">
  81. <el-input type="text" :disabled="formData.flag != 'SAVE' && formType!=0" v-model="formData.workerMobile" placeholder="请输入"></el-input>
  82. </el-form-item>
  83. </el-col>
  84. </template>
  85. <el-col :span="8" v-if="id">
  86. <el-form-item label="单据金额">
  87. <el-input type="text" :value="formData.totalAmount" disabled></el-input>
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="6" v-if="id">
  91. <el-form-item label="制单人">
  92. <el-input type="text" :value="formData.createBy" disabled></el-input>
  93. </el-form-item>
  94. </el-col>
  95. <el-col :span="6" v-if="id">
  96. <el-form-item label="制单时间">
  97. <el-input type="text" :value="formData.createTime" disabled></el-input>
  98. </el-form-item>
  99. </el-col>
  100. <el-col :span="6" v-if="id">
  101. <el-form-item label="审核人">
  102. <el-input type="text" :value="formData.confirmBy" disabled></el-input>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="6" v-if="id">
  106. <el-form-item label="审核时间">
  107. <el-input type="text" :value="formData.confirmTime" disabled></el-input>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="12">
  111. <el-form-item label="订单来源" prop="source" :required="true">
  112. <el-select v-model="formData.source" :disabled="true" placeholder="请选择" style="width: 100%;">
  113. <el-option
  114. v-for="item in [{name: '在线订单',id: 'ONLINE'},{name: '自建订单',id: 'SELF'}]"
  115. :key="item.id"
  116. :label="item.name"
  117. :value="item.id">
  118. </el-option>
  119. </el-select>
  120. </el-form-item>
  121. </el-col>
  122. <el-col :span="9">
  123. <el-form-item label="支付方式" prop="payType" :required="true">
  124. <el-select v-model="formData.payType" :disabled="formData.flag != 'SAVE' && formType!=0" placeholder="请选择" style="width: 100%;">
  125. <el-option
  126. v-for="item in [{name: '现金',id: 'CASH'},{name: '微信',id: 'WECHAT'}]"
  127. :key="item.id"
  128. :label="item.name"
  129. :value="item.id">
  130. </el-option>
  131. </el-select>
  132. </el-form-item>
  133. </el-col>
  134. <el-col :span="3" v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'">
  135. <div style="height: 32px;display: flex;align-items: center;cursor: pointer;" @click="wxPay()">微信支付<i class="el-icon-full-screen"></i></div>
  136. </el-col>
  137. <el-col :span="24">
  138. <el-form-item label="备注">
  139. <el-input type="textarea" :rows="4" :disabled="formData.flag != 'SAVE' && formType!=0" v-model="formData.remark" placeholder="请输入"></el-input>
  140. </el-form-item>
  141. </el-col>
  142. </el-row>
  143. </el-form>
  144. </div>
  145. </el-card>
  146. <el-card class="box-card">
  147. <div slot="header" class="clearfix">
  148. <span>辅材信息</span>
  149. </div>
  150. <el-button size="small" v-if="formData.flag == 'SAVE' || formType==0" type="primary" @click="add()">添加</el-button>
  151. <div class="table">
  152. <el-table :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
  153. <el-table-column label="大类名称" align="center">
  154. <template slot-scope="scope">
  155. <el-select v-model="scope.row.parentCategory" value-key="categoryId" @change="changeMain" :disabled="isEdit != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
  156. <el-option
  157. v-for="item in mainList"
  158. :key="item.categoryId"
  159. :label="item.categoryName"
  160. :value="item">
  161. </el-option>
  162. </el-select>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="小类名称" align="center">
  166. <template slot-scope="scope">
  167. <el-select v-model="scope.row.goodsCategory" @change="changeSmall" @focus="()=>{
  168. if(!scope.row.parentCategory){return this.$message.warning('请先选择大类!');}
  169. }" :disabled="isEdit != scope.$index || formType == 2" value-key="categoryId" placeholder="请选择" style="width: 100%;">
  170. <el-option
  171. v-for="item in scope.row.parentCategory.items"
  172. :key="item.categoryId"
  173. :label="item.categoryName"
  174. :value="item">
  175. </el-option>
  176. </el-select>
  177. </template>
  178. </el-table-column>
  179. <el-table-column label="辅材名称" align="center">
  180. <template slot-scope="scope">
  181. <el-select v-model="scope.row.goods" @change="changeGoods" value-key="goodsId" :disabled="isEdit != scope.$index || formType == 2" placeholder="请选择" style="width: 100%;">
  182. <el-option
  183. v-for="item in scope.row.goodsList"
  184. :key="item.goodsId"
  185. :label="item.goodsName"
  186. :value="item">
  187. </el-option>
  188. </el-select>
  189. </template>
  190. </el-table-column>
  191. <el-table-column prop="goods.goodsSalesUnit" align="center" label="单位" ></el-table-column>
  192. <el-table-column prop="" align="center" label="数量" >
  193. <template slot-scope="scope">
  194. <el-input type="number" v-model="scope.row.salesQty" :disabled="isEdit != scope.$index || formType == 2" placeholder="请输入"></el-input>
  195. </template>
  196. </el-table-column>
  197. <el-table-column prop="goods.goodsCode" align="center" label="商品代码"></el-table-column>
  198. <el-table-column prop="goods.goodsSpecification" align="center" label="规格型号"></el-table-column>
  199. <el-table-column prop="goods.price" align="center" label="销售价格"></el-table-column>
  200. <el-table-column prop="" align="center" label="销售金额" >
  201. <template slot-scope="scope" v-if="scope.row.salesQty && scope.row.goods && scope.row.goods.price">
  202. {{((scope.row.goods.price * 100) * scope.row.salesQty / 100).toFixed(2)}}
  203. </template>
  204. </el-table-column>
  205. <el-table-column prop="goods.qty" align="center" label="库存数量"></el-table-column>
  206. <el-table-column label="操作" align="right" width="140">
  207. <template slot-scope="scope" v-if="formType != 2">
  208. <el-button size="mini" type="primary" v-if="scope.$index != isEdit" @click="isEdit = scope.$index">编辑</el-button>
  209. <el-button size="mini" type="danger" @click="dataList.splice(scope.$index,1)">删除</el-button>
  210. </template>
  211. </el-table-column>
  212. </el-table>
  213. </div>
  214. </el-card>
  215. <div class="page-footer">
  216. <div class="footer">
  217. <el-button v-if="formType == 0 || (formType == 1 && formData.flag == 'SAVE')" size="small" type="primary" @click="save()">保存</el-button>
  218. <el-button v-if="formType != 0 && formData.flag == 'SAVE'" size="small" type="primary" @click="submit()">提交</el-button>
  219. <el-button v-if="formData.flag == 'SUBMIT' && formData.payType == 'WECHAT'" size="small" type="primary" @click="wxPay()">微信支付</el-button>
  220. <el-button v-if="formData.flag == 'PAY_NOT_TAKE'" size="small" type="primary" @click="confirm()">确认提货</el-button>
  221. <el-button size="small" type="info" @click="goBack">返回</el-button>
  222. </div>
  223. </div>
  224. <el-dialog title="微信支付" :visible.sync="isPay" width="50%" :close-on-click-modal="false" :modal-append-to-body="false" @close="payCodeUrl = '';clear()">
  225. <h3 style="text-align: center;">扫二维码支付</h3>
  226. <!-- <el-image :src="payCodeUrl" fit="fit"></el-image> -->
  227. <div
  228. ref="payQRCode"
  229. style="display: flex; justify-content: center;"
  230. />
  231. <div style="color: #EA8000;text-align: center;margin-top: 20px;">注:支付成功后,方可操作确认提货!</div>
  232. <div style="display: flex;justify-content: flex-end;margin-top: 30px;">
  233. <el-button size="mini" type="text" @click="isPay = false;clear()">取消</el-button>
  234. <el-button size="small" type="primary" @click="isPay = false;getDetail()">确定</el-button>
  235. </div>
  236. </el-dialog>
  237. </div>
  238. </template>
  239. <script>
  240. import { getWebsit } from "@/api/customerManagement";
  241. import QRCode from "qrcodejs2";
  242. import { getWorker, getCategory, getGoods, getDetail, add, edit, confirm, submit, getCode } from "@/api/auxiliaryFittings/auxiliarySalesOrder";
  243. export default {
  244. props: ['id','title','formType'],
  245. data() {
  246. return {
  247. dataList: [],
  248. websitList: [],
  249. workerList: [],
  250. mainList: [],
  251. isPay: false,
  252. payCodeUrl: '',
  253. formData: {
  254. websit: {},
  255. websitId: '',
  256. websitName: '',
  257. file_url: [],
  258. salesId: '',
  259. flag: '',
  260. createBy: '',
  261. createTime: '',
  262. confirmBy: '',
  263. confirmTime: '',
  264. worker: {},
  265. workerName: '',
  266. workerId: '',
  267. identity: '',
  268. workerMobile: '',
  269. source: 'SELF',
  270. payType: '',
  271. remark: '',
  272. totalAmount: '',
  273. buyPeople: 'WORKER'
  274. },
  275. isEdit: 0,
  276. is_submit: true,
  277. timer: '',
  278. companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
  279. rules: {
  280. websitId: [
  281. { required: true, message: '请选择网点', trigger: 'change' }
  282. ],
  283. worker: [
  284. { required: true, message: '请选择师傅', trigger: 'change' }
  285. ],
  286. source: [
  287. { required: true, message: '请选择订单来源', trigger: 'change' }
  288. ],
  289. payType: [
  290. { required: true, message: '请选择订单来源', trigger: 'change' }
  291. ],
  292. identity: [
  293. { required: true, message: '请输入师傅身份证', trigger: 'blur' },
  294. { pattern:/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '身份证号格式不正确', trigger: 'blur' }
  295. ],
  296. workerMobile: [
  297. { required: true, message: `请输入联系电话`, trigger: 'blur' },
  298. { required: true, message: `请输入联系电话`, trigger: 'change' },
  299. { pattern:/^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
  300. ],
  301. workerName: [
  302. { required: true, message: '请输入客户姓名', trigger: 'blur' }
  303. ],
  304. }
  305. };
  306. },
  307. computed: {},
  308. created() {
  309. if(this.id){
  310. this.getDetail()
  311. }
  312. this.getWebsit()
  313. },
  314. methods: {
  315. // 返回
  316. goBack() {
  317. this.$emit('back');
  318. },
  319. async getDetail(){
  320. const that = this
  321. getDetail({salesId: this.id}).then( async res => {
  322. Object.assign(this.formData, res.data, {
  323. websit: {websitId: res.data.websitId,name: res.data.websitName},
  324. worker: {nickName: res.data.workerName,userId: res.data.workerId}
  325. })
  326. this.getWorker()
  327. this.getCategory(res.data.websitId)
  328. this.formData.remark = res.data.remark
  329. for(var item of res.data.items){
  330. item.parentCategory = {categoryId: item.parentCategoryId,categoryName: item.parentCategoryName, items: [{categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}]}
  331. item.goodsCategory = {categoryId: item.goodsCategoryId,categoryName: item.goodsCategoryName}
  332. var ress = await that.getGoods(item.goodsCategoryId,item.goodsName, 1)
  333. item.goods = ress.data
  334. item.goodsList = ress.data ? [ress.data] : []
  335. }
  336. this.dataList = res.data.items
  337. })
  338. },
  339. getWebsit(){
  340. getWebsit({type: 'C'}).then(res => {
  341. this.websitList = res.data
  342. })
  343. },
  344. changeWebsit(e){
  345. this.formData.websitId = e.websitId
  346. this.formData.websitName = e.name
  347. this.getWorker()
  348. this.getCategory(e.websitId)
  349. },
  350. getCategory(websitId){
  351. getCategory({websitId}).then(res => {
  352. this.mainList = res.data
  353. })
  354. },
  355. async getGoods(categoryId,goodsName,type){
  356. const that = this
  357. if(type == 1){
  358. return new Promise((resolve, reject) => {
  359. getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M',goodsName: goodsName}).then(res => {
  360. resolve({
  361. data: res.data[0]
  362. })
  363. })
  364. })
  365. }else{
  366. getGoods({websitId: this.formData.websitId,categoryId: categoryId,type: 'M'}).then(res => {
  367. that.dataList[that.isEdit].goodsList = res.data
  368. })
  369. }
  370. },
  371. getWorker(){
  372. getWorker({pageNum: 1,pageSize: -1,params: [{param: 'b.websit_id',compare: '=',value: this.formData.websitId}]}).then(res => {
  373. this.workerList = res.data.records
  374. })
  375. },
  376. changeWorker(e){
  377. this.formData.identity = e.idCard
  378. this.formData.workerMobile = e.mobile
  379. this.formData.workerId = e.userId
  380. this.formData.workerName = e.nickName
  381. },
  382. workerBlur(e){
  383. this.formData.worker = e.target.value
  384. this.$forceUpdate()
  385. },
  386. changeMain(e){
  387. this.dataList[this.isEdit].goodsList = [],
  388. this.dataList[this.isEdit].parentCategory = e,
  389. this.dataList[this.isEdit].parentCategoryId = e.categoryId,
  390. this.dataList[this.isEdit].parentCategoryName = e.categoryName,
  391. this.dataList[this.isEdit].goodsCategory = {},
  392. this.dataList[this.isEdit].goodsCategoryName = '',
  393. this.dataList[this.isEdit].goodsCategoryId = '',
  394. this.dataList[this.isEdit].goods = {},
  395. this.dataList[this.isEdit].goodsId = '',
  396. this.dataList[this.isEdit].goodsName = '',
  397. this.dataList[this.isEdit].goodsSalesUnit = '',
  398. this.dataList[this.isEdit].goodsSpecification = '',
  399. this.dataList[this.isEdit].goodsCode = '',
  400. this.dataList[this.isEdit].price = '',
  401. this.dataList[this.isEdit].saleAmount = '',
  402. this.dataList[this.isEdit].salesQty = ''
  403. this.dataList[this.isEdit].qty = '',
  404. this.dataList[this.isEdit].goodsType = 'M'
  405. },
  406. async changeSmall(e){
  407. this.dataList[this.isEdit].goods = {},
  408. this.dataList[this.isEdit].goodsId = '',
  409. this.dataList[this.isEdit].goodsName = '',
  410. this.dataList[this.isEdit].goodsSalesUnit = '',
  411. this.dataList[this.isEdit].goodsSpecification = '',
  412. this.dataList[this.isEdit].goodsCode = '',
  413. this.dataList[this.isEdit].price = '',
  414. this.dataList[this.isEdit].saleAmount = '',
  415. this.dataList[this.isEdit].salesQty = ''
  416. this.dataList[this.isEdit].qty = '',
  417. this.dataList[this.isEdit].goodsCategoryId = e.categoryId
  418. this.dataList[this.isEdit].goodsCategoryName = e.categoryName
  419. getGoods({websitId: this.formData.websitId,categoryId: e.categoryId,type: 'M'}).then(res => {
  420. this.dataList[this.isEdit].goodsList = res.data
  421. })
  422. },
  423. changeGoods(e){
  424. console.log(e)
  425. this.dataList[this.isEdit].goodsId = e.goodsId
  426. this.dataList[this.isEdit].goodsName = e.goodsName
  427. this.dataList[this.isEdit].goodsSalesUnit = e.goodsSalesUnit
  428. this.dataList[this.isEdit].goodsSpecification = e.goodsSpecification
  429. this.dataList[this.isEdit].price = e.price
  430. this.dataList[this.isEdit].goodsCode = e. goodsCode
  431. this.dataList[this.isEdit].qty = e.qty
  432. },
  433. add(){
  434. if(this.dataList.length != 0){this.isEdit += 1}
  435. this.dataList.push({
  436. goodsList: [],
  437. parentCategory: {},
  438. parentCategoryId: '',
  439. parentCategoryName: '',
  440. goodsCategory: {},
  441. goodsCategoryName: '',
  442. goodsCategoryId: '',
  443. goods: {},
  444. goodsId: '',
  445. goodsName: '',
  446. goodsSalesUnit: '',
  447. goodsSpecification: '',
  448. goodsCode: '',
  449. price: '',
  450. saleAmount: '',
  451. salesQty: 1,
  452. qty: '',
  453. goodsType: 'M'
  454. })
  455. },
  456. submit(){
  457. this.$confirm(`请确定是否提交订单, 是否继续?`, '提示', {
  458. confirmButtonText: '确定',
  459. cancelButtonText: '取消',
  460. type: 'warning'
  461. }).then(() => {
  462. submit({
  463. salesId: this.formData.salesId
  464. }).then(res => {
  465. if(res.code == 200){
  466. this.$message.success('提交成功!')
  467. if(this.formData.payType == 'WECHAT'){
  468. this.wxPay()
  469. }else{
  470. this.goBack()
  471. }
  472. }
  473. })
  474. });
  475. },
  476. confirm(){
  477. this.$confirm(`请确定是否确认提货, 是否继续?`, '提示', {
  478. confirmButtonText: '确定',
  479. cancelButtonText: '取消',
  480. type: 'warning'
  481. }).then(() => {
  482. confirm({
  483. salesId: this.formData.salesId
  484. }).then(res => {
  485. if(res.code == 200){
  486. this.$message.success('审核成功!')
  487. this.goBack()
  488. }
  489. })
  490. });
  491. },
  492. checkPay(){
  493. this.timer = setInterval(()=>{
  494. getDetail({salesId: this.id}).then(res => {
  495. if(res.data.payFlag == 'YES'){
  496. this.clear()
  497. this.$message.success('支付成功!')
  498. this.goBack()
  499. }
  500. })
  501. },3000)
  502. },
  503. clear(){
  504. clearInterval(this.timer)
  505. },
  506. wxPay(){
  507. if(!this.is_submit){
  508. return false
  509. }
  510. this.is_submit = false
  511. setTimeout(()=>{
  512. this.is_submit = true
  513. },3000)
  514. getCode({
  515. salesId: this.formData.salesId
  516. }).then(res => {
  517. if(res.code == 200){
  518. this.payCodeUrl = res.data.codeUrl
  519. this.isPay = true
  520. this.$nextTick(() => {
  521. this.payUrl = res.data.codeUrl;
  522. new QRCode(this.$refs.payQRCode, {
  523. text: res.data.codeUrl,
  524. width: 200,
  525. height: 200,
  526. colorDark: "#333333", // 二维码颜色
  527. colorLight: "#ffffff", // 二维码背景色
  528. correctLevel: QRCode.CorrectLevel.L // 容错率,L/M/H
  529. });
  530. this.checkPay()
  531. });
  532. }
  533. })
  534. },
  535. save(){
  536. this.$refs.formData.validate((valid, invalidFields, errLabels) => {
  537. if (valid) {
  538. if(this.formType == 0){
  539. add({
  540. goodsType: 'M',
  541. source: this.formData.source,
  542. payType: this.formData.payType,
  543. remark: this.formData.remark,
  544. websitId: this.formData.websitId,
  545. websitName: this.formData.websitName,
  546. workerName: this.formData.workerName,
  547. workerId: this.formData.workerId,
  548. identity: this.formData.identity,
  549. workerMobile: this.formData.workerMobile,
  550. buyPeople: this.formData.buyPeople,
  551. items: this.dataList
  552. }).then(res => {
  553. if(res.code == 200){
  554. this.$message.success('提交成功!')
  555. this.goBack()
  556. }
  557. })
  558. }else if(this.formType == 1){
  559. edit({
  560. salesId: this.formData.salesId,
  561. goodsType: 'M',
  562. source: this.formData.source,
  563. payType: this.formData.payType,
  564. remark: this.formData.remark,
  565. websitId: this.formData.websitId,
  566. websitName: this.formData.websitName,
  567. workerName: this.formData.workerName,
  568. workerId: this.formData.workerId,
  569. identity: this.formData.identity,
  570. workerMobile: this.formData.workerMobile,
  571. buyPeople: this.formData.buyPeople,
  572. items: this.dataList
  573. }).then(res => {
  574. if(res.code == 200){
  575. this.dataList = []
  576. this.$message.success('提交成功!')
  577. this.goBack()
  578. }
  579. })
  580. }
  581. }
  582. })
  583. }
  584. }
  585. };
  586. </script>
  587. <style scoped="scoped" lang="scss">
  588. .s-page {
  589. padding: 20px;
  590. background-color: #ffffff;
  591. }
  592. .page-footer {
  593. height: 70px;
  594. }
  595. .footer {
  596. position: fixed;
  597. bottom: 0;
  598. left: 0;
  599. z-index: 1;
  600. width: 100%;
  601. background: #fff;
  602. padding: 15px 40px;
  603. box-sizing: border-box;
  604. transition: all 0.28s;
  605. text-align: right;
  606. box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
  607. &.hideSidebar {
  608. margin-left: 54px;
  609. width: calc(100vw - 54px);
  610. }
  611. &.openSidebar {
  612. margin-left: 210px;
  613. width: calc(100vw - 210px);
  614. }
  615. .tips {
  616. font-size: 12px;
  617. color: red;
  618. margin-top: 10px;
  619. }
  620. }
  621. </style>