detail.vue 12 KB

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