detailsOrUpdates.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <template>
  2. <view>
  3. <u-table style="margin-bottom: 100rpx;" v-if="dataList.length > 0">
  4. <u-tr>
  5. <u-th width="80rpx">序号</u-th>
  6. <u-th>品名</u-th>
  7. <u-th>规格</u-th>
  8. <u-th>采购数量</u-th>
  9. <u-th>计量单位</u-th>
  10. <u-th>备注</u-th>
  11. </u-tr>
  12. <u-tr v-for="(item,index) in dataList" :key="index">
  13. <u-td class="fixedList" width="80rpx">{{index+1}}</u-td>
  14. <u-td class="fixedList"><text @click="tips(item.feeName)">{{item.feeName}}</text></u-td>
  15. <u-td class="fixedList"><text @click="tips(item.fCurrencyName)">{{item.fCurrencyName}}</text></u-td>
  16. <u-td class="fixedList"><text @click="tips(item.fPurchase)">{{item.fPurchase}}</text></u-td>
  17. <u-td class="fixedList"><text @click="tips(item.fFeeunitName)">{{item.fFeeunitName}}</text></u-td>
  18. <u-td class="fixedList"><text @click="tips(item.remark)">{{item.remark}}</text></u-td>
  19. </u-tr>
  20. </u-table>
  21. <u-empty v-else style="width: 50%;
  22. margin: 0 auto;
  23. height: 220rpx;
  24. align-items: center;
  25. position: absolute;
  26. top: 45%;
  27. left: 50%;
  28. transform:translate(-50%,-50%)" text="列表为空" mode="data"></u-empty>
  29. <view v-if="toExamine == true"
  30. style="width: 100%;position:fixed; bottom:0rpx;background-color: #FFFFFF;padding-left: 40rpx;padding-right: 40rpx;margin-bottom: 30rpx;margin-top: 100rpx;">
  31. <view style="float: left;width: 49%;">
  32. <u-button type="primary" @click="appToExamine(true)">审核通过</u-button>
  33. </view>
  34. <view style="float: right;width: 49%;">
  35. <u-button type="primary" @click="appToExamine(false)">审核拒绝</u-button>
  36. </view>
  37. </view>
  38. <view v-else-if="this.deptName == '外部用户'"
  39. style="width: 100%;position:fixed; bottom:0rpx;background-color: #FFFFFF;padding-left: 40rpx;padding-right: 40rpx;margin-bottom: 30rpx;margin-top: 100rpx;">
  40. <view style="float: left;width: 49%;">
  41. <u-button type="primary" @click="appCheckCode(true)">接单</u-button>
  42. </view>
  43. <view style="float: right;width: 49%;">
  44. <u-button type="primary" @click="appCheckCode(false)">拒绝</u-button>
  45. </view>
  46. </view>
  47. <u-modal v-model="show" :title="title" :show-cancel-button="true" :content-style="{margin: '40rpx auto'}"
  48. @confirm="confirm">
  49. <view class="slot-content">
  50. <rich-text v-if="tpye == true && dataList.length > 0" :nodes="content" style="text-align: center;">
  51. </rich-text>
  52. <u-form v-else style="width: 90%;margin: 0 auto;">
  53. <u-form-item label="拒绝理由:" label-width="130rpx">
  54. <u-input height="20rpx" :clearable="false" type="textarea" v-model="value" />
  55. </u-form-item>
  56. </u-form>
  57. </view>
  58. </u-modal>
  59. <u-modal v-model="showTwo" :title="titleTwo" :show-cancel-button="true" :content-style="{margin: '40rpx auto'}"
  60. @confirm="confirmTwo">
  61. <view class="slot-content">
  62. <!-- <rich-text v-if="ToExamineType == true && dataList.length > 0" :nodes="content" style="text-align: center;"></rich-text> -->
  63. <u-form v-if="ToExamineType == true && dataList.length > 0" style="width: 90%;margin: 0 auto;">
  64. <u-form-item label="同意意见:" label-width="130rpx">
  65. <u-input height="20rpx" :clearable="false" type="textarea" v-model="valueTwo" />
  66. </u-form-item>
  67. </u-form>
  68. <u-form v-else style="width: 90%;margin: 0 auto;">
  69. <u-form-item label="拒绝理由:" label-width="130rpx">
  70. <u-input height="20rpx" :clearable="false" type="textarea" v-model="valueTwo" />
  71. </u-form-item>
  72. </u-form>
  73. </view>
  74. </u-modal>
  75. </view>
  76. </template>
  77. <script>
  78. export default {
  79. data() {
  80. return {
  81. show: false,
  82. showTwo: false,
  83. title: '',
  84. titleTwo: '',
  85. value: '',
  86. valueTwo: '',
  87. content: `是否接单`,
  88. dataList: [],
  89. form: {},
  90. textw: false,
  91. deptName: '',
  92. tpye: '',
  93. ToExamineType: '',
  94. toExamine: false,
  95. };
  96. },
  97. onLoad(option) {
  98. this.deptName = uni.getStorageSync('deptName')
  99. // console.log(uni.getStorageSync('deptName'))
  100. this.toExamine = JSON.parse(option.toExamine)
  101. console.log(JSON.parse(option.form))
  102. this.formData = JSON.parse(option.form)
  103. let data = this.toExamine == true ? JSON.parse(option.form).billId : JSON.parse(option.form).fId
  104. this.$u.get('/anPin/anPinApp/' + data).then(res => {
  105. // console.log(res)
  106. this.form = res.data.warehouseBills
  107. this.dataList = res.data.tWarehousebillsfees
  108. })
  109. },
  110. methods: {
  111. tips(text) {
  112. console.log(this.textw)
  113. uni.showToast({
  114. icon: 'none',
  115. title: text,
  116. position: "center"
  117. })
  118. },
  119. appCheckCode(tpye) {
  120. this.tpye = tpye
  121. this.show = true
  122. if (tpye == true) {
  123. this.title = '提示'
  124. } else {
  125. this.title = '是否拒绝'
  126. }
  127. },
  128. confirm() {
  129. if (this.tpye == false) {
  130. if (this.value) {
  131. this.operationSucceeded()
  132. } else {
  133. this.show = true
  134. uni.showToast({
  135. icon: 'none',
  136. title: '请填写拒绝理由',
  137. position: "center"
  138. })
  139. }
  140. } else {
  141. this.operationSucceeded()
  142. }
  143. },
  144. appToExamine(ToExamineType) {
  145. console.log(ToExamineType)
  146. this.ToExamineType = ToExamineType
  147. this.showTwo = true
  148. if (ToExamineType == true) {
  149. this.titleTwo = '确认同意'
  150. } else {
  151. this.titleTwo = '确认拒绝'
  152. }
  153. },
  154. confirmTwo() {
  155. if (this.ToExamineType == false) {
  156. if (this.valueTwo) {
  157. this.$u.post('/warehouse/paths/approvalRejected', {
  158. actId: 520,
  159. auditItem: new Date().getFullYear() + '-' + Number(new Date().getMonth()+1) + '-' + new Date().getDate(),
  160. auditMsg: this.valueTwo,
  161. auditUserId: uni.getStorageSync('userId'),
  162. billId: this.form.fId,
  163. id: this.form.fId
  164. }).then(res => {
  165. uni.navigateBack();
  166. })
  167. } else {
  168. this.showTwo = true
  169. uni.showToast({
  170. icon: 'none',
  171. title: '请填写拒绝理由',
  172. position: "center"
  173. })
  174. }
  175. } else {
  176. // let tiem = moment(Date.parse(new Date())).format('YYYY-MM-DD')
  177. if (this.valueTwo) {
  178. this.$u.post('/warehouse/paths/approved', {
  179. actId: 520,
  180. auditItem: new Date().getFullYear() + '-' + Number(new Date().getMonth()+1) + '-' + new Date().getDate(),
  181. auditMsg: this.valueTwo,
  182. auditUserId: uni.getStorageSync('userId'),
  183. billId: this.form.fId,
  184. id: this.form.fId
  185. }).then(res => {
  186. uni.navigateBack();
  187. })
  188. } else {
  189. this.showTwo = true
  190. uni.showToast({
  191. icon: 'none',
  192. title: '请填写同意意见',
  193. position: "center"
  194. })
  195. }
  196. }
  197. },
  198. approve(type) {
  199. if (type == true) {} else {
  200. this.$u.post('/warehouse/paths/approvalRejected', {}).then(res => {
  201. console.log(res)
  202. // uni.navigateBack();
  203. })
  204. }
  205. },
  206. operationSucceeded() {
  207. this.$u.post('/anPin/anPinApp/updateMessage', {
  208. fTakeOrders: this.tpye == true ? 1 : 2,
  209. fId: this.form.fId,
  210. fReason: this.value,
  211. }).then(res => {
  212. uni.showToast({
  213. icon: 'none',
  214. title: '操作成功',
  215. position: "center"
  216. })
  217. uni.navigateBack();
  218. })
  219. }
  220. }
  221. };
  222. </script>
  223. <style scoped lang="scss">
  224. .fixedList {
  225. height: 62rpx;
  226. white-space: nowrap;
  227. overflow: hidden;
  228. text-overflow: ellipsis;
  229. display: block;
  230. z-index: 1;
  231. }
  232. </style>