detail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  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="12">
  13. <el-form-item label="所属商户" :required="true" >
  14. <el-input type="text" :value="companyName" disabled></el-input>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :span="12">
  18. <el-form-item label="工程名称" :required="true">
  19. <el-input type="text" v-model="formData.projectName" disabled></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :span="6">
  23. <el-form-item label="工程编号" :required="true">
  24. <el-input type="text" disabled v-model="formData.projectNo" placeholder="请输入"></el-input>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :span="6">
  28. <el-form-item label="负责人" :required="true">
  29. <el-input type="text" disabled v-model="formData.manger" placeholder="请输入"></el-input>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="6">
  33. <el-form-item label="联系电话" :required="true">
  34. <el-input type="text" disabled v-model="formData.mobile" placeholder="请输入"></el-input>
  35. </el-form-item>
  36. </el-col>
  37. <el-col :span="6">
  38. <el-form-item label="项目时间" :required="true">
  39. <el-date-picker
  40. style="width:50%"
  41. v-model="formData.startTime"
  42. type="date"
  43. :disabled="true"
  44. value-format="yyyy-MM-dd"
  45. placeholder="开始日期">
  46. </el-date-picker>
  47. <el-date-picker
  48. style="width:50%"
  49. v-model="formData.endTime"
  50. type="date"
  51. :disabled="true"
  52. value-format="yyyy-MM-dd"
  53. placeholder="结束日期">
  54. </el-date-picker>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="24">
  58. <el-form-item label="项目地址" :required="true">
  59. <el-row>
  60. <el-col :span="5" style="margin-right: 12px;">
  61. <el-input type="text" v-model="formData.province" disabled placeholder="请选择省"></el-input>
  62. </el-col>
  63. <el-col :span="5" style="margin-right: 12px;">
  64. <el-input type="text" v-model="formData.city" disabled placeholder="请选择市"></el-input>
  65. </el-col>
  66. <el-col :span="5" style="margin-right: 12px;">
  67. <el-input type="text" v-model="formData.area" disabled placeholder="请选择区"></el-input>
  68. </el-col>
  69. <el-col :span="8">
  70. <el-input type="text" v-model="formData.street" disabled placeholder="请选择街道"></el-input>
  71. </el-col>
  72. </el-row>
  73. </el-form-item>
  74. </el-col>
  75. <el-col :span="24">
  76. <el-form-item label="" prop="address">
  77. <el-row :gutter="20">
  78. <el-col :span="24">
  79. <el-input type="text" v-model="formData.address" disabled placeholder="详细地址"></el-input>
  80. </el-col>
  81. <!-- <el-col :span="2">
  82. <geographicalPosi :disabled="formType==2" :formData="this.formData" @selectPosi="selectAddress"/>
  83. </el-col> -->
  84. </el-row>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :span="24">
  88. <el-form-item label="项目说明">
  89. <el-input type="textarea" :rows="4" disabled v-model="formData.remark" placeholder="请输入"></el-input>
  90. </el-form-item>
  91. </el-col>
  92. <el-col :span="6">
  93. <el-form-item label="销售订单数" :required="true">
  94. <el-input type="text" disabled v-model="detail.salesNum" placeholder="请输入"></el-input>
  95. </el-form-item>
  96. </el-col>
  97. <el-col :span="6">
  98. <el-form-item label="销售金额" :required="true">
  99. <el-input type="text" disabled v-model="detail.salesPrice" placeholder="请输入"></el-input>
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="6">
  103. <el-form-item label="返还单数量" :required="true">
  104. <el-input type="text" disabled v-model="detail.retNum" placeholder="请输入"></el-input>
  105. </el-form-item>
  106. </el-col>
  107. <el-col :span="6">
  108. <el-form-item label="退货金额" :required="true">
  109. <el-input type="text" disabled v-model="detail.retPrice" placeholder="请输入"></el-input>
  110. </el-form-item>
  111. </el-col>
  112. <el-col :span="6">
  113. <el-form-item label="应收金额" :required="true">
  114. <el-input type="text" disabled v-model="detail.price" placeholder="请输入"></el-input>
  115. </el-form-item>
  116. </el-col>
  117. <el-col :span="6">
  118. <el-form-item label="已收金额" :required="true">
  119. <el-input type="text" disabled v-model="detail.givePrice" placeholder="请输入"></el-input>
  120. </el-form-item>
  121. </el-col>
  122. <el-col :span="6">
  123. <el-form-item label="待收金额" :required="true">
  124. <el-input type="text" disabled v-model="detail.waitPrice" placeholder="请输入"></el-input>
  125. </el-form-item>
  126. </el-col>
  127. </el-row>
  128. </el-form>
  129. </div>
  130. </el-card>
  131. <el-card class="box-card">
  132. <div slot="header" class="clearfix">
  133. <span>收款信息</span>
  134. </div>
  135. <div class="mymain-container">
  136. <el-form ref="formData1" :rules="rules1" :model="formData1" label-width="110px" size="small" label-position="left">
  137. <el-row :gutter="20" justify="start">
  138. <el-col :span="24">
  139. <el-form-item label="收款金额" prop="price">
  140. <el-input type="text" v-model="formData1.price" placeholder="请输入"></el-input>
  141. </el-form-item>
  142. </el-col>
  143. <el-col :span="24">
  144. <el-form-item label="收款凭证" prop="fileUrl">
  145. <ImageUpload :fileList="formData1.fileUrl" :limit="1" />
  146. </el-form-item>
  147. </el-col>
  148. <el-col :span="24">
  149. <el-form-item label="备注">
  150. <el-input type="textarea" :rows="4" v-model="formData1.remark" placeholder="请输入"></el-input>
  151. </el-form-item>
  152. </el-col>
  153. </el-row>
  154. </el-form>
  155. </div>
  156. </el-card>
  157. <el-card class="box-card">
  158. <div slot="header" class="clearfix">
  159. <span>收款记录</span>
  160. </div>
  161. <div class="table">
  162. <el-table :data="collectionList" element-loading-text="Loading" border fit highlight-current-row stripe>
  163. <el-table-column prop="status" label="收款结果" align="center">
  164. <template slot-scope="scope">
  165. {{scope.row.status == 'NO'?'未付款':scope.row.status == 'WAIT'?'部分付款':scope.row.status == 'OK'?'已完成':''}}
  166. </template>
  167. </el-table-column>
  168. <el-table-column prop="price" label="收款金额" align="center"></el-table-column>
  169. <el-table-column prop="" align="center" label="收款凭证" >
  170. <template slot-scope="scope" v-if="scope.row.urlPrc">
  171. <el-image style="width: 80px;" :src="scope.row.urlPrc" fit="scale-down" :preview-src-list="[scope.row.urlPrc]"></el-image>
  172. </template>
  173. </el-table-column>
  174. <el-table-column prop="remark" label="备注" align="center"></el-table-column>
  175. <el-table-column prop="updateBy" align="center" label="收款人" ></el-table-column>
  176. <el-table-column prop="updateTime" align="center" label="收款时间" ></el-table-column>
  177. </el-table>
  178. </div>
  179. </el-card>
  180. <div class="page-footer">
  181. <div class="footer">
  182. <el-button size="small" type="primary" @click="confirm()">确定</el-button>
  183. <el-button size="small" type="info" @click="goBack">返回</el-button>
  184. </div>
  185. </div>
  186. </div>
  187. </template>
  188. <script>
  189. import ImageUpload from '@/components/file-upload'
  190. import { lbsAmapRegion } from '@/api/common.js'
  191. import geographicalPosi from '@/components/geographicalPosi/index.vue'
  192. import { getDetail, givePrice, getPriceDetail } from "@/api/auxiliaryFittings/projectAuxiliaryManage";
  193. export default {
  194. components: {geographicalPosi,ImageUpload},
  195. props: ['id','title','formType'],
  196. data() {
  197. return {
  198. dataList: [],
  199. provinceList: [],
  200. cityList: [],
  201. areaList: [],
  202. streetList: [],
  203. collectionList: [],
  204. detail: {},
  205. formData: {
  206. projectName: ''
  207. },
  208. formData1: {
  209. price: '',
  210. remark: '',
  211. fileUrl: []
  212. },
  213. companyName: JSON.parse(localStorage.getItem('greemall_user')).companyName,
  214. rules: {
  215. websitId: [
  216. { required: true, message: '请选择网点', trigger: 'change' }
  217. ],
  218. workerName: [
  219. { required: true, message: '请输入客户姓名', trigger: 'blur' }
  220. ],
  221. },
  222. rules1: {
  223. price: [
  224. { required: true, message: '请输入收款金额', trigger: 'blur' },
  225. { pattern:/^[1-9]\d*(\.\d+)?$|^0\.[1-9]\d*$/, message: '请输入大于0的数字', trigger: 'blur' }
  226. ],
  227. fileUrl: [
  228. { required: true, message: '请上传收款凭证', trigger: 'change' }
  229. ],
  230. },
  231. };
  232. },
  233. computed: {},
  234. created() {
  235. if(this.id){
  236. this.getDetail()
  237. }
  238. this.getinitlbslist()
  239. },
  240. methods: {
  241. // 返回
  242. goBack() {
  243. this.$emit('back');
  244. },
  245. async getDetail(){
  246. const that = this
  247. getDetail({id: this.id}).then( async res => {
  248. this.detail = res.data
  249. Object.assign(this.formData, res.data.orderEnginBase)
  250. this.getPriceDetail(res.data.orderEnginBaseId)
  251. })
  252. },
  253. getPriceDetail(orderEnginBaseId){
  254. getPriceDetail({orderEnginBaseId,goodsType: 'P'}).then(res => {
  255. this.collectionList = res.data
  256. })
  257. },
  258. getinitlbslist() {
  259. // 初始化请求省市区街道下拉选项数据
  260. lbsAmapRegion({ pid: 0 }).then(res => {
  261. this.provinceList = res.data
  262. // 创建工单时获取ip地址定位赋值
  263. if (!this.id && this.$IpAdd.province) {
  264. var item = this.provinceList.find(item => item.name === this.$IpAdd.province)
  265. if (item) {
  266. this.formData.provinceId = item.id
  267. this.formData.province = item.name
  268. }
  269. }
  270. if (this.formData.provinceId) {
  271. lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
  272. this.cityList = res.data
  273. // 创建工单时获取ip地址定位赋值
  274. if (!this.id && this.$IpAdd.city) {
  275. var item2 = this.cityList.find(item => item.name === this.$IpAdd.city)
  276. if (item2) {
  277. this.formData.cityId = item2.id
  278. this.formData.city = item2.name
  279. }
  280. }
  281. if (this.formData.cityId) {
  282. lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
  283. this.areaList = res.data
  284. })
  285. }
  286. if (this.formData.areaId) {
  287. lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
  288. this.streetList = res.data
  289. })
  290. }
  291. })
  292. }
  293. })
  294. },
  295. selectAddress(data){
  296. this.formData.lng = data.center[0]
  297. this.formData.lat = data.center[1]
  298. // 获取定位的省市区街道
  299. var { province, city, district, township } = data.data.addressComponent
  300. // 获取选中省名称id
  301. var { id, name } = this.provinceList.find(item => item.name === province)
  302. this.formData.provinceId = id
  303. this.formData.province = name
  304. // 请求市选项
  305. lbsAmapRegion({ pid: this.formData.provinceId }).then(res => {
  306. // 赋值市选项
  307. this.cityList = res.data
  308. // 获取选中市名称id
  309. var { id, name } = res.data.find(item => item.name === city)
  310. this.formData.cityId = id
  311. this.formData.city = name
  312. // 请求区选项
  313. lbsAmapRegion({ pid: this.formData.cityId }).then(res => {
  314. // 赋值区选项
  315. this.areaList = res.data
  316. // 获取选中区名称id
  317. var { id, name } = res.data.find(item => item.name === district)
  318. this.formData.areaId = id
  319. this.formData.area = name
  320. // 请求街道选项
  321. lbsAmapRegion({ pid: this.formData.areaId }).then(res => {
  322. // 赋值街道选项
  323. this.streetList = res.data
  324. // 获取选中街道名称id
  325. var { id, name } = res.data.find(item => item.name === township)
  326. this.formData.streetId = id
  327. this.formData.street = name
  328. // 赋值GPS详细地址
  329. this.formData.address = data.name
  330. })
  331. })
  332. })
  333. },
  334. confirm(){
  335. this.$refs.formData1.validate((valid, invalidFields, errLabels) => {
  336. if (valid) {
  337. this.$confirm(`请确定是否确认提交收款信息, 是否继续?`, '提示', {
  338. confirmButtonText: '确定',
  339. cancelButtonText: '取消',
  340. type: 'warning'
  341. }).then(() => {
  342. givePrice({
  343. goodsType: this.detail.goodsType,
  344. orderEnginBaseId: this.detail.orderEnginBaseId,
  345. orderId: this.detail.orderEnginBaseId,
  346. price: this.formData1.price,
  347. remark: this.formData1.remark,
  348. urlPrc: this.formData1.fileUrl[0].url
  349. }).then(res => {
  350. if(res.code == 200){
  351. this.$message.success('提交成功!')
  352. this.goBack()
  353. }
  354. })
  355. });
  356. }
  357. })
  358. }
  359. }
  360. };
  361. </script>
  362. <style scoped="scoped" lang="scss">
  363. .s-page {
  364. padding: 20px;
  365. background-color: #ffffff;
  366. }
  367. .page-footer {
  368. height: 70px;
  369. }
  370. .footer {
  371. position: fixed;
  372. bottom: 0;
  373. left: 0;
  374. z-index: 1;
  375. width: 100%;
  376. background: #fff;
  377. padding: 15px 40px;
  378. box-sizing: border-box;
  379. transition: all 0.28s;
  380. text-align: right;
  381. box-shadow: 0 2px 5px 0 rgb(0 0 0 / 50%), 0 2px 5px 0 rgb(0 0 0 / 10%);
  382. &.hideSidebar {
  383. margin-left: 54px;
  384. width: calc(100vw - 54px);
  385. }
  386. &.openSidebar {
  387. margin-left: 210px;
  388. width: calc(100vw - 210px);
  389. }
  390. .tips {
  391. font-size: 12px;
  392. color: red;
  393. margin-top: 10px;
  394. }
  395. }
  396. </style>